This demos the ability to create Kubernetes clusters using Argo CD, Argo Workflows, Argo Events, and Cluster API.
At a minimum you need
- KIND (and all it's dependecies)
clusterctl
You need to create a KIND cluster that will be your management cluster. You first need to set up the configuration.
cat <<EOF > kind-config.yaml
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraMounts:
- hostPath: /var/run/docker.sock
containerPath: /var/run/docker.sock
EOF
Next, use this config to create your KIND cluster
kind create cluster --config=kind-config.yaml --name=manager
Once you see this output, you're good to go.
Creating cluster "manager" ...
โ Ensuring node image (kindest/node:v1.25.0) ๐ผ
โ Preparing nodes ๐ฆ
โ Writing configuration ๐
โ Starting control-plane ๐น๏ธ
โ Installing CNI ๐
โ Installing StorageClass ๐พ
Set kubectl context to "kind-manager"
You can now use your cluster with:
kubectl cluster-info --context kind-manager
Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community ๐
You should have a KIND cluster running
kind get clusters
Initialize this cluster with the Docker Cluster API infrastructure provider.
export CLUSTER_TOPOLOGY=true
clusterctl init --infrastructure docker
Install Argo Components onto the management cluster
until kubectl apply -k https://github.com/christianh814/argocd-capi-demo/bootstrap/install/; do sleep 3; done
This installs the following
- Argo CD
- Argo Workflows
- Argo Events
Open another terminal tab and run port-forward to get to the Argo CD UI.
kubectl port-forward -n argocd svc/argocd-server 8080:80
Extract the Argo CD password so you can login to the UI as the admin
user
๐จ NOTE For the purposes of this demo, don't change the Argo CD Admin password
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 -d ; echo
Before deploying the argo components, make sure everything is up and running
kubectl rollout status -n argo-events $(kubectl get deployment -n argo-events -l eventsource-name=webhook -o name)
kubectl rollout status -n argo-events $(kubectl get deployment -n argo-events -l sensor-name=webhook -o name)
kubectl rollout status sts/argocd-application-controller -n argocd
Create the ApplicationSets
kubectl apply -k https://github.com/christianh814/argocd-capi-demo/apps/argo/overlays/default
You should have (after a few minutes) two Kubernetes clusters running in KIND.
Also, each one of these CAPI Clusters have a sample workload running on them.
Running the following...
kind get clusters
Should now show that you have a management cluster and two CAPI Clusters.
cluster1
cluster2
manager
Just delete your KIND clusters
kind delete clusters --all