ArgoCD GitOps managed app of apps for Kubernetes lab environments for experimentation and learning. This app of apps provide git source of desired resources to for deployment into a Kubernetes cluster of your choosing. The README below covers how to spin this up quickly on a local machine.
ArgoCD automatically applies updates to the resources in the git repository to the Kubernetes cluster.
Get started with a local Kubernetes cluster using k3d. First install and startup Docker. Then install k3d as described in the k3d documentation. For example with Homebrew:
brew install k3dCreate the cluster with the load balancer listening on port 433 for https access to the services.
k3d cluster create my-cluster -p "443:443@loadbalancer"We'll use Helm to install ArgoCD in our cluster and use the argocd command line interface for convenience. For example, with Homebrew install with:
brew install helm argocdAdd the Helm repository for ArgoCD which hosts the Helm charts we need.
helm repo add argo https://argoproj.github.io/argo-helm
helm repo updateInstall ArgoCD
helm install argocd argo/argo-cd --namespace argocd --create-namespace \
--values boot/argocd-values.yamlApply an application from the env folder, for example:
kubectl apply -f env/base.yamlGet the CA certificate
kubectl get secret -n cert-manager root-secret -o jsonpath="{.data.ca\.crt}" |
base64 -d > /tmp/lab-cluster-ca.crt
And trust it
```sh
sudo security add-trusted-cert -d -r trustRoot \
-k "/Library/KeyChains/System.keychain" \
/tmp/lab-cluster-ca.crtFor this local stack, we'll use local domain names for simplicity. Register these in /etc/hosts
127.0.0.1 argocd.local
127.0.0.1 grafana.local
127.0.0.1 prometheus.local
127.0.0.1 traefik.localNow we're ready to log in to Argo CD. Get the password with,
argocd admin initial-password -n argocdLog in to Argo CD CLI with username admin and password from above.
argocd login --username admin argocd.localChange this initial admin password to something secret.
argocd account update-passwordYou can log in to the ArgoCD console at https://argocd.local
Install direnv
brew install direnvSet GRAFANA_ADMIN_PASSWORD in .envrc file
export GRAFANA_ADMIN_PASSWORD=super-secretSet the Grafana secret
kubectl create -n monitoring secret generic grafana-password \
--from-literal=admin-password=$GRAFANA_ADMIN_PASSWORD \
--from-literal=admin-user=adminAnd install app of apps
argocd app create app-of-apps \
--sync-policy automated --sync-option Prune=true \
--repo https://github.com/adaptivekind/app-of-apps.git \
--path env/k3d \
--dest-server https://kubernetes.default.svcAll the apps should now spin up in the Kubernetes cluster. View the status and troubleshoot in the ArgoCD dashboard.
Log in to Grafana at https://grafana.local/.
Delete the app
argocd app delete app-of-apps
helm uninstall argo-cd -n argocdor just delete the cluster
k3d cluster delete my-cluster