Dit deel is nog niet vertaald. Je ziet de Engelse tekst.
$ als gewone gebruiker# als root (of met sudo)
Know it before you install
An Application says: "take this path in this Git repository and deploy it to this cluster and namespace". Argo CD compares Git with the cluster all the time: Synced / OutOfSync (is the cluster equal to Git?) and Healthy / Progressing / Degraded (do the Pods work?).
| Item | Value |
|---|---|
| Runs | in the cluster, namespace argocd |
| Parts | argocd-server (UI/API), argocd-repo-server (reads Git), argocd-application-controller (compares and syncs), Redis, Dex (SSO) |
| CLI | argocd |
| Settings | ConfigMaps argocd-cm, argocd-rbac-cm, argocd-cmd-params-cm |
| First password | Secret argocd-initial-admin-secret |
| Objects | Application, ApplicationSet, AppProject (CRDs) |
What you need: a Kubernetes cluster with kubectl access (cluster-admin for the install), and a Git repository with your Kubernetes YAML or charts.
Install Argo CD in the cluster
The official manifest installs everything. Pin a version in production (replace stable with a tag like v3.1.8):
kubectl create namespace argocd
kubectl apply -n argocd --server-side --force-conflicts -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl -n argocd rollout status deploy/argocd-server
kubectl -n argocd get podsOr with Helm: helm repo add argo https://argoproj.github.io/argo-helm and helm upgrade --install argocd argo/argo-cd -n argocd --create-namespace --version ….
Install the CLI (RHEL and Ubuntu)
First login and the settings to make first
Reach the UI with a port-forward (later: an Ingress with TLS), read the first password, log in, change it:
kubectl -n argocd port-forward svc/argocd-server 8080:443
argocd admin initial-password -n argocd
argocd login localhost:8080 --username admin --insecure
argocd account update-password
kubectl -n argocd delete secret argocd-initial-admin-secret(--insecure only for the port-forward with the self-signed certificate.) Then:
| Setting | Why |
|---|---|
| New admin password, delete the initial secret | The first password is stored in the cluster in clear text (base64). |
SSO (OIDC: Entra ID, Google, GitLab, Keycloak) in argocd-cm | Each person logs in as themselves; one place to remove access. |
admin.enabled: "false" after SSO works | No shared admin account. |
RBAC in argocd-rbac-cm (policy.default: role:readonly) | Read-only for everyone, deploy rights only for the right teams. |
An Ingress with TLS for argocd.example.com | The UI and CLI over HTTPS without port-forward. |
| AppProjects per team | Limit which repos, clusters and namespaces each team may use. |
Connect a repository and create an Application
Use a read-only deploy key for the Git repository:
ssh-keygen -t ed25519 -f ~/.ssh/argocd-deploy -N '' -C argocd
argocd repo add git@github.com:ORG/deploy.git --ssh-private-key-path ~/.ssh/argocd-deploy
argocd repo listWrite the Application as YAML and keep it in Git too:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: shop
namespace: argocd
spec:
project: default
source:
repoURL: git@github.com:ORG/deploy.git
targetRevision: main
path: shop/overlays/prod
destination:
server: https://kubernetes.default.svc
namespace: shop
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true| Option | Meaning |
|---|---|
automated | Sync by itself when Git changes. |
prune: true | Delete objects that were removed from Git. |
selfHeal: true | Undo manual changes in the cluster (kubectl edit is reverted). |
CreateNamespace=true | Make the target namespace if it does not exist. |
Daily use: the commands and the real uses
argocd app list
argocd app get shop
argocd app diff shop
argocd app sync shop
argocd app history shop
argocd app rollback shop 4
argocd app logs shop --tail 50
argocd proj list
argocd cluster listWith selfHeal, a rollback in Argo CD is undone at the next sync — the real rollback is **git revert** of the bad commit.
Real uses at work:
- Every environment (dev, test, prod) is a folder or branch in Git; promotion is a pull request.
- App of apps / ApplicationSet: one Application creates many (all add-ons, every cluster, every team).
- Audit: who changed what and when is the Git history; drift shows in the UI at once.
Make it safe
Security checklist:
- Change the first password, delete
argocd-initial-admin-secret, use SSO, then turn the admin user off. - RBAC: read-only default; AppProjects limit repos, clusters, namespaces and cluster-scoped kinds.
- Read-only deploy keys for Git; no secrets in plain YAML — use Sealed Secrets, SOPS or External Secrets.
- The UI only over HTTPS; not public unless behind SSO.
- Argo CD can change everything in the cluster: protect the
argocdnamespace and update Argo CD often (security releases). - Branch protection on the deploy repository — Git is your production access now.
Update and remove
Read the upgrade notes for your version jump, then apply the new manifest (or helm upgrade):
kubectl apply -n argocd --server-side --force-conflicts -f https://raw.githubusercontent.com/argoproj/argo-cd/v3.2.0/manifests/install.yaml
kubectl delete -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/v3.2.0/manifests/install.yamlBefore removing Argo CD, delete or orphan the Applications on purpose — deleting an Application with the resources-finalizer also deletes its workloads.
Fix common problems
| Problem | Cause | Fix |
|---|---|---|
ComparisonError: … repository not accessible | Wrong URL or deploy key. | argocd repo list; add the key again; check the known hosts. |
App always OutOfSync on the same field | A controller or webhook changes the object after sync. | Add ignoreDifferences for that field, or fix the YAML. |
App stays Progressing | Pods do not become ready. | argocd app get APP → resources; kubectl describe and logs of the Pods. |
the server could not find the requested resource / CRD errors | CRDs are synced after the objects that use them. | Sync waves (argocd.argoproj.io/sync-wave), or install CRDs first. |
permission denied in the CLI or UI | RBAC policy. | Check argocd-rbac-cm; argocd account can-i sync applications '*/shop'. |
| A manual hotfix disappears | selfHeal: true reverted it (as designed). | Make the change in Git. |
metadata.annotations: Too long on apply | Big CRDs with client-side apply. | Use --server-side --force-conflicts (as above). |
Next steps
- Quick how-tos: Deploy an app with Argo CD from Git, Kustomize overlays.
- Command page: argocd, Command page: flux.
- GitOps step by step: GitOps summary — Install Argo CD, Applications, Repository layout.
- Practise: Lab: deploy an app with Argo CD.
- Argo CD at work: GitOps with a UI.
- Charts for your apps: Install and set up Helm.
1With selfHeal: true, someone runs kubectl scale by hand. What happens?
Argo CD sees the drift and sets the cluster back to what Git says.
2What is the real rollback in a GitOps setup?
git revert of the bad commit — Argo CD then deploys the old state.