/gitops-argo-skills:complete-gitops-argocd-deployment-on-aks-from-scratchfrom gitops-argo-skills
Walks through a complete Argo CD GitOps deployment on an existing Azure AKS cluster, including Helm install, Azure AD Workload Identity integration for cluster access and private ACR pull auth, first Application, ApplicationSet for multi-environment rollout, and sync/health policy.
Ships in gitops-argo-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This is the AKS sequencing counterpart to the EKS and GKE variants of this
skill: Argo CD install, Application, ApplicationSet, and sync policy
mechanics are identical across every cloud and are covered once, in depth,
in the linked skills. What's genuinely different on Azure is how Argo
CD's own components authenticate — Azure AD Workload Identity (the
successor to the deprecated AAD Pod Identity) federates a Kubernetes
ServiceAccount to an Azure AD application via OIDC, using kubelogin as
the exec credential plugin rather than AWS's aws eks get-token or GKE's
gke-gcloud-auth-plugin. This skill sequences that federation correctly
relative to everything else, so Argo CD can both manage additional AKS
clusters via Azure AD and pull private images from Azure Container
Registry (ACR) without a static registry secret.
kubectl apply/helm upgrade deploys to AKS
onto a full GitOps flow, starting from zero.az aks create --enable-oidc-issuer --enable-workload-identity, or az aks update on an existing cluster)
— cluster/node-pool provisioning itself is covered by
managed-kubernetes-eks-aks-gke
and is not repeated here.helm ≥ 3.12, kubectl, az CLI ≥ 2.60, and the Azure Workload
Identity webhook already installed on the cluster (bundled by
--enable-workload-identity, but confirm with
kubectl get pods -n kube-system -l azure-workload-identity.io/system=true).kubelogin binary available wherever Argo CD's exec credential runs
(baked into the argocd-application-controller/argocd-server image or
mounted as an init step) — Azure AD-based kubeconfigs reference
kubelogin as their exec plugin, unlike a plain bearer token.az aks show --name payments-prod --resource-group payments-rg \
--query "oidcIssuerProfile.issuerUrl" -o tsv
az aks show --name payments-prod --resource-group payments-rg \
--query "securityProfile.workloadIdentity.enabled"
If either is missing, enable them before anything in Phase 2 — a federated credential created against a cluster with no OIDC issuer has nothing to federate against, and fails the same silent way as EKS's missing OIDC provider.
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update
helm install argocd argo/argo-cd \
--namespace argocd --create-namespace \
--version 7.6.12 \
--set server.service.type=ClusterIP
kubectl get pods -n argocd
Two distinct needs, both solved with Workload Identity:
Cross-cluster access. For Argo CD to manage a second AKS cluster
(payments-staging) as a destination, create a managed identity, a
federated credential trusting payments-prod's OIDC issuer for the
argocd-application-controller ServiceAccount, and grant that identity
Azure Kubernetes Service Cluster User Role plus an AKS Azure RBAC
binding (Azure Kubernetes Service RBAC Writer) scoped to
payments-staging:
az identity create --name argocd-cross-cluster --resource-group payments-rg
az identity federated-credential create \
--name argocd-cross-cluster-fic --identity-name argocd-cross-cluster \
--resource-group payments-rg \
--issuer "$(az aks show -n payments-prod -g payments-rg --query oidcIssuerProfile.issuerUrl -o tsv)" \
--subject system:serviceaccount:argocd:argocd-application-controller \
--audience api://AzureADTokenExchange
az role assignment create \
--assignee "$(az identity show -n argocd-cross-cluster -g payments-rg --query principalId -o tsv)" \
--role "Azure Kubernetes Service RBAC Writer" \
--scope "$(az aks show -n payments-staging -g payments-rg --query id -o tsv)"
apiVersion: v1
kind: ServiceAccount
metadata:
name: argocd-application-controller
namespace: argocd
annotations:
azure.workload.identity/client-id: <ARGOCD_CROSS_CLUSTER_CLIENT_ID>
labels:
azure.workload.identity/use: "true"
The destination cluster Secret Argo CD uses to register
payments-staging then points its exec credential at kubelogin
instead of a static bearer token:
config: |
{
"execProviderConfig": {
"command": "kubelogin",
"args": ["get-token", "--login", "workloadidentity",
"--server-id", "6dae42f8-4368-4678-94ff-3960e28e3630"],
"apiVersion": "client.authentication.k8s.io/v1beta1"
},
"tlsClientConfig": { "insecure": false, "caData": "${SPOKE_CA_DATA_BASE64}" }
}
This is the Azure counterpart of the cluster-registration pattern in
gitops-multi-cluster-management
— same Secret-based registration, but the credential is an Azure AD
token exchanged via kubelogin instead of a static bearer token or
AWS's aws eks get-token.
Private ACR image pulls for argocd-repo-server (Helm OCI charts)
and application workloads, using the same federation mechanics shown in
managed-kubernetes-eks-aks-gke:
az identity create --name argocd-repo-server-acr --resource-group payments-rg
az role assignment create \
--assignee "$(az identity show -n argocd-repo-server-acr -g payments-rg --query principalId -o tsv)" \
--role AcrPull \
--scope "$(az acr show -n paymentsregistry --query id -o tsv)"
az identity federated-credential create \
--name argocd-repo-server-fic --identity-name argocd-repo-server-acr \
--resource-group payments-rg \
--issuer "$(az aks show -n payments-prod -g payments-rg --query oidcIssuerProfile.issuerUrl -o tsv)" \
--subject system:serviceaccount:argocd:argocd-repo-server
apiVersion: v1
kind: ServiceAccount
metadata:
name: argocd-repo-server
namespace: argocd
annotations:
azure.workload.identity/client-id: <ARGOCD_REPO_SERVER_ACR_CLIENT_ID>
labels:
azure.workload.identity/use: "true"
Same mechanics as any other cluster:
ingress-nginx-configuration
in front of argocd-server, certificate issued by
cert-manager-tls-automation
via DNS-01 against Azure DNS (its own Workload-Identity-federated
credential, per that skill's guidance) rather than a self-signed cert.
ApplicationFollow argocd-application-configuration
in full for the Application spec, sync-wave ordering, and health checks;
apply and sync manually first:
kubectl apply -f payments-api-staging-application.yaml
argocd login argocd.example.com --sso
argocd app sync payments-api-staging --dry-run
argocd app sync payments-api-staging
ApplicationSet for multi-environment rolloutReplace the single hand-authored Application with an ApplicationSet
per argocd-applicationset-patterns.
If staging and prod are separate AKS clusters, use the Cluster generator
filtered by label, with each cluster's registration reusing the Workload
Identity federation from Phase 2.
Manual sync until the pipeline feeding the config repo is trusted, then
automated per environment, plus custom Lua health checks for any
internal CRDs — both per
argocd-application-configuration.
argocd cluster list
argocd app list
kubectl exec -n argocd deploy/argocd-repo-server -- az account show
az account show from inside argocd-repo-server should show the
federated managed identity, not an error — confirming the workload
identity webhook actually injected the federated token rather than the
pod silently having no Azure identity at all.
--enable-oidc-issuer and --enable-workload-identity at
cluster creation time where possible; enabling them later on an existing
cluster works but requires a rollout of every pod that needs the
webhook's mutation to take effect.--subject to an exact
system:serviceaccount:<namespace>:<name> pair — a federated credential
is not automatically valid for a same-named ServiceAccount in a
different namespace, mirroring the equivalent pitfall in
managed-kubernetes-eks-aks-gke.AcrPull only on the specific ACR registry (or repository, if
using ACR's repository-scoped tokens) Argo CD needs — not
subscription-wide Contributor.argocd-server via a public LoadBalancer Service —
terminate through Ingress + cert-manager as in Phase 3.Symptom: A ServiceAccount has the correct
azure.workload.identity/client-id annotation and the
azure.workload.identity/use: "true" label, but a pod using it still
gets an authentication error from Azure.
Fix: Check that the pod was actually recreated after the annotation
was added — the Workload Identity webhook only mutates pods at creation
time; patching an existing running pod's ServiceAccount reference does
not retroactively inject the federated token volume. Delete and let the
Deployment recreate the pod.
Symptom: The federated credential's --subject was copy-pasted from
a working example and cluster access silently fails for a differently-
named ServiceAccount in a new namespace.
Fix: Federated credentials are exact-match on
namespace:serviceaccount — create a new federated credential (or add
a namespace) per actual subject, don't assume one credential covers
every namespace a workload might run in.
Symptom: The first Application was created with automated: {prune: true, selfHeal: true} immediately, and a bad initial manifest
deleted an unrelated pre-existing resource in the target namespace.
Fix: Same end-to-end sequencing pitfall as on any cloud — always run
the first sync manually with --dry-run (Phase 4) before enabling
automated in a later, deliberate step (Phase 6).
Symptom: argocd-repo-server can reach the Git repo but pulling a
Helm OCI chart or the workload's own image from ACR fails with
unauthorized.
Fix: ACR pull auth for the workload's own pods is a separate
Workload Identity binding from the repo-server's — bind the workload's
own ServiceAccount to a federated identity with AcrPull on the
relevant registry, don't assume the repo-server's binding covers it.
Scenario: Stand up Argo CD from scratch on payments-prod AKS,
register payments-staging AKS as a second destination via Workload
Identity, and roll payments-api out to both via an ApplicationSet.
# Phase 0
az aks update -n payments-prod -g payments-rg \
--enable-oidc-issuer --enable-workload-identity
# Phase 1
helm install argocd argo/argo-cd -n argocd --create-namespace --version 7.6.12
# Phase 2 — cross-cluster federated credential
az identity create --name argocd-cross-cluster --resource-group payments-rg
az identity federated-credential create --name argocd-cross-cluster-fic \
--identity-name argocd-cross-cluster --resource-group payments-rg \
--issuer "$(az aks show -n payments-prod -g payments-rg --query oidcIssuerProfile.issuerUrl -o tsv)" \
--subject system:serviceaccount:argocd:argocd-application-controller
az role assignment create \
--assignee "$(az identity show -n argocd-cross-cluster -g payments-rg --query principalId -o tsv)" \
--role "Azure Kubernetes Service RBAC Writer" \
--scope "$(az aks show -n payments-staging -g payments-rg --query id -o tsv)"
# Phase 4 — first Application, manual sync
kubectl apply -f payments-api-staging-application.yaml
argocd app sync payments-api-staging --dry-run
argocd app sync payments-api-staging
Phase 5 then replaces the single Application with a Cluster-generator
ApplicationSet selecting tier: staging/tier: prod labeled clusters
(full YAML in
argocd-applicationset-patterns),
and Phase 6 promotes staging's sync policy to automated once verified.
Application spec used in Phase 4/6.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin gitops-argo-skills11 skills in this plugin
/argocd-application-configurationConfigures Argo CD `Application` custom resources — sync policies (automated vs. manual, prune, self-heal), sync waves and hooks for ordered/multi-phase rollouts, and health checks for custom resource types. Use when the user asks to "write an Argo CD Application manifest," "enable auto-sync / self-heal / prune," "order resources with sync waves," "add a PreSync/PostSync hook," "fix an Application stuck OutOfSync or Progressing," or "define a custom health check for a CRD Argo CD doesn't understand natively."
/argocd-applicationset-patternsDesigns Argo CD `ApplicationSet` resources that template many `Application` objects from a single source using generators — List, Cluster, Git directory/file, and Matrix (combined generators). Use when the user asks to "generate an Application per cluster/environment/ directory," "avoid copy-pasting Argo CD Applications," "roll out a service to a fleet of clusters," "combine a cluster generator with a Git generator," or "debug an ApplicationSet producing unexpected or missing Applications."
/argocd-sync-failure-and-drift-investigationTroubleshoots Argo CD `Application`s that are stuck or failing — `OutOfSync`/`Progressing`/`Degraded` states, `PreSync`/`Sync`/`PostSync` hook Jobs that fail or hang, resource-level diffs that are hard to read, and distinguishing drift caused by an out-of-band `kubectl edit`/`kubectl patch` from genuine configuration drift between Git and the live cluster. Use when the user asks to "debug why an Argo CD app is OutOfSync," "figure out what's actually different between Git and the cluster," "a sync hook is failing/stuck," "someone kubectl edited a resource Argo CD manages," or "an Application says Synced but the cluster doesn't match Git."
/argo-events-and-event-driven-automationConfigures Argo Events `EventSource`, `Sensor`, and `EventBus` CRDs to trigger Argo Workflows, Kubernetes resource changes, or other actions from external events — webhooks, message queues (Kafka/NATS/SQS/ RabbitMQ), and cron schedules. Use when the user asks to "trigger an Argo Workflow from a webhook," "wire up an EventSource for S3/Kafka/ GitHub events," "fan events out to multiple triggers with a Sensor," "debug a Sensor that isn't firing," or "build event-driven automation on Kubernetes without a separate message broker to operate."
/argo-rollouts-progressive-deliveryConfigures the Argo Rollouts `Rollout` CRD as a drop-in replacement for a Kubernetes `Deployment`, covering canary and blue-green strategy mechanics, traffic management integration (service mesh/ingress controllers), and `AnalysisTemplate`/`AnalysisRun` for automated metric-based promotion and rollback. Use when the user asks to "convert a Deployment to an Argo Rollout," "configure canary steps with setWeight/pause," "wire up an AnalysisTemplate against Prometheus/ Datadog," "fix a Rollout stuck mid-canary," or "automate rollback on bad metrics with Argo Rollouts."
/argo-workflows-pipeline-designDesigns Argo Workflows pipelines using the `Workflow`/`WorkflowTemplate`/ `CronWorkflow` CRDs — choosing DAG vs. steps templates, passing artifacts and parameters between steps, and structuring Kubernetes-native batch/ML pipelines distinct from a CI system. Use when the user asks to "write an Argo Workflow," "build a DAG pipeline on Kubernetes," "pass an artifact between workflow steps," "reuse a WorkflowTemplate across pipelines," "schedule a recurring Argo CronWorkflow," or "decide whether a batch job belongs in Argo Workflows vs. a CI pipeline."
Other plugins' skills for the same job