app-of-apps example
All files in infra repo
Instructions for this example are HERE
In order to start app in Argo-CD you need to login:
// get password
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -d; echo
// get hostname (does not work)
kubectl get service argocd-server -n argocd --output=jsonpath='{.status.loadBalancer.ingress[0].hostname}'
// for now as a shortcut just forward ports of the server
kubectl port-forward svc/argocd-server -n argocd 8081:https
// login to Argo-CD
argocd login localhost:8081 \
--username admin \
--password $(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo) \
--insecure
// start apps (assuming the correct github repo link with examples)
argocd app create apps \
--dest-namespace argocd \
--dest-server https://kubernetes.default.svc \
--repo https://github.com/argoproj/argocd-example-apps.git \
--path apps
// sync apps
argocd app sync apps
Root app in this example has quite some scripting in its helm chart template in order to render it locally execute the following
cd to_apps_folder
helm template . --values values.yaml
Pros:
you may have reusable code among helm charts
everything is in one place
Cons
Harder to enforce per-app permissions
Changes to any app trigger syncs for the whole repo
👀 HERE is an example how to configure a hook from Github to ArgoCD to notify promptly about changes
In this particular example if you want to check what was deployed, e.g. guestbook, then (of course this is a long and non convenient way, but just to make things done this approach works):
// check what was deployed in particular namespace (as in this example each app
// is deployed in its own namespace)
kubectl get pods -n guestbook
// and then port forward particular service
kubectl port-forward svc/guestbook-ui -n guestbook 8084:80
// check it
localhost:8084
Last updated
Was this helpful?