- Github: https://github.com/argoproj/argo-cd
- Docs: https://argo-cd.readthedocs.io/en/stable/
- Icon: https://cncf-branding.netlify.app/projects/argo/
kubectl create namespace argocd
kubectl apply -k setup # v1.21 or later
# kubectl kustomize setup | kubectl apply -f - # before v1.21
Check all the pods are running
kubectl get pod -n argocd
NAME READY STATUS RESTARTS AGE
argocd-application-controller-0 1/1 Running 0 90s
argocd-applicationset-controller-547665bdfd-rjgvm 1/1 Running 0 94s
argocd-dex-server-865966bc45-s6fgf 1/1 Running 0 94s
argocd-notifications-controller-c47c9f869-2smdk 1/1 Running 0 93s
argocd-redis-896595fb7-h9pmr 1/1 Running 0 93s
argocd-repo-server-678c6cc99c-kkzmd 1/1 Running 0 93s
argocd-server-96cdb4df5-mxsq2 1/1 Running 0 92s
kubectl -n argocd port-forward service/argocd-server 8080:80
- user:
admin
- password:
kubectl get secret argocd-initial-admin-secret -n argocd -o jsonpath='{.data.password}' | base64 --decode
(v1.9.0 or later, there's a secret for initial admin password.)
- AppProject:
dev
- Application:
guestbook-kustomize-dev
.
-
Deploy application with ArgoCD
kubectl apply -f project/dev
-
Check in console
kubectl get pod -n dev NAME READY STATUS RESTARTS AGE dev-kustomize-guestbook-ui-7574c75879-6cfnq 1/1 Running 0 95s
-
Check on ArgoCD
kubectl apply -f project/argocd/project.yaml,project/argocd/app-argocd.yaml
kubectl delete -f project/dev
kubectl delete -k setup
kubectl delete ns argocd
Github: https://github.com/argoproj-labs/argocd-notifications Docs: https://argocd-notifications.readthedocs.io/en/stable/
ArgoCD is installed.
-
Install
kubectl apply -k setup-notifications/base
-
Clean up
kubectl delete -k setup-notifications/base
kubectl apply -f project/argocd/project.yaml,project/argocd/app-argocd-notifications.yaml
-
Install
helm repo add argo https://argoproj.github.io/argo-helm helm install argo/argocd-notifications --generate-name -n argocd -f argocd/setup-notification-with-helm/value.yaml
failed:
Error: YAML parse error on argocd-notifications/templates/configmap.yaml: error converting YAML to JSON: yaml: line 15: did not find expected key
argoproj/argo-helm#616 → fixed in argoproj-labs/argocd-notifications#315
https://argocd-notifications.readthedocs.io/en/stable/services/slack/
- Prepare Slack bot and channel.
- Create Slack Application with
chat:write:bot
permission. - Get OAuth token.
- Create Slack channel (e.g.
#argocd-notifications
). - Add your bot to this channel. (
/invite @<your-app-name>
)
- Create Slack Application with
- Install either by Kustomize or Helm:
-
Kustomize:
-
Prepare Secret
argocd-notifications-secret
(setup-notifications/overlays/slack/argocd-notification-secret.yaml
)cp setup-notifications/overlays/slack/argocd-notification-secret-sample.yaml setup-notifications/overlays/slack/argocd-notification-secret.yaml
Fill your Slack token.
-
Prepare
argocd-notifications-cm
(setup-notifications/overlays/slack/argocd-notification-cm.yaml
)context
subscriptions
service.slack
- Optionally, you can set argo icon https://cncf-branding.netlify.app/projects/argo/ in your Slack workspace. (seems not working)
- Just writing ConfigMap doesn't work -> Added annotation in Application or Project (Subscribe to notifications by adding the notifications.argoproj.io/subscribe.on-sync-succeeded.slack annotation to the Argo CD application or project)
kubectl patch app <my-app> -n argocd -p '{"metadata": {"annotations": {"notifications.argoproj.io/subscribe.on-sync-succeeded.slack":"<my-channel>"}}}' --type merge
-
Apply
kubectl apply -k setup-notifications/overlays/slack
-
-
Helm:
helm install argo/argocd-notifications --generate-name -n argocd -f setup-notification-with-helm/value.yaml --set secret.items.slack-token=<SLACK BOT TOKEN>
-