You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Install (no-auth): k create ns argocd && k apply -n argocd -f https://raw.githubusercontent.com/codefresh-contrib/gitops-certification-examples/main/argocd-noauth/install.yaml
Application health: “Healthy” -> 100% healthy; “Progressing” -> not healthy but still has a chance to reach healthy state; “Suspended” -> suspended or paused (e.g. cron job); “Missing” -> not present in the cluster; “Degraded” -> indicates failure or resource could not reach healthy state in time; “Unknown” -> Health assessment failed and actual health status is unknown
Argo CD health checks are completely independent from Kubernetes health probes
Sync strategy:
Manual
Automatic sync
Auto-pruning: controls what Argo CD does when you remove/delete files from Git: delete if enabled, never delete if disabled (default)
Self-Heal: controls how Argo CD handles manual changes on cluster: discard changes (= align with git) if enabled
Important note: Argo CD can deploy applications from Helm charts and monitor them for new versions / sync'ing. But the application is recognized as an Argo app, rendered with the Helm template, that can only be operated by Argo CD, and no longer a Helm application (helmp list returns empty).
List apps / sync app | get app details | get app history | delete app: argocd app list, argocd app [sync | get | history | delete] demo
Managing secrets in GitOps
Kubernetes secrets are not encrypted / base64 encoding used should be never seen as a security feature!!!
Install Bitnami Sealed Secrets... in the kube-system namespace, as ArgoCD application...:
Create a plain Kubernetes secret locally: never commit it anywhere.
Use kubeseal to encrypt the secret in a SealedSecret: kubeseal < db-creds.yml > db-creds-encrypted.yaml -o yaml
Sealed secrets are cluster and namespace specific! To use the same secret for different clusters, it must be encrypted for each cluster individually.
Delete the original secret from your workstation and apply the sealed secret to the cluster: k [-n my-ns] apply -f db-creds-encrypted.yaml
Commit the Sealed secret to Git.
Deploy your application that expects normal Kubernetes secrets to function.
The Bitnami Sealed Secrets controller decrypts the Sealed secrets and passes them to your application as plain secrets.
Argo Rollouts
Argo Rollouts is a progressive delivery controller created for Kubernetes. It allows you to deploy your application with minimal/zero downtime by adopting a gradual way of deploying instead of taking an “all at once” approach.
Install the Argo Rollouts controller as an ArgoCD application:
For Argo Rollout to work, you need to 1) convert a Kubernetes Deployment to a Rollout resource to enable progressive delivery, or 2) reference an existing deployment in a Rollout and 3)
rollout-canary-all-traffic: for live traffic from current users
rollout-canary-active: always point to the stable/previous version
rollout-canary-preview: only routes traffic to the canary/new versions.
Under normal circumstances all 3 services point to the same version.
A smart service layer to gradually shift traffic to the canary pods while still keeping the rest of the traffic to the old/stable pods. Argo Rollouts supports several service meshes and gateways for this purpose, including the popular Ambassador API Gateway:
kubectl argo rollouts set image simple-rollout webserver-simple=docker.io/kostiscodefresh/gitops-canary-app:v2.0 # Change the container image of the rollout; should follow the GitOps principles and perform a commit to the Git repo of the application.
kubectl argo rollouts list rollouts
kubectl argo rollouts get rollout simple-rollout
App of Apps pattern
From a directory structure, your Git repository might look something like this: