The repository demonstrates how to bootstrap and manage Argo CD.
The first exercise is to bootstrap Kubernetes cluster and install Argo CD using Github Codespaces environment.
-
Fork https://github.com/akuity/argocd-admin-training repositorty
-
Create Codespace.
- Navigate to forked repository
- Click on
Code -> Codespaces -> +
- Wait for codespace to be successfully initialized
- Install Argo CD resources and ensure deployment has started successfully
kustomize build argocd | kubectl apply -f -
kubectl rollout status deploy/argocd-server -n argocd
- Access Argo CD UI
- Click
Ports
tab in Github Codespaces UI - Locate 9090 port and open URL in browser
- Login using username
admin
and passwordpassword
- Configure Argo CD CLI access
argocd login localhost:9090 --username admin --password password --insecure --plaintext --grpc-web
Argo CD allows using web user interface and CLI to manage most of the settings. However it is recommended to manage settings declarativelly using Argo CD itself. During this exersice we are configuring declarative management and performing declarative upgrade.
- Create Argo CD application that manages Argo CD itself
argocd app create argocd --repo https://github.com/$GITHUB_USER/argocd-admin-training --path argocd --dest-namespace argocd --dest-name in-cluster
- Perform declarative upgrade
- Change
v2.10.6
tov2.10.7
in argocd/kustomization.yaml and push changes to Git repository: - Navigate to Argo CD UI & Oopen
argocd
application details page. - Preview changes and click
Sync
button to perform deploy.
Argo CD is designed to serve needs of multiple teams and provides reach set of multi-tenancy features. For example it allows having muliple users by creating local account or configuring SSO integation. Users can be separate from each other using Argo CD projects. In this exercise we are going to declaratively configure local account and a project.
- Uncomment
components: [team1]
in argocd/kustomization.yaml and push changes to Git repository. - Navigate to Argo CD UI & Oopen
argocd
application details page. - Preview changes and click
Sync
button to perform deploy. - Find a new account in
Settings->Accounts
page.
Argo CD allows users to create applications manually using web interface or CLI. However, Argo CD provides a way to automatically
generate application based on predefined convention using the ApplicationSet component. In this exercise we are going to automatically create
applications for each Helm values file under apps/<team-name>
directory. Example:
apps
└── team1
├── chart
└── qa.yaml # ApplicationSet generates application `team1-qa` in a project `team1` using helm chart under `apps/team1` and value file `qa.yaml`
- Replace
<GITHUB_USERNAME>
with your username in argocd/appset.yaml - Uncomment
- appset.yaml
in argocd/kustomization.yaml - Create
apps/team1/qa.yaml
file and push changes to Git repository:
cat >apps/team1/qa.yaml <<EOL
image:
repository: gcr.io/heptio-images/ks-guestbook-demo
tag: 0.2
EOL
- Navigate to Argo CD UI and see new application is created by application set