GitOps & CI/CD

Argo CD

Contrôleur GitOps Kubernetes CNCF Graduated - synchronisation déclarative depuis Git, UI web riche, multi-cluster, Helm/Kustomize/Jsonnet. Apache 2.0, argoproj.

Argo CD est un contrôleur GitOps pour Kubernetes développé par Intuit et maintenu par la communauté sous l'égide de la CNCF (Graduated). Il adopte le modèle pull-based : il surveille en permanence les dépôts Git et reconcilie automatiquement l'état réel du cluster avec l'état désiré déclaré dans Git. Son interface web offre une visualisation en temps réel de l'état des applications, des diffs Git vs cluster, et du health checking - le tout avec un support natif Helm, Kustomize, Jsonnet et des manifests bruts.


Informations essentielles

Origine : Intuit → CNCF Graduated  ·  Licence : Apache 2.0  ·  Architectures : x86_64, ARM64

Liens : Documentation  ·  GitHub  ·  Releases  ·  Helm chart

Support : CNCF Graduated. Communauté très active, releases fréquentes.

Stack par défaut

ComposantValeur
BackendGo
FrontendReact + TypeScript
DéploiementKubernetes (namespace argocd)
TemplatesHelm, Kustomize, Jsonnet, manifests natifs
AuthLocal, SSO (OIDC/SAML/LDAP), GitHub/GitLab OAuth
Port443 (HTTPS) - port-forward sur 8080
Multi-clusterOui - clusters enregistrés via CLI

Prérequis

RessourceValeur
Kubernetes1.23+
Helm3.x (pour l'installation)
kubectlConfiguré avec accès cluster

Installation

Via Helm (recommandé)

helm repo add argo https://argoproj.github.io/argo-helm
helm repo update

helm install argocd argo/argo-cd \
  --namespace argocd \
  --create-namespace \
  --set configs.params.server.insecure=true   # désactive TLS si derrière un reverse proxy

Via manifests kubectl

kubectl create namespace argocd
kubectl apply -n argocd -f \
  https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Accéder à l'UI

# Port-forward vers l'UI
kubectl port-forward svc/argocd-server -n argocd 8080:443

# Récupérer le mot de passe admin initial
kubectl get secret argocd-initial-admin-secret -n argocd \
  -o jsonpath="{.data.password}" | base64 -d && echo

# Connexion : http://localhost:8080
# Login : admin / <mot de passe ci-dessus>

Installer la CLI argocd

curl -sSL -o argocd-linux-amd64 \
  https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x argocd-linux-amd64
sudo mv argocd-linux-amd64 /usr/local/bin/argocd

# Se connecter
argocd login localhost:8080 --username admin --password <mot_de_passe> --insecure

Déployer une application

Via la CLI

argocd app create my-app \
  --repo https://github.com/org/repo.git \
  --path manifests/production \
  --dest-server https://kubernetes.default.svc \
  --dest-namespace production \
  --sync-policy automated \
  --auto-prune \
  --self-heal

Via un manifest Application

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/org/repo.git
    targetRevision: main
    path: manifests/production
  destination:
    server: https://kubernetes.default.svc
    namespace: production
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
kubectl apply -f app.yaml
argocd app sync my-app

Gestion multi-cluster

# Enregistrer un cluster distant (kubecontext doit exister)
argocd cluster add my-remote-context --name production

# Lister les clusters enregistrés
argocd cluster list

# Déployer sur le cluster distant
argocd app create my-app \
  --dest-server https://api.remote-cluster.example.com \
  --dest-namespace production

Gestion des secrets

Argo CD ne gère pas les secrets nativement. Solutions usuelles :

  • Sealed Secrets : SealedSecret CRD chiffré dans Git, déchiffré par le contrôleur
  • External Secrets Operator : récupère depuis Vault, AWS Secrets Manager, GCP, etc.
  • SOPS : chiffrement de fichiers YAML via age ou GPG, support via plugin Argo CD

Mise à jour

# Helm
helm repo update
helm upgrade argocd argo/argo-cd --namespace argocd --reuse-values

# kubectl
kubectl apply -n argocd -f \
  https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

Troubleshooting

# État des pods Argo CD
kubectl get pods -n argocd

# Logs du serveur
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-server --tail=50

# Logs du contrôleur de synchronisation
kubectl logs -n argocd -l app.kubernetes.io/name=argocd-application-controller --tail=50

# App en erreur : voir les détails
argocd app get my-app

# Forcer une synchronisation
argocd app sync my-app --force

# Rollback vers une révision précédente
argocd app history my-app
argocd app rollback my-app <revision>

Commandes utiles

argocd app list                        # Lister toutes les apps
argocd app get <app>                   # Détails et santé d'une app
argocd app sync <app>                  # Synchroniser depuis Git
argocd app diff <app>                  # Voir le diff Git vs cluster
argocd app delete <app>                # Supprimer l'app (pas les ressources K8s)
argocd app delete <app> --cascade      # Supprimer l'app ET ses ressources
argocd proj list                       # Lister les projects Argo CD
argocd cluster list                    # Lister les clusters enregistrés

Ressources

Newsletter · 2 000+ abonnés

Reste au courant de ce qui bouge en prod

RudeOps veille devops hebdo, droit au but.

Gratuit · Sans spam · Désinscription en un clic