Deploy ArgoCD as a Github App.
Requirements:
- Kind
- Helm
- ArgoCD registered as a Github App with its own key installed in the repo (fill out
configs.credentialTemplates.github-app-creds:in argocd/argocd/values.yaml)- Github Settings -> Developer settings -> GitHub Apps: Create new App and get private key.
- Github Settings -> Applications: Configure read access to the repo.
kind create cluster --config=./kind/cluster.yamlhelm repo add argo https://argoproj.github.io/argo-helm && helm repo update
kubectl create ns argocd && helm upgrade --install -n argocd argocd argo/argo-cd --version 5.17.1 --values argocd/values.yaml Access ArgoCD through localhost:8080 (admin/argocd):
kubectl port-forward -n argocd svc/argocd-server 8080:80Generate password:
# If Linux:
# sudo apt-get install apache2-utils
ARGO_PWD=argocd
htpasswd -nbBC 10 "" $ARGO_PWD | tr -d ':\n' | sed 's/$2y/$2a/'Change the value of configs.secret.argocdServerAdminPassword: in argocd/argocd/values.yaml with this password.
# Deploy manifests from master branch in this repo in argocd/argocd/argo-apps/nginx-vanilla/ path.
# Update argocd/argo-apps/nginx-vanilla.yaml spec.source to read from other repo/branch/path (will require installing ArgoCD as github app if you change the repo)
kubectl apply -f argocd/argo-apps/nginx-vanilla.yaml
# Deploy Bitnami's Nginx Helm chart
kubectl apply -f argocd/argo-apps/standalone-nginx-bitnami-helm.yaml
# Deploy App Of Apps pattern
kubectl apply -f argocd/argo-apps/app-of-apps.yamlFor bootstraping: manually deploy just one app, all other are deployed automatically through GitOps:
This is still not fully solved, but it shoul in version 2.6. The most common WA is to use a "dummy/proxy" chart that does nothing but installing the desired chart as a dependency (example in dir argocd/argo-apps/nginx-bitnami-helm-values).
Note:
- The
version:andappVersion:fields of the "dummy/proxy" chart Chart.yaml mean nothing.- The real chart version is
dependencies[0].version
- The real chart version is
- The
values.yamlfile must be indented taking into account thedependencies[].name.- For example if
dependencies[0].name: nginx, thevalues.yamlfile starts withnginx:as in the demo.
- For example if
Install argocd-image-updater:
kubectl apply -f argocd/image-updater/argocd-image-updater.yamlDeploy example apps:
# Declarative app
kubectl apply -f argocd/image-updater/test-image-updater-nginx.yaml# App-of-apps deployment
kubectl apply -f argocd/image-updater/app-of-apps.yamlThe examples use alvarof2/nginx:latest image that is built and pushed from argocd/image-updater/nginx-docker folder.
kind delete cluster --name argocd-clusterArgoCon22 Workshops:
- Secrets: just a list of general ways to handle secrets in GitOps.
- ArgoCD and OKTA
- ArgoCD RBAC
- ArgoCD HA
- Many other things: Operator Manual
