30 min (S0.1 : 30 min)
poste conforme à setup-environnement.md
présentation d'Hexa Mobilité
preflight.sh (0 KO)30 min
Formation = 3 jours × 7 h = 21 h (+ 60 % de pratique)| Jour | Thème | Résultat |
|---|---|---|
| J1 | Introduction, installation, configuration | ArgoCD installé, accès sécurisés |
| J2 | Déploiement et gestion des applications | Déployée, réversible, supervisée |
| J3 | Avancé et bonnes pratiques | Canari, Helm, CI, sécurité, échelle |
QCM d'ancrage en fin de module, évaluation finale en fin de J3
flowchart LR J1["J1 Découvrir<br/>Installer, configurer"] --> J2a["J2 Déployer<br/>Synchroniser"] J2a --> J2b["J2 Rollback<br/>Surveiller"] J2b --> J3a["J3 Bleu-vert, canari<br/>Helm, Kustomize"] J3a --> J3b["J3 CI, sécurité<br/>Bonnes pratiques"]
| Partie du programme | Modules | Jour |
|---|---|---|
| 1. Introduction à ArgoCD | M00, M01 | J1 |
| 2. Configuration d'ArgoCD | M02, M03 | J1 |
| 3. Déploiement d'applications | M04, M05, M06 | J2 |
| 4. Gestion des déploiements | M07, M08 | J2, J3 |
| 5. Fonctionnalités avancées | M09, M10, M11 | J3 |
| 6. Meilleures pratiques et cas réels | M12 | J3 |
flotte-web = frontend + API (image podinfo 6.15.0 → 6.17.0)Avant: kubectl apply depuis les postes → aucune trace → écarts recette / prod
Après: commit → CI → dépôt de configuration → ArgoCD → cluster (audité, réversible)
dev (déploie), ops (administre), audit (lecture seule)dev, recette, prodpoint de départ fréquent (déploiements manuels, drift non détecté)
flowchart LR Dev["Commit<br/>flotte-app"] --> CI["GitLab CI<br/>build + tag"] CI --> Cfg["Dépôt<br/>flotte-config"] Cfg --> Argo["ArgoCD"] Argo --> K8s["Cluster kind<br/>dev / recette / prod"]
flotte-app : code et pipeline CI (J3)flotte-config : manifestes, chart Helm, overlays Kustomize (J2 et J3)Poste = Docker + kind + kubectl + argocd + helm + git| Outil | Version | Rôle |
|---|---|---|
| kind | v0.33.0 | Cluster Kubernetes local |
| Kubernetes | v1.36.4 | Cluster cible (nœud kind) |
| Argo CD | v3.6.1 | Serveur et CLI |
| GitLab.com | SaaS | Dépôts et CI (compte personnel) |
port 8080 déjà occupé → l'accès à l'UI échoue au J1
cd scripts/setup
./preflight.shSortie attendue (extrait) :
OK CPU: 8 vCPU (min 4)
OK Container engine: docker
OK kind version v0.33.0
OK Port 8080 free
----
Result: workstation readylancer aussi ./pull-images.sh (images téléchargées une seule fois)
un lab bloqué > 5 min → signaler (script de rattrapage disponible)
kubectl apply manuel à GitOps completkind par poste : aucune ressource cloud, aucun coûtpreflight.sh = 0 KO avant le premier labkubectl get podskubectl get pods -Akubectl describe namespaceskubectl logs --all-A (--all-namespaces) liste les pods de tous les namespaces ; sans option, seul le namespace courant est affiché.git reset --hard HEAD~1git revert <COMMIT>git checkout <COMMIT>git stashgit revert crée un commit inverse sans réécrire l'historique : geste clé du rollback GitOps (M06).values.yaml (vu au M09).git push depuis le cluster1 h (S1.1 : 30 min · S1.2 : 30 min)
bases Kubernetes et Git
Hexa Mobilité déploie encore par kubectl apply
git push à Synced / Healthy30 min
GitOps = Déclaratif + Versionné + Tiré automatiquement + Réconcilié en continu4 principes définis par le projet OpenGitOps (CNCF), version 1.0.0
flowchart LR Dev["Développeur"] --> Git["Dépôt Git"] Git --> CI["Pipeline CI"] CI -- "kubectl apply" --> K8s["Cluster"]
flowchart LR Dev["Développeur"] --> Git["Dépôt Git"] Argo["ArgoCD"] -- "lit" --> Git Argo -- "applique" --> K8s["Cluster"] Argo -- "observe" --> K8s
| Critère | Push (CI) | Pull (GitOps) |
|---|---|---|
| Accès au cluster | Depuis la CI | Depuis le cluster |
| Dérive détectée | Non | Oui, en continu |
| Retour arrière | Relancer un ancien pipeline | git revert |
| Audit | Journaux CI | Historique Git |
| Cluster reconstruit | Rejouer les pipelines | Pointer ArgoCD sur Git |
CI et GitOps coexistent (la CI construit l'image, ArgoCD déploie)
Écart = État souhaité (Git) − État réel (cluster)flowchart LR O["Observer<br/>le cluster"] --> C["Comparer<br/>à Git"] C --> A["Agir<br/>(sync)"] A --> O
timeout.reconciliation)Dérive (drift) = modification hors GitAvant: kubectl scale --replicas=5 en urgence → oublié → recette ≠ prod
Après: ArgoCD affiche OutOfSync → self-heal remet 2 réplicas (valeur de Git)
self-heal actif + correctif manuel en urgence = correctif annulé
| Outil | Rôle | Modèle |
|---|---|---|
| Argo CD | CD GitOps Kubernetes, UI riche | Pull |
| Flux | CD GitOps Kubernetes, sans UI native | Pull |
| GitLab CI, Jenkins | Construire, tester, publier | Push |
| Helm, Kustomize | Générer les manifestes | Outils de rendu |
30 min
argocd)flowchart LR User["UI / CLI"] --> API["argocd-server"] API --> Redis["Redis"] Ctrl["application-<br/>controller"] --> Repo["repo-server"] Repo --> Git["Dépôt Git"] Ctrl --> K8s["Cluster(s)<br/>cible(s)"] Ctrl --> Redis
repo-server : Git → manifestes ; application-controller : manifestes → cluster| Composant | Type | Rôle |
|---|---|---|
argocd-server |
Deployment | API gRPC/REST, UI, authentification |
argocd-repo-server |
Deployment | Clone Git, rendu Helm / Kustomize / YAML |
argocd-application-controller |
StatefulSet | Compare, synchronise, calcule la santé |
repo-server : aucun accès à l'API Kubernetes (rendu uniquement)| Composant | Rôle |
|---|---|
argocd-applicationset-controller |
Génère des Applications en série (M12) |
argocd-notifications-controller |
Alertes Slack, mail, webhook (M07) |
argocd-redis |
Cache des manifestes et de l'état |
argocd-dex-server |
SSO : OIDC, LDAP, SAML, GitHub, GitLab (M03) |
Redis = cache uniquement (perte = recalcul, pas de perte de données)
sequenceDiagram participant D as Développeur participant G as Git participant C as Controller participant R as Repo-server participant K as Cluster D->>G: git push C->>R: Manifestes de la révision ? R->>G: fetch R-->>C: Manifestes rendus C->>K: Diff puis apply (sync) C->>K: Calcul de la santé
| Statut | Valeurs | Question |
|---|---|---|
| Sync | Synced, OutOfSync, Unknown |
Le cluster = Git ? |
| Health | Healthy, Progressing, Degraded |
L'application fonctionne ? |
| Health (suite) | Suspended, Missing, Unknown |
Synced + Degraded : Git appliqué, mais application en échec (image, config)OutOfSync + Healthy : application fonctionnelle, mais différente de GitApplication = Source (Git) + Destination (cluster, namespace) + Projet| CRD | Rôle | Module |
|---|---|---|
Application |
Une application déployée depuis Git | M04 |
AppProject |
Périmètre : dépôts, clusters, droits | M03 |
ApplicationSet |
Fabrique d'Applications | M12 |
argocd-cm, argocd-rbac-cm (M03)| Caractéristique | Avantage |
|---|---|
| UI web, CLI, API | Visualisation de l'état en temps réel, automatisation |
| Helm, Kustomize, YAML, plugins | Formats existants conservés |
| Multi-clusters, AppProjects | Une instance pour plusieurs équipes et environnements |
| SSO, RBAC | Accès alignés sur l'annuaire de l'entreprise |
| Hooks, vagues, rollback | Livraisons ordonnées et réversibles |
| Notifications, métriques | Pannes connues avant les utilisateurs |
update / delete ne s'appliquent plus aux sous-ressourceslogs) soumis au RBACargocd-cm : syntaxe historique supprimée (Secrets)argocd_app_sync_status et argocd_app_health_status retiréestutoriels 2.x encore très présents en ligne (vérifier la version)
repo-server rend les manifestes, application-controller les appliqueargocd-serverargocd-application-controllerargocd-repo-serverargocd-redisargocd-repo-server clone le dépôt et rend les manifestes (YAML, Helm, Kustomize).argocd-application-controllerargocd-repo-serverargocd-dex-serverargocd-notifications-controllerargocd-application-controller applique les ressources sur les clusters cibles.Synced et Degraded. Que conclure ?timeout.reconciliation vaut 120 s par défaut, avec un jitter jusqu'à 60 s.ApplicationApplicationSetAppProjectargocd-cmAppProject restreint dépôts sources, destinations et types de ressources.app.kubernetes.io/instanceownerReferences)argocd.argoproj.io/tracking-id) est le défaut.1 h 45 (S2.1 : 1 h · S2.2 : 45 min)
preflight.sh sans KO
Hexa Mobilité prépare sa plateforme GitOps
kind et y installer ArgoCD v3.6.1Running)adminport-forward (NodePort)1 h
--server-side ?Installation = Manifeste (version figée) + Namespace argocd| Variante | Fichier ou outil | Usage |
|---|---|---|
| Standard | manifests/install.yaml |
Formation, petites équipes |
| Haute disponibilité | manifests/ha/install.yaml |
Production (3 nœuds minimum) |
| Core | manifests/core-install.yaml |
Sans UI ni SSO (CLI --core) |
| Namespaced | manifests/namespace-install.yaml |
Droits limités à des namespaces |
| Chart Helm | argo/argo-cd (argo-helm) |
Valeurs paramétrables |
v3.6.1), jamais la branche stable en productionflowchart LR Poste["Poste<br/>kubectl, argocd"] --> Docker["Docker"] Docker --> Node["Nœud kind<br/>v1.36.4"] Node --> NS["Namespace<br/>argocd"] Poste -- "localhost:8443" --> Node
argocd-formation-control-planekind create cluster --config scripts/setup/kind-config.yaml
kubectl get nodesSortie attendue :
NAME STATUS ROLES AGE VERSION
argocd-formation-control-plane Ready control-plane 40s v1.36.4port 8443 déjà utilisé sur le poste → création du cluster refusée
kubectl create namespace argocd
kubectl apply -n argocd --server-side --force-conflicts \
-f https://raw.githubusercontent.com/argoproj/argo-cd/v3.6.1/manifests/install.yamlSortie attendue (fin) :
networkpolicy.networking.k8s.io/argocd-server-network-policy serverside-applied--server-side ?
Apply client = annotation last-applied (limite 262 Ko)ApplicationSet > 262 Ko : kubectl apply classique échoue--server-side : calcul de la fusion par l'API server, sans annotation--force-conflicts : reprise des champs gérés par un autre outil (mise à jour)Avant (2.x): kubectl apply -n argocd -f install.yaml
Après (3.x): kubectl apply -n argocd --server-side --force-conflicts -f install.yaml
Runningkubectl wait --for=condition=Available deployment --all -n argocd --timeout=600s
kubectl get pods -n argocdSortie attendue :
NAME READY STATUS RESTARTS AGE
argocd-application-controller-0 1/1 Running 0 34s
argocd-applicationset-controller-f6bc6968d-xtpwx 1/1 Running 0 35s
argocd-dex-server-55b9777447-tsv7g 1/1 Running 0 35s
argocd-notifications-controller-b9499f64b-jnzxh 1/1 Running 0 35s
argocd-redis-79f897d5d9-cp6lp 1/1 Running 0 35s
argocd-repo-server-75fcf89b6b-wdm57 1/1 Running 0 35s
argocd-server-67795db55d-pzk69 1/1 Running 0 34supgrading/3.x-3.y)install.yamlkustomization.yaml = install.yaml v3.6.1 + patchs maison (défi 02.4)
45 min
argocd-server n'est pas exposé par défaut| Méthode | Commande ou objet | Usage |
|---|---|---|
| Port-forward | kubectl port-forward |
Test, poste local |
| NodePort | type: NodePort |
Lab, cluster sans load balancer |
| LoadBalancer | type: LoadBalancer |
Cloud (IP externe) |
| Ingress / Gateway | Ingress, HTTPRoute |
Production (nom DNS, TLS) |
fin de maintenance d'ingress-nginx annoncée (mars 2026) → Gateway API à privilégier
kubectl port-forward svc/argocd-server -n argocd 8080:443Sortie attendue :
Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080https://localhost:8080 (certificat auto-signé à accepter)argocd admin initial-password -n argocd
argocd login localhost:8080 --username admin --insecure
argocd account update-passwordSortie attendue :
'admin:login' logged in successfully
Context 'localhost:8080' updated
Password updated--insecure obligatoire (certificat auto-signé) ; à proscrire en production
flowchart LR UI["UI ArgoCD"] --> Apps["Applications<br/>tuiles, statuts"] UI --> Set["Settings<br/>dépôts, clusters"] UI --> User["User Info<br/>compte, groupes"] UI --> Doc["Documentation"] Apps --> Detail["Vue application<br/>arbre, diff"]
argocd-example-apps)argocd app create guestbook \
--repo https://github.com/argoproj/argocd-example-apps.git --path guestbook \
--dest-server https://kubernetes.default.svc --dest-namespace default
argocd app sync guestbook
argocd app listSortie attendue (colonnes principales) :
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH
argocd/guestbook https://kubernetes.default.svc default default Synced Healthy| Zone | Contenu | Action |
|---|---|---|
| En-tête | Sync, Health, révision Git | Sync, Refresh |
| Arbre | Application → Service, Deployment → ReplicaSet → Pod | Clic : manifeste, événements, logs |
| App diff | Écart Git ↔ cluster | Avant une sync |
| History and rollback | Révisions déployées | M06 |
admin (argocd account update-password)kubectl delete secret argocd-initial-admin-secret -n argocd)admin (M03)kubectl get secret argocd-initial-admin-secret -n argocdSortie attendue (après suppression) :
Error from server (NotFound): secrets "argocd-initial-admin-secret" not foundsecret initial = mot de passe en clair, inutile après le premier changement
kubectl apply --server-side --force-conflictsargocd, vérifiés par kubectl waitargocd login + changement de mot de passe + suppression du secret initial--server-side est-elle requise pour installer ArgoCD 3.x ?last-appliedargocdApplicationSet dépasse 262 Ko, taille maximale de l'annotation last-applied-configuration de l'apply client.install.yamlcore-install.yamlha/install.yamlnamespace-install.yamlha/install.yaml : réplicas multiples, Redis HA, anti-affinité exigeant au moins 3 nœuds.admin ?argocd-cmargocd-initial-admin-secretargocd-serveradmin par défautargocd-initial-admin-secret, à supprimer après changement du mot de passe.argocd-application-controller-0 ?-0), pour permettre le sharding.kubectl port-forwardargocd-server--insecure est-elle utilisée avec argocd login en lab ?--insecure désactive la vérification du certificat TLS, auto-signé en lab.Synced / HealthyOutOfSync / MissingSynced / DegradedUnknown / ProgressingOutOfSync / Missing.3 h (S3.1 : 45 min · S3.2 : 1 h · S3.3 : 1 h · bilan J1 : 15 min)
M02 terminé (https://localhost:8443)
trois équipes à faire entrer dans ArgoCD
45 min
argocd-cmargocdConfiguration = argocd-cm + argocd-cmd-params-cm + argocd-rbac-cm + Secrets| Objet | Contenu | Prise en compte |
|---|---|---|
argocd-cm |
URL, comptes, UI, exclusions, réconciliation | À chaud (sauf exceptions) |
argocd-cmd-params-cm |
Paramètres de démarrage des composants | Redémarrage des pods |
argocd-rbac-cm |
Politique RBAC | À chaud |
argocd-secret |
Mots de passe, clé de signature des sessions | À chaud |
| Secrets étiquetés | Dépôts, clusters | À chaud |
argocd-cm
| Clé | Exemple | Effet |
|---|---|---|
url |
https://localhost:8443 |
URL publique (SSO, notifications, liens) |
ui.bannercontent |
Cluster de formation |
Bannière en haut de l'UI |
statusbadge.enabled |
"true" |
Badge de statut intégrable (README) |
admin.enabled |
"false" |
Désactive le compte admin |
timeout.reconciliation |
120s |
Intervalle de comparaison à Git |
exec.enabled |
"true" |
Terminal web dans les pods (désactivé par défaut) |
argocd-cm n'est PAS vide en 3.xresource.exclusions, resource.customizations.ignoreResourceUpdates.*kubectl apply d'un fichier partiel = valeurs par défaut suppriméeskubectl patch cm argocd-cm -n argocd --type merge -p \
'{"data":{"ui.bannercontent":"Cluster de formation - Hexa Mobilite"}}'
kubectl get cm argocd-cm -n argocd -o jsonpath='{.data.ui\.bannercontent}{"\n"}'Sortie attendue :
configmap/argocd-cm patched
Cluster de formation - Hexa Mobiliteconfiguration d'ArgoCD versionnée (patchs Kustomize, défi 02.4)
argocd-cmd-params-cm : options des binaires, vide par défaut| Clé | Effet |
|---|---|
server.insecure |
argocd-server en HTTP (TLS terminé par l'Ingress) |
server.basehref |
UI servie sous un sous-chemin (/argocd) |
controller.status.processors |
Parallélisme du contrôleur (nombreuses applications) |
reposerver.parallelism.limit |
Rendus simultanés du repo-server (mémoire) |
modification sans kubectl rollout restart du composant = aucun effet
1 h
Identité = Compte local | Utilisateur SSO (Dex, OIDC) | Jeton API| Source | Déclaration | Usage |
|---|---|---|
| Compte local | accounts.<nom> dans argocd-cm |
Petites équipes, formation |
| SSO | Dex ou OIDC dans argocd-cm |
Entreprise (groupes de l'annuaire) |
| Jeton API | Capacité apiKey |
Pipelines CI (M10) |
login (UI, CLI) et / ou apiKey (jetons)argocd-cm, mot de passe par la CLIdata:
accounts.dev-alice: login
accounts.ops-bob: login
accounts.audit-claire: login
accounts.ci-gitlab: apiKeykubectl patch cm argocd-cm -n argocd --type merge --patch-file argocd-cm-accounts.yaml
argocd account update-password --account dev-alice --current-password '<ADMIN_PASSWORD>'
argocd account listSortie attendue (extrait) :
NAME ENABLED CAPABILITIES
ci-gitlab true apiKey
dev-alice true loginRègle = sujet + ressource + action + objet + effetp, role:dev, applications, sync, flotte/*, allow
g, dev-alice, role:devp (policy) : une permission accordée à un rôleg (grouping) : un utilisateur ou un groupe SSO reçoit un rôle<projet>/<application> pour applications, applicationsets, logs, execrole:readonly, role:adminpolicy.default: role:readonly = tout le monde voit tout
argocd-rbac-cm| Ressource | Actions principales |
|---|---|
applications |
get, create, update, delete, sync, rollback, override, action/* |
logs, exec |
get / create (soumis au RBAC depuis 3.0) |
projects, repositories, clusters |
get, create, update, delete |
accounts |
get, update |
update / delete ne couvrent plus les sous-ressources (update/*, delete/*)rollback distincte de sync (M06)policy.default vide)flowchart LR A["dev-alice"] --> Dev["role:dev<br/>flotte/* : get, sync"] C["ci-gitlab"] --> Ci["role:ci<br/>flotte/* : get, sync"] Cl["audit-claire"] --> Ro["role:readonly<br/>tout en lecture"] B["ops-bob"] --> Ad["role:admin<br/>tout"]
argocd admin settings rbac validate --policy-file argocd-rbac-cm.yaml
argocd admin settings rbac can dev-alice delete applications 'flotte/flotte-web' -n argocd
argocd login localhost:8443 --username dev-alice --insecure
argocd account can-i sync applications 'flotte/flotte-web'Sortie attendue :
Policy is valid.
No
'dev-alice:login' logged in successfully
yesvalidate ignore la politique intégrée → warning roles not found normal pour role:admin / role:readonly
politique dans Git + rbac validate en CI avant fusion
apiKey ne se connecte pas : il reçoit des jetonsargocd account generate-token --account ci-gitlab --expires-in 168h --id formation
argocd account get --account ci-gitlabSortie attendue (fin) :
Tokens:
ID ISSUED AT EXPIRING AT
formation 2026-11-08T13:14:48+01:00 2026-11-15T13:14:48+01:00argocd account delete-token --account ci-gitlab formation1 h
flotteAppProject = Dépôts sources + Destinations + Ressources autorisées + Rôles| Champ | Rôle |
|---|---|
sourceRepos |
Dépôts Git ou Helm autorisés |
destinations |
Couples cluster + namespace autorisés (jokers acceptés) |
clusterResourceWhitelist |
Ressources de niveau cluster autorisées (vide = aucune) |
roles |
Rôles et jetons propres au projet |
projet default = aucune restriction (à verrouiller en production)
flotte
flotte-*, création de namespace seulementapiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata: {name: flotte, namespace: argocd}
spec:
sourceRepos: ["https://gitlab.com/<GITLAB_USER>/flotte-config.git"]
destinations:
- {server: "https://kubernetes.default.svc", namespace: "flotte-*"}
clusterResourceWhitelist:
- {group: "", kind: Namespace}
orphanedResources: {warn: true}Tentative de dev-alice |
Résultat |
|---|---|
Namespace flotte-dev, dépôt autorisé |
Application créée |
Namespace default |
do not match any of the allowed destinations |
| Dépôt non déclaré | application repo <URL> is not permitted |
| Suppression de l'application | PermissionDenied (RBAC) |
argocd-cm (supprimé en 3.0)apiVersion: v1
kind: Secret
metadata:
name: repo-flotte-config
namespace: argocd
labels: {argocd.argoproj.io/secret-type: repository}
stringData:
type: git
url: https://gitlab.com/<GITLAB_USER>/flotte-config.git
project: flotte
username: <GITLAB_DEPLOY_USER>
password: <GITLAB_DEPLOY_TOKEN>read_repository (moindre privilège)STATUS = test de connexion réel (git ls-remote)argocd repo listSortie attendue (colonnes principales) :
REPO CREDS STATUS PROJECT
https://gitlab.com/<GITLAB_USER>/flotte-config.git true Successful flotteargocd repo add (CLI), Settings → Repositories (UI)repo-creds : identifiants communs à tous les dépôts d'un préfixe d'URLSecret créé par l'UI = hors Git (à recréer après reconstruction)
flowchart LR Argo["ArgoCD<br/>(cluster kind)"] --> In["in-cluster<br/>kubernetes.default.svc"] Argo --> Ext["Cluster prod<br/>(M12)"]
argocd cluster listSortie attendue :
SERVER NAME VERSION STATUS MESSAGE PROJECT
https://kubernetes.default.svc in-cluster v1.36.4 Successfulargocd cluster add <CONTEXTE> (crée un ServiceAccount sur le cluster cible)argocd-cm : patcher, jamais réécrire (valeurs par défaut en 3.x)login pour les humains, apiKey pour la CI ; admin désactivé ensuitep (permission d'un rôle) + g (attribution) ; policy.default videargocd-cm plutôt que l'appliquer en entier en 3.x ?kubectl apply est interdit sur les ConfigMapsargocd-cm est en lecture seuleargocd-cm contient des exclusions et personnalisations par défaut ; un apply partiel les supprime.ui.bannercontent dans argocd-cmargocd-rbac-cmserver.insecure dans argocd-cmd-params-cmargocd-cmd-params-cm est lu au démarrage des composants : redémarrage nécessaire.loginapiKeyadminsyncapiKey permet de générer des jetons sans connexion interactive.g, dev-alice, role:dev ?dev-alicerole:dev à dev-alicedev-alicedev-alice du groupe devg attribue un rôle (ou un groupe) à un sujet ; le compte est déclaré dans argocd-cm.applications ?<projet>/<application><projet>/<application>.dev-alice (droits sur flotte/*) cible le namespace default. Que se passe-t-il ?defaultflotte-defaultdefault ne correspond pas au motif flotte-* du projet : InvalidSpecError.repositories de argocd-cmargocd.argoproj.io/secret-type: repositoryargocd-rbac-cmargocd-cm est supprimée ; seuls les Secrets étiquetés subsistent.default livré à l'installation ?defaultdefault autorise tous les dépôts, destinations et ressources : à restreindre en production.1 h 30 (S4.1 : 45 min · S4.2 : 45 min)
M03 terminé (projet flotte, dépôt flotte-config connecté)
premier déploiement de flotte-web par ArgoCD
flotte-web et les pousser dans GitApplication déclarative conforme au projet flotteapp diff)45 min
flotte-webApplication = Source (dépôt + révision + chemin) + Destination (cluster + namespace) + Projetflowchart LR Git["flotte-config<br/>apps/flotte-web"] --> App["Application<br/>flotte-web-dev"] App --> K8s["Cluster<br/>namespace flotte-dev"] Proj["AppProject<br/>flotte"] -.-> App
argocdflotte-web
flotte-config/apps/flotte-web/| Fichier | Ressource | Rôle |
|---|---|---|
deployment.yaml |
Deployment | 2 réplicas de podinfo:6.15.0, sondes, ressources |
service.yaml |
Service | Port 80 → port http (9898) |
configmap.yaml |
ConfigMap | Message et couleur de l'UI |
kubectl apply --dry-run=server -n default -f apps/flotte-web/Sortie attendue :
configmap/flotte-web-config created (server dry run)
deployment.apps/flotte-web created (server dry run)
service/flotte-web created (server dry run)flotte-config/argocd/flotte-web-dev.yamlapiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: flotte-web-dev
namespace: argocd
finalizers: [resources-finalizer.argocd.argoproj.io]
spec:
project: flotte
source: {repoURL: "https://gitlab.com/<GITLAB_USER>/flotte-config.git",
targetRevision: main, path: apps/flotte-web}
destination: {server: "https://kubernetes.default.svc", namespace: flotte-dev}
syncPolicy: {syncOptions: [CreateNamespace=true]}| Champ | Exemple | Contrôle |
|---|---|---|
spec.project |
flotte |
RBAC + règles du projet |
source.repoURL |
URL de flotte-config |
Dans sourceRepos du projet |
source.targetRevision |
main |
Branche, tag ou commit existant |
source.path |
apps/flotte-web |
Dossier existant dans la révision |
destination.server / name |
https://kubernetes.default.svc |
Cluster déclaré |
destination.namespace |
flotte-dev |
Motif flotte-* du projet |
targetRevision décide de ce qui est déployé| Valeur | Exemple | Effet |
|---|---|---|
| Branche | main |
Suit chaque nouveau commit |
| Tag | v1.4.0 |
Figé jusqu'au changement du tag suivi |
| Commit | 05b6219 |
Figé, reproductible |
HEAD |
HEAD |
Branche par défaut du dépôt |
branche pour dev, tag ou commit pour prod (M09)
| Méthode | Commande | Trace dans Git |
|---|---|---|
| UI | + New App | Non |
| CLI | argocd app create <NOM> --repo <URL> --path <CHEMIN> |
Non |
| Déclarative | kubectl apply -f argocd/flotte-web-dev.yaml |
Oui |
création UI réservée aux essais ; production = YAML dans Git
OutOfSync / Missing : rien n'existe encore dans le clusterkubectl apply -f argocd/flotte-web-dev.yaml
argocd app get flotte-web-dev
argocd app diff flotte-web-devSortie attendue (extrait de app get) :
Sync Status: OutOfSync from main (ef64ceb)
Health Status: Missing
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
ConfigMap flotte-dev flotte-web-config OutOfSync Missing
Service flotte-dev flotte-web OutOfSync Missing
apps Deployment flotte-dev flotte-web OutOfSync Missingargocd app sync flotte-web-dev
argocd app wait flotte-web-dev --health
kubectl get deploy -n flotte-devSortie attendue (extrait) :
Sync Status: Synced to main (ef64ceb)
Health Status: Healthy
NAME READY UP-TO-DATE AVAILABLE AGE
flotte-web 2/2 2 2 20sargocd.argoproj.io/tracking-id (suivi 3.x)argocd app delete supprime aussi les ressources (cascade)45 min
repo-server| Contenu du chemin | Type détecté | Module |
|---|---|---|
Chart.yaml |
Helm | M09 |
kustomization.yaml |
Kustomize | M09 |
Fichiers .yaml, .yml, .json, .jsonnet |
Répertoire (Directory) | M04 |
chart), plugin de configurationflowchart LR Src["Source Git<br/>ou chart"] --> Repo["repo-server<br/>rendu"] Repo --> Yaml["Manifestes<br/>YAML finaux"]
source:
repoURL: https://gitlab.com/<GITLAB_USER>/flotte-config.git
path: apps/flotte-web
directory:
recurse: true
exclude: "{*.md,tests/*}"recurse : sous-dossiers ignorésinclude / exclude : motifs glob, accolades pour plusieurs motifsmanifeste rangé dans un sous-dossier sans recurse: true = jamais déployé, sans erreur
source:
repoURL: https://stefanprodan.github.io/podinfo
chart: podinfo
targetRevision: 6.16.0
helm:
releaseName: flotte-web
valuesObject:
replicaCount: 1
ui: {message: "Hexa Mobilite - apercu Helm"}targetRevision = version du chart (pas une branche)helm template) : aucun helm install, helm list videsource:
repoURL: https://github.com/stefanprodan/podinfo.git
targetRevision: 6.17.0
path: kustomizekustomization.yaml présent dans path → Kustomize appliquékustomize.images, namePrefix, commonLabelsAvant: une copie des manifestes par environnement (dérive entre copies)
Après: base/ + overlays/dev, overlays/prod (écarts explicites)
argocd app manifests flotte-web-helm --source git | grep -E '^kind:|image:'Sortie attendue :
kind: Service
kind: Deployment
image: ghcr.io/stefanprodan/podinfo:6.16.0--source git : rendu depuis Git ; --source live : état du clusterargocd app get <APP> -o yaml (champ status.summary.images)6.15.0), jamais latest (aucun changement détectable dans Git)readinessProbe / livenessProbe : la santé ArgoCD en dépendrequests / limits déclarésapp.kubernetes.io/name, part-of)namespace en dur : fourni par la destinationkubectl apply : Applications déclaratives et reconstructiblesargocd app diff avant toute synchronisationtargetRevision : branche (suivi), tag ou commit (figé)Application ?flotte-dev)argocddefaultkube-systemargocd ; flotte-dev est sa destination.Synced / HealthyOutOfSync / MissingUnknown / DegradedSynced / MissingOutOfSync (écart avec Git) et Missing (santé).targetRevision suit chaque nouveau commit ?v1.4.0main6.16.0Chart.yamlhelm/.tgz obligatoirerepo-server détecte Helm à la présence de Chart.yaml.resources-finalizer.argocd.argoproj.io ?latest en GitOps ?latest : nouvelle image sans modification de Git, donc ni écart détecté ni historique.argocd app manifests <APP> --source gitkubectl get <APP> -o yamlhelm listargocd repo get <URL>argocd app manifests <APP> --source git affiche le rendu des manifestes depuis Git.1 h 45 (S5.1 : 45 min · S5.2 : 1 h)
M04 terminé (flotte-web-dev Synced / Healthy)
passer flotte-web en livraison continue
45 min
Sync automatique = Commit détecté → Application sans action humaine| Politique | Déclencheur | Usage type |
|---|---|---|
| Manuelle (défaut) | Bouton Sync, argocd app sync |
Production sous contrôle, découverte |
| Automatique | Écart détecté (réconciliation, webhook) | Dev, recette, production GitOps mature |
+ prune |
Ressource retirée de Git → supprimée | Environnements sans ressource manuelle |
+ selfHeal |
Modification du cluster → annulée | Environnements verrouillés |
spec:
syncPolicy:
automated:
enabled: true # false = pause sans perdre le réglage
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=truekubectl apply -f argocd/flotte-web-dev.yamlenabled: false pour suspendre l'automatisme pendant un incident
OutOfSyncselfHeal)argocd app rollback refusé tant que l'automatisme est actif (M06)sync automatique ≠ instantanée (attendre ou Refresh)
flowchart LR S["Synced"] -- "kubectl scale<br/>(dérive)" --> O["OutOfSync"] O -- "self-heal<br/>(5 s)" --> S O -- "sans self-heal" --> A["Alerte seule<br/>(écart conservé)"]
Après kubectl scale --replicas=5, sortie de argocd app diff (sans self-heal) :
< replicas: 5
---
> replicas: 3Avant (sans prune): fichier retiré de Git → ressource conservée, OutOfSync
Après (avec prune): fichier retiré de Git → ressource supprimée, Pruned
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
ConfigMap flotte-dev flotte-web-legacy Succeeded Pruned prunedargocd.argoproj.io/sync-options: Prune=falseprune + mauvais chemin path = suppression de toute l'application
spec:
ignoreDifferences:
- group: apps
kind: Deployment
name: flotte-web
jsonPointers: [/spec/replicas]
syncPolicy:
syncOptions: [RespectIgnoreDifferences=true]RespectIgnoreDifferences : écart ignoré dans le diff, mais écrasé à la prochaine synckubectl scale --replicas=4 → application Synced, 4 réplicas conservés| Environnement | Politique | Raison |
|---|---|---|
dev |
Auto + prune + self-heal | Retour rapide, aucune modification manuelle |
recette |
Auto + prune | Correctifs manuels tolérés le temps d'un test |
prod |
Manuelle ou auto + fenêtres de sync | Livraison décidée, traçable (M12) |
promotion en prod par merge request, la sync suit le merge
1 h
syncOptions) ou d'une ressource (annotation)| Option | Effet |
|---|---|
CreateNamespace=true |
Crée le namespace de destination |
ServerSideApply=true |
kubectl apply --server-side (gros objets, CRD) |
ApplyOutOfSyncOnly=true |
N'applique que les ressources en écart (grandes applications) |
PruneLast=true |
Supprime après le déploiement des nouvelles ressources |
Replace=true |
kubectl replace / create au lieu d'apply |
argocd.argoproj.io/sync-options: Prune=false,Delete=falseflowchart LR Pre["PreSync<br/>migration"] --> Sync["Sync<br/>manifestes"] Sync --> Post["PostSync<br/>smoke test"] Pre -. échec .-> Fail["SyncFail<br/>nettoyage"] Sync -. échec .-> Fail
HealthyPreDelete / PostDelete : à la suppression de l'Application uniquementapiVersion: batch/v1
kind: Job
metadata:
name: flotte-db-migration
annotations:
argocd.argoproj.io/hook: PreSync
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
spec:
template:
spec:
restartPolicy: Never
containers: [{name: migration, image: busybox:1.37, command: [sh, -c, "echo OK"]}]| Politique | Suppression |
|---|---|
BeforeHookCreation (défaut) |
Avant la création du hook suivant (dernier conservé) |
HookSucceeded |
Dès la réussite |
HookFailed |
Après un échec |
BeforeHookCreation : dernier résultat consultable (kubectl logs job/<NOM_DU_JOB>)generateName : un nouveau Job à chaque sync (prévoir une politique de suppression)ttlSecondsAfterFinished sur un hook = Job supprimé avant lecture du résultat
Ordre = Phase → Vague (sync-wave) → Type de ressource → Nomflowchart LR W1["Vague -1<br/>ConfigMap"] --> W0["Vague 0<br/>Deployment, Service"] W0 --> W5["Vague 5<br/>Ingress"]
metadata:
annotations:
argocd.argoproj.io/sync-wave: "-1"Healthyflotte-web-devKIND NAME STATUS HEALTH HOOK
Job flotte-db-migration Succeeded Synced PreSync
ConfigMap flotte-web-config Synced
Service flotte-web Synced Healthy
Deployment flotte-web Synced Healthy
Job flotte-smoke-test Succeeded Synced PostSynckubectl logs -n flotte-dev job/flotte-db-migrationAvant: image 6.16.0 poussée + migration en échec → Deployment toujours en 6.15.0
Après: migration corrigée + nouveau commit → 6.16.0 déployée, smoke test réussi
Running | one or more synchronization tasks completed unsuccessfully.
Retrying attempt #5 at 2026-11-08T12:52:49Z.argocd app terminate-op flotte-web-devignoreDifferences + RespectIgnoreDifferences=true pour un champ géré ailleursprune est désactivé. Que se passe-t-il ?OutOfSyncOutOfSync.selfHeal après un kubectl scale manuel ?automated.enabled: falseselfHeal: falseprune: falsesyncOptions: [Manual=true]enabled: false suspend l'automatisme en conservant prune et selfHeal.PostSyncPreSyncSyncFailPostDeletePreSync s'exécute avant l'application des manifestes.PreSync en échec ?PreSync en échec arrête la synchronisation : les ressources ne sont pas modifiées."5""0""-1"RespectIgnoreDifferences=true avec ignoreDifferences ?HookSucceededHookFailedBeforeHookCreationBeforeHookCreation s'applique.1 h 15 (S6.1 : 1 h 15)
M05 terminé (auto-sync, self-heal)
la version 6.17.0 de flotte-web part en production avec une anomalie
git revert (voie GitOps)argocd app rollback, puis réaligner Git1 h 15
git revertargocd app rollbackEntrée d'historique = ID + date + révision Git (+ source)argocd app history flotte-web-devSortie attendue (extrait) :
ID DATE REVISION
8 2026-11-08 13:58:58 +0100 CET main (c0dcb75)
9 2026-11-08 14:01:13 +0100 CET main (4ee1140)
10 2026-11-08 14:01:49 +0100 CET main (3750a56)spec.revisionHistoryLimit)argocd app manifests flotte-web-dev --revision 4ee1140 | grep -E 'image: ghcr|MESSAGE'
argocd app diff flotte-web-dev --revision 4ee1140Sortie attendue (extrait du diff) :
< PODINFO_UI_MESSAGE: Hexa Mobilite - suivi de flotte
> PODINFO_UI_MESSAGE: Hexa Mobilite - v6.17 (anomalie)
< image: ghcr.io/stefanprodan/podinfo:6.16.0
> image: ghcr.io/stefanprodan/podinfo:6.17.06.16.0, révision 4ee1140 (6.17.0)< cluster actuel, > révision demandée| Critère | git revert |
argocd app rollback |
|---|---|---|
| Source de vérité | Git reste la référence | Cluster ≠ Git (temporaire) |
| Auto-sync | Compatible | Refusé si actif |
| Trace | Commit visible, revu | Entrée d'historique ArgoCD |
| Délai | Réconciliation ou webhook | Immédiat |
| Usage | Cas nominal | Urgence, Git indisponible |
git revert par défaut ; app rollback = geste d'urgence suivi d'un revert
git revert
flowchart LR Bad["Commit 4ee1140<br/>6.17.0"] --> Rev["git revert<br/>commit 3750a56"] Rev --> Push["git push"] Push --> Sync["Auto-sync<br/>6.16.0"]
git revert --no-edit HEAD && git push
argocd app get flotte-web-dev --refresh > /dev/nullSortie attendue (git log --oneline -2) :
3750a56 Revert "feat: flotte-web 6.17.0"
4ee1140 feat: flotte-web 6.17.0argocd app rollback
argocd app rollback flotte-web-dev 8Sortie attendue (auto-sync actif) :
rpc error: code = FailedPrecondition
desc = rollback cannot be initiated when auto-sync is enabledautomated.enabled: false)argocd app rollback flotte-web-dev <ID>git revert), puis réactiver l'automatismeauto-sync réactivé AVANT le revert = retour de la version fautive
Avant revert: Sync Policy: Manual, OutOfSync from main (Git = version fautive)
Après revert + réactivation: Automated (Prune), Synced to main (Git = version saine)
flowchart LR R["app rollback<br/>(cluster)"] --> O["OutOfSync<br/>Manual"] O --> G["git revert<br/>(Git)"] G --> S["Synced<br/>Automated"]
rollback = permission syncRéglage argocd-cm |
Contrôle appliqué | dev-alice (sync seul) |
|---|---|---|
| Défaut | sync |
Rollback autorisé |
server.rbac.rollback.enforce.enable: "true" |
rollback |
permission denied |
p, role:ops-release, applications, rollback, flotte/*, allowrole:admin intégré : inclut déjà rollbackfeat: flotte-web 6.17.0)6.16.0 désigne toujours le même contenuv1.4.0) pour la production (M09)envFrom) : pods NON redémarrés (générateur Kustomize, M09)rollback testé en recette avant d'en avoir besoin en production
argocd app history : ID, date, révision ; 10 entrées par défautapp diff --revision : comparer avant de revenir en arrièregit revert + synchronisation automatiqueautomated.enabled: false → app rollback <ID> → git revert → réactivationserver.rbac.rollback.enforce.enable: "true"argocd app rollback est-il refusé sur flotte-web-dev en fin de M05 ?admin est désactivérollback cannot be initiated when auto-sync is enabled.argocd app rollbackkubectl rollout undogit revert puis synchronisationkubectl set imageargocd app rollback, quel est l'état de l'application ?Synced, synchronisation automatiqueOutOfSync, Git contient toujours la version fautiveUnknownOutOfSync.revisionHistoryLimit vaut 10 par défaut.argocd app diff <APP> --revision <SHA>argocd app history <APP> --diffgit diff <SHA>argocd app get <APP> --hard-refreshargocd app diff --revision compare le cluster à une révision Git donnée.updaterollbacksyncoverrideserver.rbac.rollback.enforce.enable, le rollback est contrôlé par sync.git revert ?1 h 45 (S7.1 : 1 h · S7.2 : 45 min)
M06 terminé (flotte-web-dev en 6.16.0, auto-sync)
Hexa Mobilité veut savoir AVANT ses clients quand flotte-web va mal
Degraded ou en échec de synchronisation1 h
| Sync | Health | Situation | Premier réflexe |
|---|---|---|---|
Synced |
Healthy |
Nominal | — |
OutOfSync |
Healthy |
Git ≠ cluster, service rendu | argocd app diff |
Synced |
Degraded |
Git appliqué, application en panne | Événements, journaux |
OutOfSync |
Degraded / Missing |
Synchronisation en échec ou en cours | Message d'opération |
Progressing : changement en cours (pods en démarrage, rollout)| Ressource | Healthy si |
Degraded si |
|---|---|---|
| Deployment | Réplicas à jour et disponibles | progressDeadlineSeconds dépassé |
Service LoadBalancer |
IP ou nom attribué | — |
| Job (hook) | Terminé avec succès | Échec (backoffLimit atteint) |
| PersistentVolumeClaim | Bound |
Lost |
resource.customizations.health.<groupe>_<type>)progressDeadlineSeconds court en dev (60 s) = panne visible vite
flowchart LR A["app get<br/>statuts"] --> B["Opération<br/>conditions"] B --> C["Ressource<br/>en cause"] C --> D["Événements<br/>Kubernetes"] D --> E["Journaux<br/>des pods"] C --> F["app diff<br/>si OutOfSync"]
| Question | Commande |
|---|---|
| Quel état, quelle opération ? | argocd app get flotte-web-dev |
| Quelles ressources gérées, orphelines ? | argocd app resources flotte-web-dev |
| Quel écart avec Git ? | argocd app diff flotte-web-dev |
| Que dit Kubernetes ? | kubectl get events -n flotte-dev --sort-by=.lastTimestamp |
| Que disent les pods ? | argocd app logs flotte-web-dev --kind Deployment --name flotte-web |
argocd app logs : soumis au RBAC logs (3.x) ; audit-claire et dev-alice autoriséesSynced mais Degraded : Git est appliqué, l'image n'existe pasSync Status: Synced to main (fe0af9e)
Health Status: Degraded
apps Deployment flotte-dev flotte-web Synced Degraded
Deployment "flotte-web" exceeded its progress deadlineWarning Failed pod/flotte-web-7d6589d6d8-jkb58
Failed to pull image "ghcr.io/stefanprodan/podinfo:6.99.0": rpc error: code = NotFoundProgressing jusqu'à l'échéance, puis DegradedOutOfSync : la synchronisation échoue à chaque tentativeRunning | one or more synchronization tasks completed unsuccessfully,
reason: error when patching "/dev/shm/3761042127": Deployment.apps "flotte-web"
is invalid: spec.template.spec.containers: Required value.
Retrying attempt #4 at 2026-11-08T13:13:08Z.containers: mal orthographié (containerz:), champ inconnu ignoré, champ obligatoire absentchamp inconnu = ignoré sans erreur ; seule l'absence d'un champ requis se voit
| Symptôme | Cause probable |
|---|---|
ComparisonError : authentication required |
Jeton du dépôt expiré |
ComparisonError : app path does not exist |
Chemin renommé dans Git |
OutOfSync permanent sans changement Git |
Champ modifié par un contrôleur (ignoreDifferences) |
Progressing sans fin |
Sondes en échec, progressDeadlineSeconds long |
Opération Running bloquée |
Hook en attente ou en échec (terminate-op) |
45 min
Notification = Trigger (quand) + Template (quoi) + Service (où) + Abonnement (qui)flowchart LR App["Application<br/>flotte-web-dev"] --> Ctrl["notifications-<br/>controller"] Ctrl --> Trig["Trigger<br/>flotte-degraded"] Trig --> Tpl["Template<br/>flotte-webhook"] Tpl --> Svc["Service<br/>webhook, Slack, mail"]
argocd-notifications-cm, secrets dans argocd-notifications-secretservice.webhook.flotte-alertes: |
url: http://alertes-receiver.flotte-ops.svc.cluster.local/argocd
headers: [{name: Content-Type, value: application/json}]
template.flotte-webhook: |
webhook:
flotte-alertes:
method: POST
body: |
{"application": "{{.app.metadata.name}}",
"health": "{{.app.status.health.status}}"}{{.app.metadata.name}}, {{.app.status.sync.revision}}trigger.flotte-degraded: |
- when: app.status.health.status == 'Degraded'
send: [flotte-webhook]metadata:
annotations:
notifications.argoproj.io/subscribe.flotte-degraded.flotte-alertes: ""subscribe.<trigger>.<service>: "<destinataire>"oncePer: app.status.sync.revision : une notification par révisionsubscriptions)CAT=https://raw.githubusercontent.com/argoproj/argo-cd/v3.6.1/notifications_catalog
kubectl apply -n argocd -f $CAT/install.yamlon-created, on-deleted, on-deployed, on-health-degraded, on-sync-failed, on-sync-running, on-sync-status-unknown, on-sync-succeededargocd-notifications-cm : l'appliquer AVANT ses propres cléstrigger maison nommé comme un trigger du catalogue = écrasé
/metrics| Service | Port | Métriques clés |
|---|---|---|
argocd-metrics (contrôleur) |
8082 | argocd_app_info, argocd_app_sync_total |
argocd-server-metrics |
8083 | Requêtes API et gRPC |
argocd-repo-server |
8084 | Durée de rendu, requêtes Git |
argocd_app_info{name="flotte-web-dev",project="flotte",health_status="Healthy",
sync_status="Synced",autosync_enabled="true",phase="Succeeded"} 1argocd_app_sync_status et argocd_app_health_status supprimées → argocd_app_info| Besoin | Requête PromQL |
|---|---|
| Applications en panne | argocd_app_info{health_status="Degraded"} |
| Applications en écart | argocd_app_info{sync_status="OutOfSync"} |
| Échecs de sync (1 h) | sum by (name) (increase(argocd_app_sync_total{phase="Failed"}[1h])) |
| Clusters injoignables | argocd_cluster_connection_status == 0 |
examples/dashboard.json du dépôt Argo CDfor: 10m), pas un état transitoireapp get → message d'opération → ressource → événements → journauxargocd_app_info (3.x), argocd_app_sync_totalSynced et Degraded. Où chercher en priorité ?argocd app diffSynced : Git est appliqué ; la panne est à l'exécution (événements, journaux).Degraded pour ArgoCD ?progressDeadlineSeconds est dépassé sans progressionprogressDeadlineSeconds sans progresser : Degraded.containers: est écrit containerz: dans un Deployment. Quel est l'effet ?containers rend le manifeste invalide.argocd app logs <APP>argocd app history <APP>argocd app resources <APP>argocd repo logsargocd app logs lit les journaux via l'API ArgoCD (RBAC logs).argocd_app_health_status depuis ArgoCD 3.0 ?argocd_app_reconcileargocd_app_info (label health_status)argocd_cluster_infoargocd_app_sync_totalargocd_app_info et son label health_status.notifications.argoproj.io/subscribe.<trigger>.<service>notifications.argoproj.io/subscribe.<trigger>.<service>.1 h (S8.1 : 1 h)
M07 terminé (flotte-web-dev supervisée)
Hexa Mobilité veut exposer une nouvelle version à une partie des utilisateurs avant de la généraliser
1 h
RollingUpdate remplace tout, sans point d'arrêtLivraison progressive = Exposition partielle + Vérification + Décision (promouvoir / interrompre)| Stratégie | Principe | Retour arrière |
|---|---|---|
RollingUpdate (Deployment) |
Remplacement progressif, sans pause | Nouveau déploiement |
| Canari | 25 % → 50 % → 100 %, pauses et analyses | Immédiat (abort) |
| Bleu-vert | Nouvelle version complète à côté, bascule d'un coup | Immédiat (service actif inchangé) |
Rollout, AnalysisTemplateflowchart LR Git["flotte-config<br/>rollout.yaml"] --> Argo["ArgoCD"] Argo --> R["Rollout<br/>flotte-web"] Ctrl["Contrôleur<br/>argo-rollouts"] --> R R --> S["ReplicaSet<br/>stable"] R --> C["ReplicaSet<br/>canari"]
Healthy, Progressing, Suspended (pause), Degradedresume, promote-full, abort, retry, restartkubectl sur le postekubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts --server-side --force-conflicts \
-f https://github.com/argoproj/argo-rollouts/releases/download/v1.10.2/install.yaml
kubectl argo rollouts versionSortie attendue (dernière commande) :
kubectl-argo-rollouts: v1.10.2+be8a622sans --server-side, CRD rollouts et analysisruns refusées (annotation > 262 Ko)
kind et strategy changentapiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata: {name: flotte-web}
spec:
replicas: 4
selector: {matchLabels: {app.kubernetes.io/name: flotte-web}}
strategy:
canary:
steps: [{setWeight: 25}, {pause: {duration: 30s}},
{setWeight: 50}, {pause: {}}, {setWeight: 100}]
template: {} # modèle de pod identique à celui du Deploymentdeployment.yaml supprimé de Git → Deployment Pruned par ArgoCD, Rollout crééflowchart LR A["25 %<br/>1 pod sur 4"] --> P1["Pause<br/>30 s"] P1 --> B["50 %<br/>2 pods"] B --> P2["Pause<br/>manuelle"] P2 --> C["100 %<br/>promu"]
Status: ॥ Paused
Message: CanaryPauseStep
Step: 3/5
SetWeight: 50
Images: ghcr.io/stefanprodan/podinfo:6.16.0 (stable)
ghcr.io/stefanprodan/podinfo:6.17.0 (canary)Suspended ; la synchronisation attend la fin du Rolloutargocd app actions list flotte-web-dev --kind Rollout
argocd app actions run flotte-web-dev resume --kind Rollout --resource-name flotte-web| Action | Effet |
|---|---|
resume |
Étape suivante |
promote-full |
100 % immédiatement, étapes sautées |
abort |
Retour à 0 % de canari, version stable conservée (Degraded) |
p, role:dev, applications, action/argoproj.io/Rollout/resume, flotte/*, allowflowchart LR U["Utilisateurs"] --> Act["Service actif<br/>flotte-web"] T["Testeurs"] --> Prev["Service preview<br/>flotte-web-preview"] Act --> Blue["Bleu<br/>6.17.0"] Prev --> Green["Vert<br/>6.15.0"]
activeService, previewService, autoPromotionEnabled: false : pause avant basculerollouts-pod-template-hash)scaleDownDelaySeconds (retour rapide)strategy:
canary:
canaryService: flotte-web-canary
steps: [{setWeight: 25}, {analysis: {templates: [{templateName: flotte-smoke}]}}]Sortie observée (analyse en échec) :
RolloutAborted: Rollout aborted update to revision 6: Step-based analysis
phase error/failed: Metric "readyz" assessed Failed due to failed (2) > failureLimit (1)--server-side obligatoire (v1.10.2)Suspended dans ArgoCD ; actions resume, promote-full, abortProgressingDegradedSuspendedMissingSuspended par ArgoCD.abort sur un canari en cours ?abort ramène le canari à 0 % ; la version stable continue de servir.--server-side ?last-applied.applications, syncapplications, action/argoproj.io/Rollout/resumeapplications, updateprojects, updateaction/<groupe>/<type>/<action>.1 h 30 (S9.1 : 45 min · S9.2 : 45 min)
M08 terminé (flotte-web en Rollout)
un composant flotte-api packagé par Helm, flotte-web décrit une fois et décliné en dev, recette, prod
45 min
flotte-api-devArgoCD + Helm = helm template (repo-server) + apply (contrôleur)| Aspect | helm install |
Chart via ArgoCD |
|---|---|---|
| Historique | Secrets de release Helm | Historique ArgoCD (M06) |
helm list |
Release visible | Vide |
| Retour arrière | helm rollback |
git revert ou app rollback |
| Hooks Helm | Exécutés par Helm | Traduits en hooks ArgoCD |
| Dérive | Non détectée | Détectée, corrigée (self-heal) |
source:
repoURL: https://stefanprodan.github.io/podinfo # dépôt de charts HTTP
chart: podinfo
targetRevision: 6.17.0 # version du chart
helm:
releaseName: flotte-apirepoURL: <REGISTRE>/<CHEMIN> sans oci:// ; privé : Secret avec enableOCIChart.yaml : path au lieu de chartsourceRepos du projetparameters > valuesObject > values > valueFiles > values.yaml du chart| Champ | Forme | Usage |
|---|---|---|
valueFiles |
Fichiers (chart ou $values) |
Valeurs par environnement, versionnées |
values |
Bloc de texte YAML | Historique, à éviter |
valuesObject |
Objet YAML validé | Quelques valeurs dans l'Application |
parameters |
Liste nom / valeur | Surcharge ponctuelle (--helm-set) |
valueFiles (1) < valuesObject (3) < parameters (2) → 2 réplicas$valuesflowchart LR Chart["Dépôt de charts<br/>podinfo 6.17.0"] --> App["Application<br/>flotte-api-dev"] Cfg["flotte-config<br/>helm/flotte-api/"] -- "ref: values" --> App App --> K8s["flotte-dev"]
flotte-config/helm/flotte-api/, revues comme le reste de la configurationargocd/flotte-api-dev.yaml (extrait)sources:
- repoURL: https://stefanprodan.github.io/podinfo
chart: podinfo
targetRevision: 6.17.0
helm: {valueFiles: [$values/helm/flotte-api/values-common.yaml,
$values/helm/flotte-api/values-dev.yaml]}
- repoURL: https://gitlab.com/<GITLAB_USER>/flotte-config.git
targetRevision: main
ref: valuesflotte-api-dev
argocd app manifests flotte-api-dev | grep -E 'replicas:|UI_MESSAGE|UI_COLOR|image:' -A1Sortie attendue (extrait) :
replicas: 1
- name: PODINFO_UI_MESSAGE
value: Hexa Mobilite - API
- name: PODINFO_UI_COLOR
value: '#2e7d32'
image: ghcr.io/stefanprodan/podinfo:6.17.0Sync Status: Synced to 6.17.0 : révision = version du chart6.17.0), jamais * ni une plagehelm template flotte-api podinfo --repo <URL> -f values-dev.yamlparameters réservés aux surcharges temporaires (non tracées dans Git)valueFiles dans l'ordre alphabétique avec un joker (*.yaml) : le dernier fichier gagne
45 min
devOverlay = Base + écarts explicites de l'environnementflowchart TD B["base/<br/>Rollout, Services, hooks"] --> D["overlays/dev<br/>image 6.17.0, canari"] B --> R["overlays/recette<br/>bleu-vert, 2 réplicas"] B --> P["overlays/prod<br/>4 réplicas"]
path: apps/flotte-web/overlays/devapps/flotte-web/ et apps/flotte-web-recette/ dupliqués (dérive entre copies)apps/flotte-web/base/kustomization.yaml (extrait)configurations: [rollout-transform.yaml] # Kustomize comprend le Rollout
resources: [rollout.yaml, service.yaml, service-canary.yaml, analysis-template.yaml,
hook-presync-migration.yaml, hook-postsync-smoke-test.yaml]
configMapGenerator:
- name: flotte-web-config
literals: ["PODINFO_UI_MESSAGE=Hexa Mobilite - suivi de flotte"]
images:
- {name: ghcr.io/stefanprodan/podinfo, newTag: 6.16.0}rollout-transform.yaml : fourni par Argo Rollouts (version Kustomize 5)dev
resources: [../../base]
configMapGenerator:
- name: flotte-web-config
behavior: merge
literals: ["PODINFO_UI_MESSAGE=Hexa Mobilite - DEV"]
images:
- {name: ghcr.io/stefanprodan/podinfo, newTag: 6.17.0}kubectl kustomize apps/flotte-web/overlays/dev | grep -E 'image: ghcr|config-'Sortie attendue :
name: flotte-web-config-4c48ggb2h2
image: ghcr.io/stefanprodan/podinfo:6.17.0resources: [../../base, service-preview.yaml]
replicas: [{name: flotte-web, count: 2}]
patches:
- target: {group: argoproj.io, kind: Rollout, name: flotte-web}
patch: |-
- op: replace
path: /spec/strategy
value: {blueGreen: {activeService: flotte-web,
previewService: flotte-web-preview, autoPromotionEnabled: false}}op, path) : précis sur une ressource personnaliséereplicas : transformateur Kustomize (Rollout reconnu grâce à rollout-transform.yaml)Avant (M06): message modifié dans la ConfigMap → pods inchangés, ancien message servi
Après (générateur): flotte-web-config-4c48ggb2h2 → flotte-web-config-fckt6km9b8 → nouveaux pods
options:
annotations:
argocd.argoproj.io/sync-wave: "-1"
argocd.argoproj.io/sync-options: Prune=false
argocd.argoproj.io/compare-options: IgnoreExtraneousPrune=false : ancienne ConfigMap supprimée alors que la version stable l'utiliseflotte-web-devConfigMap flotte-dev flotte-web-config-4c48ggb2h2 OutOfSync ignored (no prune)
ConfigMap flotte-dev flotte-web-config-fckt6km9b8 Synced createdSynced malgré l'ancienne ConfigMap (IgnoreExtraneous)abort d'un canari : la version stable retrouve sa configuration| Critère | Helm | Kustomize |
|---|---|---|
| Point de départ | Chart paramétré (gabarits) | YAML brut + patchs |
| Logiciel tiers | Format standard des éditeurs | Rare |
| Variantes par environnement | Fichiers de valeurs | Overlays |
| Lisibilité du rendu | Gabarits Go | Proche du YAML final |
helmCharts) : kustomize.buildOptions: --enable-helm dans argocd-cmhelm template), cycle de vie géré par ArgoCDparameters > valuesObject > values > valueFiles ; $values pour des valeurs dans GitconfigMapGenerator : changement de configuration = pods redémarrésPrune=false + IgnoreExtraneous (documentation ArgoCD)helm list est-il vide pour une application Helm déployée par ArgoCD ?helm template) sans créer de release Helmhelm template, aucune release Helm n'est créée.valueFiles, valuesObject et parameters. Laquelle s'applique ?valueFilesvaluesObjectparametersvalues.yaml du chartparameters a la priorité la plus haute.ref: values ?$values/...ref: values expose le dépôt aux autres sources sous $values/.kustomization.yaml ?configMapGenerator redémarre-t-il les pods à chaque changement ?rollout restartrollout-transform.yaml à la base ?rollout-transform.yaml décrit à Kustomize les chemins d'un Rollout (références, images, réplicas).Prune=false ?1 h 15 (S10.1 : 1 h 15)
M09 terminé (overlay dev en Kustomize)
chaque commit de flotte-app doit arriver en dev sans intervention
flotte-config1 h 15
CI = Construire + Tester + Publier l'image + Mettre à jour la configuration| Étape | Outil | Accès nécessaire |
|---|---|---|
| Construire, tester | GitLab CI, Jenkins | Code de flotte-app |
| Publier l'image | GitLab CI, Jenkins | Registre d'images |
Modifier le tag dans flotte-config |
GitLab CI, Jenkins | Écriture sur flotte-config |
| Déployer | ArgoCD | Cluster (depuis l'intérieur) |
la CI ne détient AUCUN accès au cluster (identifiants hors cluster supprimés)
flowchart LR Dev["Commit<br/>flotte-app"] --> CI["GitLab CI<br/>build + push"] CI --> Reg["Registre<br/>flotte-app:sha"] CI --> Cfg["Commit<br/>flotte-config"] Cfg --> Argo["ArgoCD<br/>webhook"] Argo --> K8s["flotte-dev<br/>canari"] Reg -. "pull" .-> K8s
$CI_COMMIT_SHORT_SHA : chaque déploiement remonte à un commit de codeflotte-config = journal des déploiementsflotte-app |
flotte-config |
|
|---|---|---|
| Contenu | Code, Dockerfile, .gitlab-ci.yml |
Manifestes, overlays, Applications |
| Déclencheur | Commit des développeurs | Commit de la CI ou d'un humain |
| Lu par | Runners CI | ArgoCD (jeton de déploiement, lecture) |
| Écrit par | Développeurs | CI (jeton dédié), équipe ops (merge request) |
recette / prod : merge request sur flotte-config (revue humaine)stages: [build, update-config]
build-image:
stage: build
image: docker:28
services: [docker:28-dind]
variables: {DOCKER_TLS_CERTDIR: "/certs"}
script:
- echo "$CI_REGISTRY_PASSWORD" |
docker login -u "$CI_REGISTRY_USER" --password-stdin "$CI_REGISTRY"
- docker build --build-arg GIT_SHA="$CI_COMMIT_SHA" -t "$IMAGE" .
- docker push "$IMAGE"IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_SHORT_SHA (variable globale du pipeline)CI_REGISTRY_*, CI_COMMIT_* : prédéfinies par GitLabflotte-config, rien d'autreupdate-config:
stage: update-config
image: alpine:3.22
rules: [{if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH}]
variables:
CONFIG_REPO_URL: $FLOTTE_CONFIG_URL
CONFIG_TOKEN: $FLOTTE_CONFIG_TOKEN
NEW_IMAGE: $IMAGE
before_script: [apk add --no-cache git kustomize]
script: [sh ci/update-config.sh]Sortie du script (testée) :
flotte-config updated: ghcr.io/stefanprodan/podinfo:6.15.0kustomize edit set image ghcr.io/stefanprodan/podinfo=$NEW_IMAGEflowchart LR G["GitLab<br/>push"] -- "POST /api/webhook<br/>X-Gitlab-Token" --> S["argocd-server"] S --> C["Rafraîchissement<br/>des applications"]
flotte-config → Settings → Webhooks → URL https://<ARGOCD>/api/webhook, événement Pushwebhook.gitlab.secret dans argocd-secret = jeton secret du webhookkind local : injoignable depuis GitLab.com → réconciliation ou Refresh en formationwebhook sans secret = n'importe qui peut déclencher des rafraîchissements
Jenkinsfile déclaratif (démonstration)stage('Update flotte-config') {
when { branch 'main' }
steps {
withCredentials([string(credentialsId: 'flotte-config-token', variable: 'TOKEN')]) {
sh '''CONFIG_REPO_URL="$FLOTTE_CONFIG_URL" CONFIG_TOKEN="$TOKEN" \
NEW_IMAGE="$IMAGE" sh ci/update-config.sh'''
}
}
}ci/update-config.sh : la logique GitOps ne dépend pas de l'outil de CIwithCredentials), jamais dans le Jenkinsfilewhen { branch 'main' } : job Multibranch Pipeline uniquement (étape sautée dans un job Pipeline simple)| Modèle | Principe | Limite |
|---|---|---|
| CI écrit dans Git (ce module) | Commit du nouveau tag | Une écriture par livraison |
| CI appelle ArgoCD | argocd app sync, app wait avec jeton ci-gitlab (M03) |
API ArgoCD joignable depuis la CI |
| Argo CD Image Updater | Surveille le registre, met à jour le tag | Composant supplémentaire |
| Promotion par merge request | Recette, prod : revue humaine | Délai de revue |
argocd app wait --health en fin de pipeline : la CI rapporte le résultat du déploiementflotte-config ; ArgoCD = déployerflotte-config ; ArgoCD applique.latest est interdit par Kubernetesadmin d'ArgoCDflotte-config et sur le registre d'imagesargocd-cm, clé webhook.gitlabargocd-secret, clé webhook.gitlab.secretwebhook.gitlab.secret du Secret argocd-secret.kustomize build --imagekustomize edit set image <NOM>=<NOUVEAU_NOM>:<TAG>kubectl set imageargocd app set --imagekustomize edit set image <NOM>=<NOUVEAU_NOM>:<TAG>.flotte-config ne relance-t-il pas la construction de l'image ?flotte-app n'est pas déclenché par flotte-config.1 h 15 (S11.1 : 35 min · S11.2 : 40 min)
M10 terminé, comptes et RBAC du M03
Hexa Mobilité prépare l'audit de sécurité de sa plateforme GitOps
35 min
Accès effectif = Identité ∩ RBAC ArgoCD ∩ AppProject ∩ Droits Kubernetes du contrôleurflowchart LR I["Identité<br/>SSO, comptes"] --> R["RBAC ArgoCD<br/>argocd-rbac-cm"] R --> P["AppProject<br/>dépôts, cibles"] P --> K["Cluster<br/>droits du contrôleur"]
flotte ; ce module : SSO, rôles de projet, secretsdata:
url: https://argocd.example.com
oidc.config: |
name: Annuaire Hexa Mobilite
issuer: https://<IDP>/realms/hexa
clientID: argocd
clientSecret: $oidc.flotte.clientSecret
requestedScopes: ["openid", "profile", "email", "groups"]g, hexa:equipe-dev, role:dev
g, hexa:equipe-ops, role:adminargocd proj role create flotte ci-deployer
argocd proj role add-policy flotte ci-deployer \
--action sync --permission allow --object 'flotte-*'
argocd proj role create-token flotte ci-deployer --expires-in 168h --token-onlySortie attendue (argocd proj role get flotte ci-deployer, extrait) :
p, proj:flotte:ci-deployer, applications, sync, flotte/flotte-*, allowstatus.jwtTokensByRole ; révocation : argocd proj role delete-token| Mesure | Réglage | Défaut |
|---|---|---|
Compte admin désactivé |
admin.enabled: "false" |
Activé |
| Accès anonyme interdit | users.anonymous.enabled: "false" |
Désactivé |
| Terminal web fermé | exec.enabled: "false" |
Désactivé |
| Sessions courtes | users.session.duration: "8h" |
24 h |
| TLS reconnu | Certificat dans argocd-server-tls |
Auto-signé |
| Rollback séparé de sync | server.rbac.rollback.enforce.enable (M06) |
Non |
policy.default vide, dépôts scopés par projet| Besoin | Extension | Configuration |
|---|---|---|
| Outil de rendu non natif | Plugin de configuration (CMP) | Sidecar du repo-server |
| Santé d'une ressource personnalisée | Script Lua | resource.customizations.health.* |
| Bouton d'action sur une ressource | Action Lua | resource.customizations.actions.* |
| Vue spécifique dans l'UI | Extension d'UI et proxy | extension.config (+ server.enable.proxy.extension) |
repo-server : revue, version figée40 min
Avant: Secret en base64 dans Git → lisible par quiconque clone le dépôt (base64 ≠ chiffrement)
Après: secret CHIFFRÉ dans Git, déchiffré uniquement dans le cluster
| Approche | Principe | Où vit la valeur |
|---|---|---|
| Sealed Secrets | Chiffrement asymétrique, contrôleur dans le cluster | Git (chiffrée) |
| External Secrets Operator | Lecture d'un coffre (Vault, cloud) | Coffre externe |
| SOPS (plugin) | Fichiers chiffrés par clé KMS ou age | Git (chiffrée) |
flowchart LR Dev["kubeseal<br/>clé publique"] --> SS["SealedSecret<br/>dans Git"] SS --> Argo["ArgoCD<br/>synchronise"] Argo --> Ctrl["Contrôleur<br/>clé privée"] Ctrl --> Sec["Secret<br/>flotte-dev"]
kube-system (controller.yaml de la version)kubectl create secret generic flotte-web-secrets -n flotte-dev \
--from-literal=FLOTTE_API_KEY=<VALEUR> --dry-run=client -o yaml \
| kubeseal --format yaml > apps/flotte-web/overlays/dev/sealed-secret.yamlSortie attendue (extrait du fichier) :
kind: SealedSecret
metadata:
name: flotte-web-secrets
namespace: flotte-dev
spec:
encryptedData:
FLOTTE_API_KEY: AgBZXuRzoWpbNHFbec5C6bpT/2oJN6yKqtlY5bUQhkkyF6baoXX--dry-run=client : aucun Secret créé dans le cluster, seul le fichier chiffré est produitenvFrom:
- configMapRef: {name: flotte-web-config}
- secretRef: {name: flotte-web-secrets, optional: true}Résultat testé (après synchronisation et promotion) :
bitnami.com SealedSecret flotte-dev flotte-web-secrets Synced Healthy
flotte-web-85675c5597-r777v FLOTTE_API_KEY=hexa-dev-0001optional: true dans la base : recette et prod démarrent sans ce secretownerReference vers le SealedSecret (supprimé avec lui)no key could decrypt secret (FLOTTE_API_KEY)(même SealedSecret appliqué dans flotte-recette : refusé, portée strict)
flotte-recette, flotte-prod séparémentcluster recréé sans restaurer la clé = tous les SealedSecrets inutilisables
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata: {name: flotte-web-secrets}
spec:
refreshInterval: 1h
secretStoreRef: {kind: ClusterSecretStore, name: coffre-hexa}
target: {name: flotte-web-secrets}
data:
- secretKey: FLOTTE_API_KEY
remoteRef: {key: flotte/dev, property: api-key}admin off, anonyme off, exec off, TLS, sessions courtesSecret en clair dans Git : Sealed Secrets (Git chiffré) ou ESO (coffre)Secret Kubernetes en base64 dans Git est-il une fuite ?flotte-dev est appliqué dans flotte-recette. Résultat ?flotte-recetteno key could decrypt secret (portée strict)admin.enabled: "false"exec.enabled: "false"users.anonymous.enabled: "false"policy.default: ""exec.enabled: "false" désactive le terminal web.1 h 30 (S12.1 : 35 min · S12.2 : 40 min · S12.3 : 15 min)
M00 à M11
Hexa Mobilité passe de trois environnements à une plateforme qui grandit
35 min
Maintenance = Veille + Notes de mise à niveau + Recette + Productionflowchart LR V["Veille<br/>nouvelle version"] --> N["Notes<br/>upgrading/3.x-3.y"] N --> R["Recette<br/>cluster de test"] R --> P["Production<br/>version figée"] P --> V
upgrading/ lues pour chaque sautkubectl apply -n argocd --server-side --force-conflicts \
-f https://raw.githubusercontent.com/argoproj/argo-cd/<NOUVELLE_VERSION>/manifests/install.yaml
kubectl rollout status statefulset/argocd-application-controller -n argocd
argocd versionsaut de plusieurs versions mineures sans lire chaque note de mise à niveau
argocd admin export -n argocd > argocd-backup.yaml
grep -E '^kind:' argocd-backup.yaml | sort | uniq -cSortie observée :
3 kind: Application
1 kind: ApplicationSet
2 kind: AppProject
4 kind: ConfigMap
3 kind: Secretargocd admin import -n argocd - < argocd-backup.yaml| Croissance | Réponse | Réglage |
|---|---|---|
| Nombre d'applications | ApplicationSet | Générateurs (liste, Git, clusters) |
| Nombre de clusters | Multi-clusters, Argo CD Agent | argocd cluster add, agent par cluster |
| Charge du contrôleur | Sharding (StatefulSet, N réplicas) | ARGOCD_CONTROLLER_REPLICAS, controller.sharding.algorithm |
| Charge de rendu | Réplicas du repo-server |
reposerver.parallelism.limit |
spec:
goTemplate: true
generators:
- git:
repoURL: https://gitlab.com/<GITLAB_USER>/flotte-config.git
revision: main
directories:
- path: apps/flotte-web/overlays/*
- {path: apps/flotte-web/overlays/prod, exclude: true}
template:
metadata: {name: 'flotte-web-{{.path.basename}}'}
spec:
source: {path: '{{.path.path}}'}
destination: {namespace: 'flotte-{{.path.basename}}'}flotte-webNAME NAMESPACE STATUS HEALTH
argocd/flotte-web-demo flotte-demo Synced Healthy <- dossier demo ajouté
argocd/flotte-web-dev flotte-dev Synced Healthy
argocd/flotte-web-recette flotte-recette Synced HealthysyncPolicy.applicationsSync: create-update (option du contrôleur à activer)flowchart TD Root["Application racine<br/>argocd/"] --> AS["ApplicationSet<br/>flotte-web"] Root --> API["Application<br/>flotte-api-dev"] Root --> Self["Application<br/>argocd (self-managed)"] AS --> D["flotte-web-dev"] AS --> R["flotte-web-recette"]
40 min
USERS.md du dépôt Argo CD (v3.6.1)liste déclarative tenue par le projet, sans détail des usages
| Enjeu | Pratique |
|---|---|
| Isolation des équipes | Un AppProject par équipe, destinations <equipe>-* |
| Identité | SSO, groupes de l'annuaire → rôles (M11) |
| Création des environnements | ApplicationSet par équipe (générateur Git) |
| Autonomie sans risque | Rôles de projet, jetons CI propres à l'équipe |
| Charge | Sharding du contrôleur, réplicas du repo-server |
flowchart LR Hub["ArgoCD central<br/>hub"] --> C1["Cluster<br/>région A"] Hub --> C2["Cluster<br/>région B"] Hub --> C3["Cluster<br/>recette"]
clusters : une Application par cluster déclaré (étiquettes env, region)| Exigence | Pratique ArgoCD |
|---|---|
| Changement approuvé | Merge request obligatoire sur flotte-config |
| Créneaux de mise en production | Fenêtres de synchronisation (syncWindows du projet) |
| Production décidée | Synchronisation manuelle, tag Git (M09) |
| Traçabilité | Historique Git + historique ArgoCD + notifications |
| Secrets | Coffre externe (External Secrets Operator) |
| Thème | Questions |
|---|---|
| Organisation | Combien d'équipes, de dépôts, de clusters ? Qui valide ? |
| Sécurité | Annuaire ? Coffre ? Exigences d'audit ? |
| Livraison | Fréquence ? Canari, bleu-vert ? Fenêtres imposées ? |
| Exploitation | Qui surveille ? Quelles alertes ? Quelle reprise ? |
| Croissance | Nombre d'applications dans 1 an ? Nouveaux clusters ? |
kubectl apply manuel à la plateforme GitOpsflowchart LR App["flotte-app<br/>GitLab CI"] --> Cfg["flotte-config<br/>Kustomize, Helm"] Cfg --> AS["ApplicationSet<br/>+ Applications"] AS --> Env["dev canari<br/>recette bleu-vert"] Env --> Obs["Notifications<br/>métriques"]
flotte, RBAC, rôles de projet, Sealed Secretsgit revert, app rollback, abort du canari15 min
| Évolution | Statut (v3.6.1) | Apport |
|---|---|---|
| Source Hydrator | Bêta depuis 3.5 | Manifestes rendus écrits dans Git (relecture du YAML final) |
| Sources OCI | Documentées (oci.md) |
Configuration publiée comme artefact OCI |
| Progressive Syncs | Bêta depuis 3.3 | Déploiement ordonné des Applications d'un ApplicationSet |
| Argo CD Agent | Projet argoproj-labs, v0.10.0 |
Pilotage de clusters non joignables |
| Partie | Acquis |
|---|---|
| 1. Introduction | GitOps, architecture, composants |
| 2. Configuration | Installation, accès, RBAC, projets, dépôts |
| 3. Déploiement | Applications, synchronisation, hooks, rollback |
| 4. Gestion | Supervision, dépannage, bleu-vert, canari |
| 5. Avancé | Helm, Kustomize, CI, sécurité, secrets |
| 6. Bonnes pratiques | Maintenance, échelle, cas réels, tendances |
evaluation-finale.md (QCM et cas pratique)argocd admin export (fichier sensible) + clé de Sealed Secretsargocd admin export ?directories, que se passe-t-il quand un dossier d'overlay est supprimé ?sync par défaut).repo-serversyncWindows) de l'AppProject.kustomization.yaml ?kustomization.yaml.