ArgoCD

VérifiéPrudence

Opérations ArgoCD sur le cluster K3s — repointage de branche via ansible, pièges de câblage de chart Helm OCI (le préfixe oci:// casse la résolution du nom de chart), et le rebond de cache InvalidSpecError.

Spar Skills Guide Bot
DevOpsIntermédiaire
23/07/2026
Claude Code
#argocd#kubernetes#helm#gitops#troubleshooting

Recommandé pour

Synthèse automatique

Guide opérationnel ArgoCD pour un cluster K3s : repointage de branche via Ansible, pièges de câblage des charts Helm OCI et erreurs de cache InvalidSpecError.

Points forts

  • Décrit la procédure sanctionnée pour pointer l'app racine vers une branche de PR sans éditer l'Application à la main
  • Explique précisément pourquoi le préfixe oci:// casse la résolution du nom de chart, avec la ligne de log à rechercher
  • Fournit les commandes exactes de remédiation (annotation de refresh, redémarrage du controller, helm pull de vérification)
  • Couvre le piège du pin de version non publié et l'absence de redémarrage sur changement de ConfigMap seul

Limites

  • Très spécifique à ce dépôt et à ce cluster (nom de l'app racine, group_vars/all.yml, pb_all.yml)
  • Ne traite pas de la synchronisation multi-cluster ni des strategies de sync avancées (waves, sync windows)
  • Suppose une bonne familiarité avec kubectl, Helm et Ansible
Quand l'utiliser

À utiliser lors du smoke-test d'une branche de PR via ArgoCD ou pour diagnostiquer une erreur de sync liée à un chart OCI ou à un AppProject modifié.

Quand l'éviter

À éviter sur un cluster ArgoCD standard où l'app-of-apps, les chemins de fichiers et les règles internes décrits ici n'existent pas.

Analyse de sécurité

Prudence
Score qualité86/100

No malicious intent: no curl|sh, no credential/token exfiltration, no obfuscated payloads, no safety-disabling. However, the skill is an operational runbook that intentionally directs privileged cluster-mutating actions (ansible apply, pod deletions) and assumes live kubeconfig access, so it warrants caution rather than 'safe' — a user should run it against the intended cluster only and be aware pod deletions are disruptive.

Points d'attention
  • •Instructs running `uv run ansible-playbook pb_all.yml --tags cluster` which mutates the live cluster (re-templates and applies the root Application)
  • •Instructs `kubectl delete pod` on argocd-application-controller-0 and on workload pods — disruptive but recoverable operations against a production cluster
  • •Commands reference concrete namespaces/resources (`argo-cd`, `all-cluster-services`) and assume kubectl/helm/ansible credentials already exist in the environment
  • •No tool allowlist declared, so the agent may run arbitrary bash/network commands implied by the runbook
Comment cette analyse est faite

Exemples

Force child apps onto the PR branch
I set repo_branch to my feature branch and ran the cluster playbook, but the child Applications still show the old revision after a minute. What should I do?
ArgoCD 403 on an OCI chart
My ArgoCD app fails with a 403 denied from ghcr.io on an OCI Helm chart, and the log shows it pulling /charts/manifests/<ver> without the chart name. How do I fix the repoURL and sourceRepos?
Stale InvalidSpecError
I fixed sourceRepos in the AppProject but the app is still Unknown/Unknown with the same InvalidSpecError and the annotation refresh doesn't help. How do I clear it?

name: argocd description: ArgoCD operations on the K3s cluster — branch repointing via ansible, OCI Helm chart wiring foot-guns (oci:// prefix breaks chart-name resolution), and the InvalidSpecError cache bounce.

ArgoCD

The cluster runs an app-of-apps. The root Application is all-cluster-services in namespace argo-cd; it templates the child Applications under kubernetes-services/templates/ from this repo.

Branch repointing (smoke-testing a PR branch)

Don't kubectl edit the root Application. The sanctioned path:

  1. Edit group_vars/all.yml → set repo_branch: <branch>. Do NOT commit this — it's a local-only smoke pointer.
  2. uv run ansible-playbook pb_all.yml --tags cluster — re-templates the root app and applies it. This is one of the few commands in the hard rules that's allowed to mutate the live cluster.
  3. If child apps don't pick up the new revision within a minute, force a re-fetch on the root:
    kubectl -n argo-cd annotate application all-cluster-services \
      argocd.argoproj.io/refresh=hard --overwrite
    
  4. Reset repo_branch: main when done.

Don't push an unpublished chart pin while ArgoCD watches that branch

While repo_branch points at a PR/dev branch for a smoke test, ArgoCD syncs from the pushed tip of that branch. So bumping an OCI chart pin (e.g. chart_version/image_tag in kubernetes-services/values.yaml) to a tag that isn't on the registry yet and pushing it makes ArgoCD fail the next sync with the ComparisonError: ... 403/404 from the OCI trap below — the chart genuinely doesn't exist at that version.

When prepping a version bump ahead of the upstream release: keep the edit out of the pushed branch — park it (a .parked.md diff under _plans/, or just leave values.yaml untouched and stage the bump later). Verify the tag is live before applying:

helm pull oci://ghcr.io/<org>/charts/<chart> --version <ver>   # 200 = safe to pin

Doc edits that merely mention the new version are fine to commit early (they don't deploy); only the values.yaml pin is load-bearing.

OCI Helm charts — oci:// prefix is a trap

For an OCI-hosted Helm chart (e.g. ghcr.io/<org>/charts/<chart>):

  • Application repoURL: bare ghcr.io/<org>/charts (no oci:// prefix)
  • Application chart: <chart> (the sub-path)
  • AppProject sourceRepos: must match exactly — also bare ghcr.io/<org>/charts

If you use oci://ghcr.io/<org>/charts in repoURL, ArgoCD's URL construction drops the chart name and tries to pull https://ghcr.io/v2/<org>/charts/manifests/<ver> instead of .../charts/<chart>/manifests/<ver> — producing a baffling 403 from ghcr (denied access to the wrong path). The error log line to look for in argocd-repo-server:

HEAD "https://ghcr.io/v2/<org>/charts/manifests/<ver>": 
  GET "https://ghcr.io/token?scope=repository:<org>/charts:pull&...": 403: denied

If you see that, the fix is to drop oci:// from both the Application and the matching sourceRepos entry in argo-cd/argo-project.yaml.

InvalidSpecError sticks after AppProject edits

ArgoCD caches the InvalidSpecError condition with the original lastTransitionTime — even after you fix the AppProject's sourceRepos, the child app stays Unknown/Unknown with the same stale error. Annotations / refreshes don't clear it.

Bounce the application controller to force re-validation:

kubectl -n argo-cd delete pod argocd-application-controller-0

It's a StatefulSet, recreates cleanly within seconds. Allowed under the hard rules — pod lifecycle, not config drift.

ConfigMap-only changes don't roll the pod (envFrom + no checksum)

If a workload consumes a chart-rendered ConfigMap/Secret via envFrom (or env valueFrom), changing only the ConfigMap data does not restart the pod. Env vars are injected at pod start, and unless the chart's Deployment pod template carries a checksum/config (and checksum/secret) annotation, the Deployment spec is unchanged — so ArgoCD shows the app Synced/Healthy while the running pod keeps the stale values. Easy to miss: the ConfigMap in the cluster is correct, but the config is not actually enforced.

Diagnose by comparing the ConfigMap to what the pod actually has:

kubectl get cm -n <ns> <cm> -o jsonpath='{.data.<KEY>}'      # new value
kubectl exec -n <ns> <pod> -- printenv <KEY>                  # stale value

Enforce it by restarting the pod (the Deployment recreates it identically — pods aren't ArgoCD-tracked, so this is no git drift and allowed under the hard rules, same as the app-controller bounce above):

kubectl delete pod -n <ns> <pod>

The real fix is upstream: the chart should add checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} to the pod template so data changes roll the workload automatically.

Spotting which validator is failing

Three distinct conditions, three distinct fixes:

| Condition | Where it fires | What to fix | |---|---|---| | InvalidSpecError: application repo X is not permitted in project Y | App-controller, against AppProject | Add X to sourceRepos in argo-cd/argo-project.yaml, re-apply with --tags cluster, bounce app-controller | | ComparisonError: failed to resolve revision ...: 403/404 | Repo-server, against the remote registry | OCI URL wrong (see oci:// trap above) or chart genuinely missing/private | | ComparisonError: values don't meet the specifications of the schema(s) | Repo-server, helm template | Chart's values.schema.json rejects your valuesObject — check additionalProperties: false, key casing, etc. |

The first two often appear together when the project allowlist and URL form are both wrong; fixing only one leaves the app still Unknown.

Du fichier au premier essai

Le téléchargement contient exactement le contenu affiché sur cette fiche. Cette copie peut différer de la dernière version du dépôt source.

Consulter la source et ses fichiers annexes

Ce téléchargement contient uniquement SKILL.md. Les scripts, références, modèles et dépendances éventuels ne sont pas inclus. Récupérez les fichiers nécessaires depuis la source en conservant leur arborescence avant de poursuivre.

1. Télécharger le fichier

Télécharger SKILL.md

Depuis la racine d’un projet de test, enregistrez le fichier sous .skill-downloads/argocd-mrx3xwd0/SKILL.md, ou utilisez la commande suivante. Ce dossier sert à examiner la skill avant son installation.

Commande pour macOS/Linux ou WSL : un shell POSIX et curl sont nécessaires. Sous Windows sans WSL, utilisez le bouton de téléchargement et créez le dossier manuellement.

mkdir -p '.skill-downloads/argocd-mrx3xwd0' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/argocd-mrx3xwd0/download' --output '.skill-downloads/argocd-mrx3xwd0/SKILL.md.part' && mv '.skill-downloads/argocd-mrx3xwd0/SKILL.md.part' '.skill-downloads/argocd-mrx3xwd0/SKILL.md'

2. Vérifier les prérequis

Lisez SKILL.md avant de l’utiliser. Si le fichier cite des scripts ou services externes, examinez-les et préparez les accès nécessaires dans votre environnement de test.

Aucune section de prérequis reconnue dans ce fichier. Cela ne signifie pas qu’il est autonome : les bibliothèques, outils et accès peuvent être cités ailleurs dans le contenu ou dans le dépôt source.

Les plateformes de la fiche sont des indications du catalogue. Les chemins ci-dessous suivent la documentation des outils ; ils ne prouvent pas que cette skill y a été exécutée. Aucune version minimale de ces outils n’est attestée pour cette fiche.

3. Charger la skill

Après vérification, copiez le dossier complet dans le projet avec l’une des commandes ci-dessous, puis ouvrez une nouvelle session de l’outil. La commande s’arrête si un dossier du même nom existe déjà : comparez les fichiers avant de le remplacer.

Claude Code
test -f '.skill-downloads/argocd-mrx3xwd0/SKILL.md' && test -s '.skill-downloads/argocd-mrx3xwd0/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/argocd' && cp -R '.skill-downloads/argocd-mrx3xwd0' '.claude/skills/argocd'

OpenSkills

OpenSkills doit déjà être installé. La procédure locale install/read est contrôlée avec OpenSkills 1.5.0, qui exige Node.js ≥ 20.6.0. Aucun slug du catalogue n’est résolu automatiquement.

Installation officielle d’OpenSkills
openskills install './.skill-downloads/argocd-mrx3xwd0'

openskills read 'argocd-mrx3xwd0'

La lecture doit afficher le contenu du fichier installé et son dossier de base. Elle ne lance ni la skill ni ses dépendances.

Pour un agent qui lit AGENTS.md, synchronisez ensuite l’index. Cette commande modifie AGENTS.md : relisez le diff avant de l’utiliser.

openskills sync

Mode manuel ou autre outil : joignez SKILL.md à une conversation, ou ouvrez-le dans un agent capable de lire les fichiers. Ajoutez les ressources annexes nécessaires. Il n’existe pas de dossier universel reconnu par tous les outils.

4. Faire un premier essai

Utilisez une entrée courte et fictive : un endpoint d’API, un petit document ou un brief d’interface. Dans une nouvelle conversation, joignez le fichier ou donnez son chemin à l’agent, puis adaptez cette demande :

Lis .skill-downloads/argocd-mrx3xwd0/SKILL.md et applique ses instructions à cet exemple : [décrire une entrée de test]. Indique les fichiers, dépendances ou accès qui manquent. Produis le résultat demandé par la skill sans inventer de données ni exécuter de script non examiné.

Résultat attendu : une sortie correspondant aux instructions de la skill, ou une liste précise des prérequis manquants. Une simple confirmation de lecture ne valide pas le premier usage. Si une ressource externe est indisponible, ce parcours reste à tester.

Skills similaires