This repository contains slides, Kubernetes manifest files and instructions for my talk Deploy N Applications to N Clusters using Argo CD ApplicationSet. This is not a stand-alone workshop repository. You will need to refer to the talk slides/video to make sense of the exercises provided below. The resource section contains suggested readings/resources on GitOps, Argo CD and ApplicationSet.
- An understanding of Kubernetes, GitOps and Argo CD
- Access to at least two managed Kubernetes clusters (recent versions preferred). For ease of reference, we'll call the cluster where Argo CD is installed
cluster-manager
and the other cluster(s) asmanaged-cluster
. - kubectl & argocd CLI tools installed (recent versions required)
- kubectx for easy Kubernetes cluster context switching (optional)
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj-labs/applicationset/v0.2.0/manifests/install.yaml
- Change the argocd-server service type to LoadBalancer
kubectl patch svc argocd-server -n argocd -p '{"spec": {"type": "LoadBalancer"}}'
- Wait a few minutes for the loadbalancer to be available:
kubectl get svc -A | grep argocd-server
Right next to the private IP column, you will see a public IP for the argocd-server
service.
- From a web browser, navigate to that public IP. Use
admin
as the username and find the default password from the following command (Argo CD v1.9 and later):
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
- Change the default admin password for Argo CD server from the CLI:
argocd login <public IP found in step2>
Use the same credentials from Step3.
Once succesfully logged in, use the following command to update the password:
argocd account update-password --current-password <default admin password> --new-password <set a password of your choice>
🚧 For the following examples, make sure that the namespace already exists on the cluster(s) prior to creating the Application/ApplicationSet custom resource(s).
kubectl create namespace kustomize-nginx-ns
kubectl apply -f files/kustomize-nginx-app.yaml -n argocd
List Generator example:
# Change the Kubernetes context first
kubectx <context for the managed-cluster>
# Create the namespace on the managed-cluster
kubectl create namespace guestbook-ns
kubectl apply -f files/list-generator.yaml -n argocd
Git Generator (directory) example:
kubectl apply -f files/git-generator-directory.yaml -n argocd
🚧 guestbook-jsonnet application will take longer to sync and appear healthy.
Matrix Generator (list & git directory) example:
kubectl apply -f files/matrix-generator.yaml -n argocd
As I deliver talks, I collect questions from the audience and then crowdsource the answers from the experts and the community. You can find a list of frequently asked questions on Argo CD here and on ApplicationSet here.
- The history of GitOps
- Continuous Lifecycle London 2018 Keynote on GitOps
- What is GitOps Really
- Alexis Richardson: GitOps - Git push all the things
- Everything You Need To Become a GitOps Ninja - Alex C. & Alexander M.
- GitOps in 1 slide
- GitOps Principles from the GitOps Working Group
- Kubernetes anti-patterns: Let's do GitOps, not CIOps!
- Argo CD - GitHub
- Argo CD - ReadTheDocs
- Companies using Argo CD
- Some GitOps best practices using Argo CD
- ApplicationSet Original Proposal
- ApplicationSet - GitHub
- ApplicationSet - ReadTheDocs
- ApplicationSet Introductory Blog by Jonathan West
- ApplicationSet Blog by Christian Hernandez