/gitops-argo-skills:complete-gitops-argocd-deployment-on-gke-from-scratchfrom gitops-argo-skills
Walks through end-to-end Argo CD GitOps deployment on GKE: Helm install, Workload Identity Federation, first Application, ApplicationSet for multi-env 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 GKE sequencing counterpart to the EKS and AKS variants of this
skill: Argo CD install, Application, ApplicationSet, and sync policy
mechanics are identical across clouds and are covered once, in depth, by
the linked skills. What's genuinely different on GCP is how Argo CD's
own components authenticate — GKE's Workload Identity Federation binds a
Kubernetes ServiceAccount to a Google service account (GSA) via the
<project>.svc.id.goog identity pool, and the gke-gcloud-auth-plugin
exec credential (mandatory as of client-go's removal of built-in GCP auth)
replaces AWS's aws eks get-token or Azure's kubelogin. This skill
sequences that federation correctly relative to everything else, so Argo
CD can manage additional GKE clusters via IAM and pull private images from
Artifact Registry without a static registry key.
kubectl apply/helm upgrade deploys to GKE
onto a full GitOps flow, starting from zero.--workload-pool=<project-id>.svc.id.goog at cluster creation,
or enabled after the fact via gcloud container clusters update) —
cluster/node-pool provisioning itself is covered by
managed-kubernetes-eks-aks-gke
and is not repeated here.helm ≥ 3.12, kubectl, gcloud CLI, and the
gke-gcloud-auth-plugin component installed
(gcloud components install gke-gcloud-auth-plugin) wherever Argo CD's
exec credential runs — required for any exec-based GKE cluster
authentication since GCP auth was removed from client-go directly.gcloud container clusters describe payments-prod --zone us-central1-a \
--format="value(workloadIdentityConfig.workloadPool)"
Expect <project-id>.svc.id.goog. If empty, enable it before Phase 2 — a
iam.workloadIdentityUser binding created against a cluster with no
workload pool configured has nothing to federate against, and fails the
same silent way as EKS's missing OIDC provider or AKS's missing OIDC
issuer.
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 Federation:
Cross-cluster access. For Argo CD to manage a second GKE cluster
(payments-staging) as a destination, create a GSA, bind it to the
argocd-application-controller KSA via workloadIdentityUser, and
grant the GSA roles/container.developer scoped to the
payments-staging project/cluster:
gcloud iam service-accounts create argocd-cross-cluster \
--project <project-id>
gcloud iam service-accounts add-iam-policy-binding \
argocd-cross-cluster@<project-id>.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:<project-id>.svc.id.goog[argocd/argocd-application-controller]"
gcloud projects add-iam-policy-binding <project-id> \
--member "serviceAccount:argocd-cross-cluster@<project-id>.iam.gserviceaccount.com" \
--role roles/container.developer \
--condition "expression=resource.name.startsWith('projects/<project-id>/locations/us-central1-a/clusters/payments-staging'),title=staging-only"
apiVersion: v1
kind: ServiceAccount
metadata:
name: argocd-application-controller
namespace: argocd
annotations:
iam.gke.io/gcp-service-account: argocd-cross-cluster@<project-id>.iam.gserviceaccount.com
The destination cluster Secret Argo CD uses to register
payments-staging then points its exec credential at
gke-gcloud-auth-plugin instead of a static bearer token:
config: |
{
"execProviderConfig": {
"command": "gke-gcloud-auth-plugin",
"installHint": "Install gke-gcloud-auth-plugin for use with kubectl by following https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke",
"provideClusterInfo": true,
"apiVersion": "client.authentication.k8s.io/v1beta1"
},
"tlsClientConfig": { "insecure": false, "caData": "${SPOKE_CA_DATA_BASE64}" }
}
This is the GCP counterpart of the cluster-registration pattern in
gitops-multi-cluster-management
— same Secret-based registration, but the credential is a Google
IAM-federated token exchanged via gke-gcloud-auth-plugin instead of a
static bearer token, AWS's aws eks get-token, or Azure's kubelogin.
Private Artifact Registry image pulls for argocd-repo-server
(Helm OCI charts) and application workloads, using the same federation
mechanics shown in
managed-kubernetes-eks-aks-gke:
gcloud iam service-accounts create argocd-repo-server-ar --project <project-id>
gcloud artifacts repositories add-iam-policy-binding payments-images \
--location us-central1 \
--member "serviceAccount:argocd-repo-server-ar@<project-id>.iam.gserviceaccount.com" \
--role roles/artifactregistry.reader
gcloud iam service-accounts add-iam-policy-binding \
argocd-repo-server-ar@<project-id>.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:<project-id>.svc.id.goog[argocd/argocd-repo-server]"
apiVersion: v1
kind: ServiceAccount
metadata:
name: argocd-repo-server
namespace: argocd
annotations:
iam.gke.io/gcp-service-account: argocd-repo-server-ar@<project-id>.iam.gserviceaccount.com
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 Cloud 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 GKE 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 -- gcloud auth list
gcloud auth list from inside argocd-repo-server should show the
federated GSA as the active account, not the node's own default compute
service account — confirming the pod is actually using Workload Identity
Federation rather than silently falling back to the node's identity.
--workload-pool) where possible; enabling it on an existing node pool
requires a node pool recreation (--workload-metadata=GKE_METADATA) for
the metadata server proxy to actually intercept credential requests.<project>.svc.id.goog[<namespace>/<ksa>]
member — a binding is not automatically valid for a same-named KSA in a
different namespace, mirroring the equivalent pitfall in
managed-kubernetes-eks-aks-gke.roles/artifactregistry.reader scoped to the specific repository
Argo CD needs, not project-wide roles/artifactregistry.admin.argocd-server via a public LoadBalancer Service —
terminate through Ingress + cert-manager as in Phase 3.Symptom: A ServiceAccount has the correct
iam.gke.io/gcp-service-account annotation and the IAM binding exists,
but a pod using it still gets a 403/metadata-server error from Google
APIs.
Fix: Check the node pool's --workload-metadata setting — if the
node pool was created before Workload Identity was enabled cluster-wide,
its nodes may not have GKE_METADATA mode active, so the metadata
server never intercepts and rewrites the credential request; recreate
or update the specific node pool, not just the cluster-level setting.
Symptom: The iam.workloadIdentityUser binding's member string was
copy-pasted from a working example and cluster access silently fails
for a differently-named KSA in a new namespace.
Fix: Workload Identity bindings are exact-match on
<project>.svc.id.goog[namespace/ksa-name] — add a new binding per
actual namespace/ServiceAccount pair, don't assume one binding 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 Artifact Registry fails
with PERMISSION_DENIED.
Fix: Artifact Registry 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 GSA with artifactregistry.reader on
the relevant repository, don't assume the repo-server's binding covers
it.
Scenario: Stand up Argo CD from scratch on payments-prod GKE,
register payments-staging GKE as a second destination via Workload
Identity Federation, and roll payments-api out to both via an
ApplicationSet.
# Phase 0
gcloud container clusters update payments-prod --zone us-central1-a \
--workload-pool=<project-id>.svc.id.goog
# Phase 1
helm install argocd argo/argo-cd -n argocd --create-namespace --version 7.6.12
# Phase 2 — cross-cluster federated GSA
gcloud iam service-accounts create argocd-cross-cluster --project <project-id>
gcloud iam service-accounts add-iam-policy-binding \
argocd-cross-cluster@<project-id>.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:<project-id>.svc.id.goog[argocd/argocd-application-controller]"
# 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