/gitops-argo-skills:complete-gitops-argocd-deployment-on-eks-from-scratchfrom gitops-argo-skills
Sequenced runbook for deploying Argo CD GitOps on an existing AWS EKS cluster: Helm install, IRSA-based IAM integration, first Application, ApplicationSet for multi-environment rollout, and sync/health policy. Use when setting up Argo CD on EKS from scratch or wiring IRSA into Argo CD.
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.
Every piece of this deployment — installing Argo CD, giving it AWS
permissions, writing an Application, templating that into an
ApplicationSet, and choosing a sync policy — already has its own deep
skill in this repo. What's missing is the sequencing: in what order do
you actually do these things on a fresh EKS cluster so that each step's
prerequisites are satisfied by the step before it, and where does this
specific cloud's IAM model (IRSA) plug in versus where the mechanics are
identical to any other Kubernetes cluster? This skill is that runbook. The
one genuinely AWS-specific decision point is how Argo CD authenticates to
AWS, both for its own EKS cluster access (via IAM, not a static bearer
token) and for pulling images from a private ECR registry — everything
downstream (the Application spec, the ApplicationSet generator, sync
policy) is identical to any other Kubernetes target and is covered in depth
by the linked skills, not repeated here.
kubectl apply/helm upgrade deploys to EKS
onto a full GitOps flow, starting from zero.kubectl — cluster
creation, node groups, and networking are covered by
managed-kubernetes-eks-aks-gke
and are not repeated here; this skill starts from "the cluster
exists."eksctl utils associate-iam-oidc-provider) — required before any IRSA
role can be created; if this is missing, do it as the very first step,
since every later IAM step silently fails without it.helm ≥ 3.12, kubectl, eksctl or Terraform's aws provider, and
aws CLI v2 with IAM permissions to create roles/policies and EKS
access entries.eksctl utils associate-iam-oidc-provider --cluster payments-prod --approve
aws eks describe-cluster --name payments-prod --query "cluster.identity.oidc.issuer"
If the OIDC issuer isn't associated yet, every iamserviceaccount/IRSA
step in Phase 2 will silently produce a ServiceAccount with an annotation
pointing at a role AWS never trusts — confirm this first, not after Argo CD
is already installed.
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 # wait for all Deployments/StatefulSet Ready
Use ClusterIP (not a public LoadBalancer) for the server service by
default — Phase 3 puts a proper Ingress + TLS in front of it rather than
exposing the API server directly on a cloud load balancer.
This is the AWS-specific step with no equivalent on a plain Kubernetes cluster. Two distinct needs, both solved with IRSA:
Argo CD's application-controller/server need IAM, not just a
static bearer token, to manage destination EKS clusters beyond the
one it's running on (a second EKS cluster in another account/region).
Create an IRSA role for the controller's ServiceAccount, grant it
sts:AssumeRole onto a role in the target account, and register the
destination cluster using an EKS access entry (the modern
replacement for hand-editing the aws-auth ConfigMap) instead of a
long-lived kubeconfig token:
eksctl create iamserviceaccount \
--cluster payments-prod --namespace argocd \
--name argocd-application-controller \
--role-name argocd-eks-cross-cluster \
--attach-policy-arn arn:aws:iam::<AWS_ACCOUNT_ID>:policy/ArgoCDAssumeSpokeRole \
--override-existing-serviceaccounts --approve
aws eks create-access-entry \
--cluster-name payments-staging \
--principal-arn arn:aws:iam::<AWS_ACCOUNT_ID>:role/argocd-eks-cross-cluster \
--type STANDARD
aws eks associate-access-policy \
--cluster-name payments-staging \
--principal-arn arn:aws:iam::<AWS_ACCOUNT_ID>:role/argocd-eks-cross-cluster \
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy \
--access-scope type=cluster
The cluster Secret Argo CD uses to register payments-staging as a
destination then uses an exec-based credential (aws eks get-token)
instead of a bearer token/client cert:
config: |
{
"execProviderConfig": {
"command": "aws",
"args": ["eks", "get-token", "--cluster-name", "payments-staging", "--role-arn", "arn:aws:iam::<AWS_ACCOUNT_ID>:role/argocd-eks-cross-cluster"],
"apiVersion": "client.authentication.k8s.io/v1beta1"
},
"tlsClientConfig": { "insecure": false, "caData": "${SPOKE_CA_DATA_BASE64}" }
}
This is the EKS-specific version of the cluster-registration pattern in
gitops-multi-cluster-management
— same Secret-based registration mechanism, but the credential is a
short-lived STS token brokered by IRSA instead of a static bearer token.
argocd-repo-server (and any workload pulling private images) needs
ECR pull access without a static Docker config secret. IRSA-bind the
repo-server's ServiceAccount to a role with ecr:GetAuthorizationToken/
ecr:BatchGetImage, matching the workload-identity pattern in
managed-kubernetes-eks-aks-gke:
eksctl create iamserviceaccount \
--cluster payments-prod --namespace argocd \
--name argocd-repo-server --role-name argocd-repo-server-ecr-read \
--attach-policy-arn arn:aws:iam::<AWS_ACCOUNT_ID>:policy/EcrReadOnly \
--override-existing-serviceaccounts --approve
kubectl patch deployment argocd-repo-server -n argocd --type=json \
-p '[{"op":"add","path":"/spec/template/spec/serviceAccountName","value":"argocd-repo-server"}]'
Front the argocd-server Service with
ingress-nginx-configuration
and issue its certificate with
cert-manager-tls-automation
(DNS-01 via Route 53, backed by its own scoped IRSA role per that skill's
guidance) rather than a self-signed cert or a directly-exposed
LoadBalancer Service:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: argocd-server
namespace: argocd
annotations:
cert-manager.io/cluster-issuer: letsencrypt-dns
nginx.ingress.nginx.io/backend-protocol: "GRPC"
spec:
ingressClassName: nginx
tls:
- hosts: ["argocd.example.com"]
secretName: argocd-server-tls
rules:
- host: argocd.example.com
http:
paths:
- path: /
pathType: Prefix
backend: { service: { name: argocd-server, port: { number: 443 } } }
ApplicationWrite the first real Application following
argocd-application-configuration
in full — sync policy fields, sync waves/hooks, and custom health checks
are all covered there in depth:
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
argocd app wait payments-api-staging --health --timeout 300
ApplicationSet for multi-environment rolloutOnce the first Application works, replace hand-authored per-environment
manifests with an ApplicationSet per
argocd-applicationset-patterns
— a List generator for a small fixed set of environments, or a Cluster
generator (labeled tier: staging/tier: prod) if staging and prod are
separate EKS clusters rather than separate namespaces on one cluster, in
which case each cluster's registration reuses the IRSA/access-entry
pattern from Phase 2.
Per argocd-application-configuration:
manual sync for the initial rollout, automated (with prune/selfHeal)
only after the team trusts the pipeline; add custom Lua health checks for
any internal CRDs the workloads depend on before relying on Argo CD's
health status for alerting.
argocd cluster list
argocd app list
kubectl exec -n argocd deploy/argocd-repo-server -- aws sts get-caller-identity
The sts get-caller-identity from inside argocd-repo-server should show
the IRSA role's ARN, not an EC2 instance profile — confirming the pod is
actually using the federated identity, not silently falling back to node
credentials.
Application — an
Application created against a cluster secret with no working IAM
credential fails in a way that looks like a networking problem, not an
IAM one.aws-auth ConfigMap
for any cluster created on a current EKS version — access entries are
auditable via the EKS API and don't risk a ConfigMap edit locking out
cluster-admin.argocd-repo-server scoped to ecr:GetAuthorizationToken
plus GetDownloadUrlForLayer/BatchGetImage on the specific repositories
it needs — not registry-wide ecr:*, mirroring the least-privilege
guidance in cloud-iam-hardening.argocd-server directly via a public LoadBalancer Service
— always terminate through Ingress + cert-manager so TLS and access
logging are consistent with every other service on the cluster.automated per environment.Symptom: An iamserviceaccount is created and the ServiceAccount
shows the correct eks.amazonaws.com/role-arn annotation, but pods
using it still get AccessDenied from AWS.
Fix: This is almost always Phase 0 skipped or run after the
iamserviceaccount command — the IAM OIDC provider must be associated
with the cluster before eksctl create iamserviceaccount runs, or the
role's trust policy references an OIDC provider ARN that doesn't
actually exist yet. Re-run associate-iam-oidc-provider and recreate the
service account.
Symptom: A second EKS cluster is registered as an Argo CD destination
using the exec-based aws eks get-token credential, and argocd cluster list shows it as Unknown/unreachable even though the access entry was
created.
Fix: aws eks associate-access-policy was likely run with the wrong
--access-scope (namespace-scoped instead of cluster-scoped, or vice
versa relative to what the Applications targeting it need) — verify
with aws eks list-access-entries --cluster-name <spoke> and
describe-access-policy before assuming the exec plugin itself is
broken.
Symptom: The first Application was created with
automated: {prune: true, selfHeal: true} straight out of the gate
(skipping the manual-sync validation step in Phase 4), and a bad initial
manifest deleted an unrelated pre-existing resource in the target
namespace.
Fix: This is the ordering pitfall specific to end-to-end setup —
always run the first sync of a brand-new Application manually with
--dry-run first (Phase 4), and only add automated sync in a later,
deliberate step (Phase 6) once the manifest set is verified.
Symptom: argocd-repo-server can clone the Git repo fine but pulling
the application's own container image from ECR fails with
ImagePullBackOff even though the repo-server itself authenticates to
AWS correctly.
Fix: ECR pull auth for the workload's pods is a separate IRSA
binding from the repo-server's — the repo-server's IRSA role only
affects what Argo CD itself can read (Git, and optionally a Helm OCI
registry), not what the deployed workload's own ServiceAccount can pull
as its container image; bind IRSA to the workload's ServiceAccount
separately, per
managed-kubernetes-eks-aks-gke.
Scenario: Stand up Argo CD from scratch on an existing payments-prod
EKS cluster, register a second payments-staging EKS cluster as a
destination via IRSA/access entries, and roll payments-api out to both
environments via an ApplicationSet.
# Phase 0
eksctl utils associate-iam-oidc-provider --cluster payments-prod --approve
# Phase 1
helm install argocd argo/argo-cd -n argocd --create-namespace --version 7.6.12
# Phase 2 — cross-cluster IRSA + access entry
eksctl create iamserviceaccount --cluster payments-prod --namespace argocd \
--name argocd-application-controller --role-name argocd-eks-cross-cluster \
--attach-policy-arn arn:aws:iam::<AWS_ACCOUNT_ID>:policy/ArgoCDAssumeSpokeRole --approve
aws eks create-access-entry --cluster-name payments-staging \
--principal-arn arn:aws:iam::<AWS_ACCOUNT_ID>:role/argocd-eks-cross-cluster --type STANDARD
aws eks associate-access-policy --cluster-name payments-staging \
--principal-arn arn:aws:iam::<AWS_ACCOUNT_ID>:role/argocd-eks-cross-cluster \
--policy-arn arn:aws:eks::aws:cluster-access-policy/AmazonEKSEditPolicy --access-scope type=cluster
# Phase 3 — Ingress/TLS (see linked skills for full manifests)
kubectl apply -f argocd-server-ingress.yaml
# 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 the
manual rollout in Phase 4 is confirmed healthy, while prod stays manual
per the environment-specific policy guidance in
argocd-application-configuration.
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."
Other plugins' skills for the same job