Kubernetes API-first
A conventional CI job requests commands to run now. An IaCStack is a persistent declaration of infrastructure intent. The operator reconciles it; the CRD defines its schema and Kubernetes stores spec and status. The controller is neither the IaC engine nor the state backend.
apiVersion: iacstack.io/v1alpha1
kind: IaCStack
metadata:
name: app-compute
namespace: platform-system
spec:
sourceRef:
repository: https://github.com/your-org/infrastructure.git
path: stacks/compute
version: v1.0.0
workflowRef:
name: governed
inputs:
instance_count: "3"
reconciliation:
driftCheckInterval: 24h
lifecycle:
deletionPolicy: Retain
This is illustrative: register the alias and supply a real repository, revision and inputs.
| API concept | Behavior |
|---|---|
| Desired state | Source, inputs, workflow and lifecycle in spec |
| Observed state | Status and conditions record attempts and results |
| Reconciliation | New intent, eligible retries and scheduled drift checks |
| Dependencies | Gate eligibility and suspension |
| Deletion | Retain by default; Destroy requests governed teardown |
A GitOps agent, authorized API client or portal can submit the same declaration. Kubernetes RBAC governs access to the resource, not cloud entitlements or backend ownership. The workflow owns source resolution, backend locking, credentials, plan, policy, apply and verification. The controller enforces one active attempt per stack, not one writer per backend across stacks. Drift scheduling does not imply automatic remediation.