18

Separate Infrastructure State from Workload State

Diagnose and reconcile four desired-state owners instead of trusting one magical “declarative” status.

System map · Day 18

Whole-system design

Five stable layers. Today's work is expanded and linked; the rest stays in context.

Product and authority

Covered — People and product entry points · Identity and policy · HelixWorks control plane · Generated application plane

Delivery and desired state

Covered — Git desired state · CI and immutable artifacts

Argo CD reconciliation

Source-backed today

Compares the development Git source with workload objects without creating the underlying VPC or EKS cluster.

Cloud and orchestration

Covered — Accounts, VPC, DNS, and private paths · Kubernetes or EKS control plane

Terraform and AWS APIs

Source-backed today

Owns cloud resource lifecycles without also reconciling Kubernetes workload objects.

Compute and traffic

Covered — Worker compute · Platform service workloads · Generated app workloadsAhead — Ambient mesh data plane

Storage and evidence

Covered — Product data and artifacts · Evidence and observability

Infrastructure state

Source-backed today

Records cloud resource identities and locks independently from Kubernetes API state.

Cluster desired and live state

Source-backed today

Records workload desired state, controller status, and events independently from Terraform state.

The enterprise problem and today’s slice

Enterprise problem: HelixWorks can report a synced workload while its cluster API or AWS substrate is unavailable, and two tools that both mutate one resource can fight forever or destroy the wrong layer. Whole-course context: The incoming evidence is a deterministic Kubernetes render with one Git owner; today places that workload inside the larger infrastructure chain. Today’s slice: We separate Infrastructure as Code (IaC) configuration and state, managed-cluster lifecycle, Kubernetes reconciliation, and GitOps workload ownership from local through production. End-of-day evidence: An ownership matrix and bounded dev failure show substrate existence, intended API reachability, IaC state agreement, Kubernetes convergence, Git revision, customer response, unaffected control, environment, time, run, and trace IDs independently. Still unsolved: Terraform’s concrete plan and state mechanics and AWS account implementation remain deferred.

Customer outcome and implementation focus

The customer outcome is a reviewable separate infrastructure state from workload state change, not a collection of requirements. This day starts with the implementation boundary, then uses the command or manifest below to produce positive, denied, and recovery evidence.

Components in focus

Terraform/IaC engine and provider API, Kubernetes API/controllers, and Argo CD; cloud VMs/network plus cluster workloads; Terraform state backend, Git, and Kubernetes etcd; cache: not involved.

This map names the implementation boundary for this day. The service or controller changes only the state it owns; runtime and audit evidence let the operator distinguish a declared change from an effective one.

Separate infrastructure state from workload state

Compare the same layers across environments

Local Kubernetes preserves control-loop behavior but collapses machine, disk, network, and power failure domains onto one laptop, so it is not production high-availability evidence. Dev, staging, and production use separate AWS accounts and clusters while promoting the same artifact and packaging model.

LayerLocalDev, staging, and production on AWSInvariant question
HardwareOne laptop, even with several Kind nodesProvider capacity across selected Availability ZonesWhere do CPU, memory, disk, network, and power failure domains come from?
Host/runtimeDocker containers acting as nodesEKS worker compute and container runtimeWho patches and replaces hosts?
OrchestratorKind Kubernetes API and controllersManaged EKS control plane and Kubernetes controllersWhich API holds desired workload state?
DeliveryLocal GitOps controllerPer-environment Argo CDWhich Git revision and identity may reconcile?
ApplicationSame immutable HelixWorks artifactSame digest promoted through accountsWhat customer evidence proves equivalent behavior?

Run a read-only ownership check

Diagnosis must observe before mutation because state surgery can erase the record needed for recovery. These commands compare independent owners in one named environment.

: "${AWS_PROFILE:?set the approved AWS profile}" "${AWS_REGION:?set the intended AWS region}" "${EXPECTED_ACCOUNT_ID:?set the intended 12-digit AWS account}"
actual_account="$(aws --profile "$AWS_PROFILE" --region "$AWS_REGION" sts get-caller-identity --query Account --output text)"
[ "$actual_account" = "$EXPECTED_ACCOUNT_ID" ] || { echo "AWS account mismatch" >&2; exit 1; }
terraform -chdir=infra/stacks/dev state list
aws --profile "$AWS_PROFILE" --region "$AWS_REGION" eks update-kubeconfig --name helixworks-forge-dev --alias helixworks-forge-dev
aws --profile "$AWS_PROFILE" --region "$AWS_REGION" eks describe-cluster --name helixworks-forge-dev --query 'cluster.status'
kubectl --context helixworks-forge-dev get nodes
kubectl --context helixworks-forge-dev -n argocd get application forge-dev -o wide
test -n "${FORGE_URL:?set FORGE_URL to a reachable dev control-plane URL}"
FORGE_URL="$FORGE_URL" FORGE_TOKEN="${FORGE_TOKEN:?set the explicit bearer token}" ./scripts/smoke-product.sh

These exact paths and names come from infra/stacks/dev, infra/modules/environment, argocd/applicationsets/forge-dev.yaml, and scripts/smoke-product.sh. Because the EKS API is private-only, run aws --profile "$AWS_PROFILE" --region "$AWS_REGION" eks update-kubeconfig and every kubectl command from within the VPC or a connected network, as required by the Amazon EKS private-endpoint documentation.

Key takeaways

One delivery system contains several desired-state owners, and none provides universal truth.

  • Diagnose substrate, intended API, IaC mapping, Kubernetes, GitOps, then customer path.
  • Give every resource one writer and one deletion owner.
  • Local multi-node reconciliation is useful but does not prove independent failure domains.

Checklist

The ownership model is safe when every repair has one direction.

  • [ ] Infrastructure and workload resources have non-overlapping writers
  • [ ] Environment inventory names account, cluster, network, identity, state, Git, secrets, backup, and deletion owners
  • [ ] Read-only observations precede any repair or state surgery
  • [ ] Recovery includes affected and unaffected customer evidence