/gitops-argo-skills:complete-gitops-argocd-deployment-on-prem-from-scratchfrom gitops-argo-skills
Walks through end-to-end Argo CD GitOps deployment on a self-managed Kubernetes cluster without cloud IAM — covers Helm install, RBAC cluster access with Vault short-lived credentials, private registry auth, MetalLB, Ingress with private-CA TLS, first Application, and ApplicationSet for multi-environment rollout.
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.
The EKS/AKS/GKE variants of this skill all solve the same problem the same
way: a cloud-native workload identity federation mechanism (IRSA, Azure AD
Workload Identity, GKE Workload Identity Federation) lets Argo CD's own
components authenticate without a long-lived static credential. On a
self-managed or bare-metal cluster that mechanism does not exist —
there is no cloud STS to federate against. This is the genuine mechanical
difference this skill exists to cover: cluster access has to fall back to
Kubernetes-native ServiceAccount tokens and RBAC, ideally made
short-lived via HashiCorp Vault's Kubernetes secrets engine rather than a
permanent bearer token; private registry authentication needs an
explicit imagePullSecret/credential-helper flow instead of an IRSA/
Workload-Identity-backed pull; and the Ingress/TLS layer needs a
bare-metal load balancer (MetalLB) and often an internal CA instead of a
cloud LB and public ACME issuance. Everything else — the Application
spec, ApplicationSet generators, sync policy — is identical to the cloud
variants and is not repeated here.
kubectl apply/helm upgrade deploys on
on-prem infrastructure onto a full GitOps flow, starting from zero.kubectl — bare-metal/VMware provisioning patterns are covered by
on-prem-infrastructure-patterns
and are not repeated here; this skill starts from "the cluster exists."helm ≥ 3.12, kubectl, and cluster-admin access to create
ServiceAccounts, ClusterRoles, and ClusterRoleBindings.LoadBalancer Service type to fall back on for
Ingress.kubectl get svc -A -o wide | grep LoadBalancer
On a fresh self-managed cluster this is normally empty — a Service of
type LoadBalancer stays <pending> forever without MetalLB (or an
equivalent) installed. Install MetalLB (Phase 3 depends on it) before
assuming any LoadBalancer-typed Service will ever get an external IP.
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
Identical to the cloud variants — the install itself has no cloud dependency.
There is no OIDC-federated STS token to lean on here, so cluster access for any additional destination cluster (a second physical site) falls back to Kubernetes-native credentials, scoped as narrowly as possible per gitops-multi-cluster-management:
# Applied ON the spoke (second on-prem) cluster
apiVersion: v1
kind: ServiceAccount
metadata:
name: argocd-manager
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: argocd-manager-role
rules:
- apiGroups: ["apps", "", "batch", "networking.k8s.io"]
resources: ["deployments", "services", "configmaps", "secrets", "jobs", "ingresses"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
# Scoped to the resource kinds this spoke's workloads actually use —
# not "*"/"*", since there is no cloud IAM boundary as a backstop.
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: argocd-manager-role-binding
subjects:
- kind: ServiceAccount
name: argocd-manager
namespace: kube-system
roleRef:
kind: ClusterRole
name: argocd-manager-role
apiGroup: rbac.authorization.k8s.io
The naive version of this uses the ServiceAccount's long-lived token
Secret directly in the hub's cluster registration Secret — functional,
but a permanent, non-rotating credential is exactly the failure mode
IRSA/Workload Identity exist to avoid on cloud. Where the operational
maturity to run Vault already exists, prefer short-lived, Vault-brokered
credentials instead: configure Vault's Kubernetes secrets engine (or a
scheduled rotation job) to periodically mint a fresh token for
argocd-manager and update the hub's cluster Secret via an External
Secrets Operator sync rather than a token that's valid forever:
vault write auth/kubernetes/config \
kubernetes_host="https://<spoke-api-server>:6443"
vault policy write argocd-manager-policy - <<EOF
path "kubernetes/creds/argocd-manager" { capabilities = ["read"] }
EOF
See
vault-operations-and-pki-engine-configuration
for standing up Vault's PKI/auth engines, and
sealed-secrets-and-external-secrets-operator
for the ExternalSecret that syncs the Vault-issued credential into the
hub's argocd-namespace cluster registration Secret.
Unlike the cloud variants (IRSA/Workload-Identity-backed registry pulls),
on-prem private registry access is an explicit imagePullSecret, since
there is no cloud IAM-to-registry federation:
kubectl create secret docker-registry harbor-pull-secret \
--docker-server=harbor.internal.example.com \
--docker-username=argocd-reader \
--docker-password="${HARBOR_ROBOT_TOKEN}" \
-n argocd
Prefer a Harbor robot account (scoped to pull-only on specific
projects) over a personal account's credentials, and source
HARBOR_ROBOT_TOKEN from Vault/secrets-management, never hardcoded.
For Ingress, install
metallb-bare-metal-load-balancer-configuration
first so ingress-nginx's own Service can actually get an external IP,
then front argocd-server with
ingress-nginx-configuration.
TLS is the other on-prem-specific divergence: with no publicly resolvable
DNS name for an ACME HTTP-01/DNS-01 challenge, issue from an internal CA
via cert-manager-tls-automation's
private-CA Issuer pattern (backed by Vault's PKI engine, if available)
instead of Let's Encrypt:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata: { name: internal-vault-ca }
spec:
vault:
server: https://vault.internal.example.com:8200
path: pki_int/sign/argocd
auth:
kubernetes:
role: cert-manager
mountPath: /v1/auth/kubernetes
ApplicationIdentical to the cloud variants — follow argocd-application-configuration in full:
kubectl apply -f payments-api-staging-application.yaml
argocd login argocd.internal.example.com --sso
argocd app sync payments-api-staging --dry-run
argocd app sync payments-api-staging
ApplicationSet for multi-environment/multi-site rolloutPer argocd-applicationset-patterns; if staging and prod are separate physical clusters/sites, use the Cluster generator filtered by label, with each site's registration reusing the ServiceAccount/RBAC (or Vault-brokered) pattern 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 get secret harbor-pull-secret -n argocd -o jsonpath='{.data.\.dockerconfigjson}' | base64 -d
kubectl get certificate -n argocd argocd-server-tls -o jsonpath='{.status.conditions}'
Confirm the Harbor pull secret's embedded token is still valid (robot
tokens can expire independently of the Kubernetes Secret they're stored
in) and that the internal-CA certificate shows Ready: True before
trusting the Ingress is actually serving valid TLS.
argocd-manager ClusterRole to the exact resource
kinds each spoke's workloads use — there is no cloud IAM boundary
backstopping an overly broad on-prem RBAC grant the way there might be
with a scoped IAM policy in the cloud variants.imagePullSecrets, never a personal admin account's credentials.LoadBalancer Service before installing ingress-nginx — debugging
"Ingress isn't reachable" is much harder once both layers are stacked
and unverified.ca/vault Issuer types) over
self-signed per-service certs for anything beyond a single throwaway
test — an internal CA's trust bundle can be distributed once to clients,
where self-signed certs require per-service trust exceptions.Symptom: ingress-nginx's own Service stays <pending> forever with
no external IP, and every Ingress behind it is unreachable.
Fix: This is expected without MetalLB (or an equivalent bare-metal
LB) installed and configured with an IP address pool — install
metallb-bare-metal-load-balancer-configuration
and confirm a plain test LoadBalancer Service gets an IP before
troubleshooting Ingress routing itself.
Symptom: The cross-cluster argocd-manager ServiceAccount token was
copied once at spoke-registration time and, months later, cluster access
from the hub silently fails after a spoke cluster's token-rotation
policy (e.g. --service-account-max-token-expiration) invalidated it.
Fix: A raw ServiceAccount token Secret does not auto-renew on
clusters configured with bounded token lifetimes — either re-mint and
update the hub's cluster Secret manually on a schedule, or migrate to
the Vault-brokered rotation pattern in Phase 2 so renewal is automatic.
Symptom: A Harbor imagePullSecret worked at initial setup and later
every pod pull starts failing with unauthorized across the whole
cluster simultaneously.
Fix: Harbor robot account tokens have their own expiration
independent of the Kubernetes Secret storing them — check the robot
account's expiry in Harbor directly (docker login manually against the
registry with the same credential to confirm), not just the Secret's
presence in the cluster.
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 the cloud variants —
always run the first sync manually with --dry-run (Phase 4) before
enabling automated in a later, deliberate step (Phase 6).
Symptom: cert-manager's internal-CA ClusterIssuer (Vault-backed)
issues certificates that browsers/clients reject as untrusted, even
though kubectl describe certificate shows Ready: True.
Fix: Ready: True only confirms cert-manager successfully obtained
a certificate from the configured issuer — it says nothing about
whether clients trust that issuer's root. Distribute the internal CA's
root certificate to client trust stores (or your org's device management
baseline) separately; this is expected behavior for an internal CA, not
a cert-manager misconfiguration.
Scenario: Stand up Argo CD from scratch on a self-managed payments-prod
kubeadm cluster with no cloud provider, using Harbor for private images,
Vault for both PKI and Argo CD's own cross-cluster credential rotation,
and MetalLB + Ingress for external access.
# Phase 0/3 — MetalLB first
helm install metallb metallb/metallb -n metallb-system --create-namespace
kubectl apply -f metallb-ip-pool.yaml
# Phase 1
helm install argocd argo/argo-cd -n argocd --create-namespace --version 7.6.12
# Phase 2 — spoke ServiceAccount + RBAC (applied on payments-staging)
kubectl apply -f argocd-manager-rbac.yaml --context payments-staging
# Phase 3 — Harbor pull secret + internal-CA Ingress
kubectl create secret docker-registry harbor-pull-secret \
--docker-server=harbor.internal.example.com \
--docker-username=argocd-reader --docker-password="${HARBOR_ROBOT_TOKEN}" -n argocd
kubectl apply -f argocd-server-ingress-internal-ca.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 on-prem
clusters (full YAML in
argocd-applicationset-patterns),
and Phase 6 promotes staging's sync policy to automated once verified —
identical decision structure to the cloud variants, just built on
ServiceAccount/RBAC and Vault-issued credentials instead of IRSA/Workload
Identity.
Application spec used in Phase 4/6.Issuer pattern used instead of public ACME issuance.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