NovaDeploy Platform: GitOps Administration Guide – Portfolio Cut¶
Deploying Services to Amazon EKS with Argo CD
Version 1.0 | Status: Portfolio cut | Written by: Jeff Slavin
This portfolio overview shows how to deploy services, safely refresh secrets such as passwords, and recover from failed releases.
Portfolio Notice
NovaDeploy is a fictional portfolio platform. This sample contains no proprietary employer, client, or production information.
Scope and Audience
Scope: A fictional production service on Amazon Elastic Kubernetes Service (EKS), using Argo CD, Terraform, AWS Identity and Access Management (IAM), AWS Key Management Service (KMS), External Secrets Operator (ESO), and Reloader.
Audience: Platform engineers, DevOps/SRE practitioners, engineering managers, and technical writing reviewers.
1. At-a-Glance Deployment Path¶
Stop Checkpoints
Stop if:
- Controllers are unhealthy.
- CI fails.
- A workload using secrets lacks the Reloader annotation on root metadata.
- An ExternalSecret is not Ready.
- Argo CD is not Synced / Healthy.
- A check requires printing a secret value.
| Step | Operator Action | Evidence |
|---|---|---|
| 1 | Check local tools and controller health. | Tool versions; Argo CD, ESO, and Reloader Running/Ready |
| 2 | Update configuration in Git and Terraform-managed cloud metadata, including IAM/KMS; open a pull request (PR). | PR diff contains no plaintext secrets |
| 3 | Pass CI (automated checks) and platform review. | lint, helm template, kubeconform, secret scan, Reloader guardrail |
| 4 | Merge to protected main; sync manually or automatically. | argocd app get shows Synced / Healthy |
| 5 | Verify release and secrets without exposing values. | rollout status, ExternalSecret Ready=True, key names present, secret-mounted |
| 6 | Close or roll back. | Closed ticket with final health evidence, or revert PR, approval, and health evidence after rollback |
2. Decision Walkthrough: API Gateway Secret Refresh¶
| Stage | Evidence Snapshot | What It Proves |
|---|---|---|
| PR opened | PR #1842 diff includes the chart, production values, ExternalSecret, root Reloader annotation, and nova/api-gateway/db reference; secret scan reports no plaintext values. |
The change is Git-tracked and safe to inspect. |
| CI completed | lint, helm template, kubeconform, secret scan, and Reloader guardrail pass. |
Required restart control is in place before merge. |
| Argo CD before sync | api-gateway is Synced / Healthy at commit 7c4e91a. |
The starting state is stable. |
| Argo CD after sync | api-gateway syncs to 9f28b6c and returns Synced / Healthy. |
The cluster matches the merged Git configuration. |
| ExternalSecret verified | Ready=True and SecretSynced. |
ESO created or updated the Kubernetes Secret object. |
| Secret checked safely | Secret exists; key-name output shows DATABASE_PASSWORD. |
Expected keys are present, and no values were printed or decoded. |
| Reloader rollout confirmed | Rollout succeeds; pods are newer than the Secret data change; last-reloaded annotation is present. | The data change triggered a controlled rolling restart, not manual pod deletion. |
| Rollback decision | No rollback: Argo CD is Healthy, ExternalSecret is Ready, mount prints only secret-mounted, and smoke tests pass. |
Git remains authoritative. Failed checks trigger Git revert; Argo CD history rollback requires an approved emergency. |
3. Core Guardrails¶
Apply these controls throughout deployment, verification, and recovery. See the full runbook for commands, Terraform examples, and emergency procedures.
| Control | Rule | Why It Matters |
|---|---|---|
| GitOps source of truth | main is protected; changes require a PR and passing CI. |
Argo CD can restore the Git configuration and preserve an audit trail. |
| Terraform source of truth | IAM, KMS, Secrets Manager metadata, rotation config, and Lambda permissions stay in Terraform. | Cloud permissions remain reviewable, reproducible, and importable after break-glass work. |
| No plaintext secrets | Secret values never enter Git, Terraform state, PRs, CI logs, tickets, or chats. | Reviewers can validate controls without exposing credentials. |
| Separate IAM roles for service accounts (IRSA) | The workload role never reads Secrets Manager; the dedicated ESO reader role is limited to nova/<service>/*. |
Application pods do not receive broad secret-read permissions. |
| Reloader safety | Workloads using secrets carry reloader.stakater.com/auto: "true" on root workload metadata. |
Secret data changes trigger controlled rolling restarts. |
| Argo CD compatibility | The Application defines ignoreDifferences for the reloader.stakater.com/last-reloaded-from annotation and sets RespectIgnoreDifferences=true. |
Argo CD does not undo Reloader restart patches during sync. |
| Rotation gate | Keep var.rotation_enabled=false until KMS, Lambda, ESO, Reloader, and mount checks pass. |
Rotation is enabled only when workloads can safely use refreshed secrets. |
4. Architecture Overview¶
Git defines the intended cluster configuration; Terraform defines cloud control-plane resources.
Accessible Diagram Summary
The diagram shows GitOps deployment, Terraform cloud controls, and secret refresh. Reviewed changes pass CI, merge to protected main, and reach Amazon EKS through Argo CD. Terraform defines IAM, KMS, Secrets Manager metadata, rotation configuration, and the approved AWS secret path.
Amazon EKS hosts ESO, Reloader, other controllers, and application pods. Only ESO reads Secrets Manager, through a dedicated IRSA role limited to nova/<service>/*. Application pods have no Secrets Manager read access.
ESO syncs the approved value into a Kubernetes Secret. Reloader detects the change and patches workload pod template metadata, triggering a rolling restart by the workload controller.
5. Repository and Sync Policy¶
nova-gitops/
apps/ # Argo CD Application manifests
clusters/production/ # AppProject, root app, namespaces, policy baseline
charts/<service>/ # Service Helm chart
envs/production/values/ # Production value overrides
secrets/external/ # ExternalSecret CRs only; no plaintext secrets
infra/iam/<service>.tf # IAM, KMS, Secrets Manager metadata, rotation config
scripts/check-reloader-annotations.sh
.github/workflows/ # lint, render, kubeconform, secret scan, guardrails
Argo CD watches protected main; when automated sync is allowed, self-heal reverts managed-resource drift to Git state. Sync windows block routine syncs outside approved times. During an approved incident, an operator can enable a manual-sync override, which permits manual syncs only.
The cluster baseline pre-creates production namespaces; service Applications do not rely on CreateNamespace=true.
Auto-Prune Boundary
Automatic pruning deletes resources removed from Git. Each deletion requires a PR that shows the removal, passes CI, receives platform approval, and is merged into protected main.
Enable prune: true only when the production AppProject and sync windows constrain the Application. Otherwise, a bad merge, wrong path, or unauthorized destination can trigger automatic deletion.
Set ignoreDifferences and RespectIgnoreDifferences=true to ignore the Reloader-managed field during Argo CD comparison and sync.
# Excerpt from Application.spec.
# Required surrounding control: this Application belongs to the restricted
# production AppProject, which limits source repos, destinations, resource
# kinds, and sync windows.
project: novadeploy-production
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/template/metadata/annotations/reloader.stakater.com~1last-reloaded-from
- group: apps
kind: StatefulSet
jsonPointers:
- /spec/template/metadata/annotations/reloader.stakater.com~1last-reloaded-from
- group: apps
kind: DaemonSet
jsonPointers:
- /spec/template/metadata/annotations/reloader.stakater.com~1last-reloaded-from
syncPolicy:
automated:
prune: true
selfHeal: true # Reverts manual drift back to reviewed Git state.
syncOptions:
- ServerSideApply=true
- RespectIgnoreDifferences=true
6. Verification Pattern¶
After every sync, run the checks below. Never decode, print, or paste secret values. Keep them out of tickets.
argocd app get <app-name> --refresh
argocd app wait <app-name> --sync --health
kubectl rollout status deployment/<service> -n <namespace>
kubectl get externalsecret <service>-app-secrets -n <namespace>
kubectl describe externalsecret <service>-app-secrets -n <namespace>
kubectl get secret <service>-app-secrets -n <namespace>
kubectl get secret <service>-app-secrets -n <namespace> \
-o go-template='{{range $k, $_ := .data}}{{printf "%s\n" $k}}{{end}}'
# Expected: ExternalSecret Ready=True and expected key names are present.
# Never print or decode values.
For the disposable mount-check pod and Reloader confirmation commands, see Sections 8.2 and 8.3 of the full runbook.
| Check | Pass Criteria | Forbidden Evidence |
|---|---|---|
| Argo CD state | Synced / Healthy | None |
| ExternalSecret | Ready=True and SecretSynced reason | Secret value output |
| Kubernetes Secret | Object exists; expected key names are present | Decoded data or base64 payload |
| Mount check | Disposable pod prints only secret-mounted |
cat/print of mounted file content |
| Reloader rollout | Pods recreated after a Secret data change; app remains healthy | Secret payload in logs, tickets, or screenshots |
7. Implementation Excerpt: CI Reloader Guardrail¶
The Python core below checks rendered workloads for secret use and fails CI if the root Reloader annotation is missing. Pass the rendered YAML file as its first argument.
import sys, yaml
WORKLOADS = {"Deployment", "StatefulSet", "DaemonSet"}
SECRET_KEYS = {"secretKeyRef", "secretRef", "secretName", "secret"} # "secret": projected volume sources
def uses_secret(node):
if isinstance(node, dict):
return bool(SECRET_KEYS & node.keys()) or any(uses_secret(v) for v in node.values())
if isinstance(node, list):
return any(uses_secret(v) for v in node)
return False
missing = []
with open(sys.argv[1], encoding="utf-8") as rendered:
for obj in yaml.safe_load_all(rendered):
if not isinstance(obj, dict) or obj.get("kind") not in WORKLOADS:
continue
meta = obj.get("metadata") or {}
pod = obj.get("spec", {}).get("template", {}).get("spec", {})
annotations = meta.get("annotations") or {}
if uses_secret(pod) and annotations.get("reloader.stakater.com/auto") != "true":
missing.append(f'{obj["kind"]}/{meta.get("name", "<unknown>")}')
if missing:
print('ERROR: secret-consuming workloads missing reloader.stakater.com/auto="true":', file=sys.stderr)
print("\n".join(f" - {item}" for item in missing), file=sys.stderr)
sys.exit(1)
To render with Helm and run the check, use the complete CI script. The check verifies annotations, not actual restarts or the full secret lifecycle.
See the ServiceAccount, SecretStore, IAM, and KMS examples and rotation readiness gate for setup and runtime checks.
8. Rollback Matrix¶
Rollback Principle
Default to Git revert to keep Git authoritative and preserve an audit trail. Reserve Argo CD history rollback for approved emergencies (break-glass), followed by Git revert within 24 hours.
| Scenario | Strategy | Operator Note |
|---|---|---|
| Bad image tag promoted | Git revert | Revert the image-bump commit, pass CI, merge, then sync or wait for automation. |
| Wrong Helm values or Application manifest | Git revert | Revert the configuration change. |
| Application unreachable and service-level agreement (SLA) at risk | Argo CD history rollback | Use only if Argo CD and the Kubernetes API are reachable and Git revert cannot meet the SLA. Follow the break-glass sequence below. |
| GitHub or CI outage blocks revert | Argo CD history rollback | Restore the last-good revision while GitHub or CI is unavailable; record non-secret evidence. Follow the break-glass sequence below. |
| Secret value misconfiguration | Secrets Manager rollback + ESO re-sync | Roll back through the approved secret process. Use Git revert only for SecretStore, ExternalSecret, IAM, KMS, or rotation-config changes. |
| Cluster unreachable | Infrastructure troubleshooting | Do not use Argo CD. Troubleshoot the EKS control plane, networking, IAM, and node health first. |
During a GitHub outage, add --validate=false to the argocd app set commands in steps 2 and 3 below so Argo CD accepts changes without repository access. Rollback requires the last-good revision in Argo CD's manifest cache or local repository copy; a history entry alone is not enough.
History rollback leaves resources added by the bad commit until the Git revert syncs. If any cause the incident, follow the review and --prune steps in Section 9.2 of the full runbook.
For Argo CD history rollback:
-
Record the root and target Applications' current sync-policy settings in the incident ticket.
-
Suspend the App-of-Apps root app with
argocd app set <root-app-name> --sync-policy none. -
Disable auto-sync on the target Application with
argocd app set <app-name> --sync-policy none. -
Outside approved sync times, enable the incident-approved manual-sync override first: find the allow window ID with
argocd proj windows list <project>, then runargocd proj windows enable-manual-sync <project> <allow-window-id>. -
Find the last-good revision with
argocd app history <app-name>, roll back withargocd app rollback <app-name> <history-id>, and wait for health withargocd app wait <app-name> --health. Then disable the override withargocd proj windows disable-manual-sync <project> <allow-window-id>. -
Keep both suspended until the matching Git revert merges, then restore their prior sync policies.
The argocd app get and argocd app set commands for steps 1 and 6 are in Section 9.2 of the full runbook.