Argo Workflows
Configure the workflow that plans, reviews, and applies stack changes.
An IaCStack is a Kubernetes API resource that describes infrastructure intent. The controller watches the declaration, determines when an execution can start, and tracks its result. Argo Workflows runs the selected pipeline.
Declares what to run, the inputs, and the workflow alias.
spec:
workflowRef:
name: manual-aws-sg
inputs:
vpc_id: vpc-…Watches the stack, looks up its alias, and creates a Workflow from the registered template.
Runs the recipe. Your WorkflowTemplate defines the stages, commands, pauses, and outputs.
Uses the image and ServiceAccount chosen for the workflow to run the tools and report outputs.
Argo exposes the runner’s outputs. The controller watches the Workflow and updates the stack’s status.
Reject ends the run without Apply.
Watch the demo on the homepage . The video player and GIF are in the same section.
A WorkflowTemplate is the reusable recipe. A Workflow is one run of that recipe in Argo. The pipeline is the recipe’s sequence of stages and the scripts and tools you choose. Add security checks, use your own runner image, or run without a pause.
This is the setup order used by the Kind quickstart. You can prepare the runner and its template earlier. The prerequisite is that the controller, alias, template, and runner identity are all in place before you apply the first stack.
Have Kubernetes and Argo Workflows running. Argo must watch the namespace that will receive the Workflows. In the lab it is argo-workflows. GitOps delivery is optional; there is no Argo CD or cloud prerequisite for this lab.
Install IaC Stack Controller and register the alias. Its Helm chart installs the controller, the IaCStack CRD and its permissions. In the values, a workflow registration ties an alias to an Argo namespace, template, runner identity, and parameter mapping. Here is the registration from the direct lab:
workflows:
- name: direct
namespace: argo-workflows
templateRef:
name: iacstack-quickstart-direct
serviceAccountName: iacstack-quickstart
contract:
authorization: false
parameters:
input:
intent: intent
output:
resolvedSource: resolved-source
result: execution-result
The alias direct is what the stack selects. The output mapping tells the controller which global Argo parameters contain the resolved source and the functional result. This isolated example has no technical authorization or human approval.
One installation can register multiple aliases in the same workflows list. For example, one stack selects direct in spec.workflowRef.name and another selects governed. Each alias can have its own template, ServiceAccount, and contract. If a stack omits the alias, the controller uses the configured defaultWorkflow. See the three aliases in the EKS labs.
Apply the workflow bundle. It contains the runner’s Kubernetes ServiceAccount and its permissions, the script ConfigMap and the WorkflowTemplate. The ServiceAccount lets the pod report task results and access the target and state backend. The template defines an entrypoint, accepts the JSON intent, sets the runner image and calls the mounted validate-plan-apply.sh. It exposes the files the runner writes as the two mapped outputs. Put your own scripts and tools here, not in the controller.
See the complete WorkflowTemplate and alias example · Run the lab step by step
This is the manifest used in Get started. It creates a ConfigMap with a small OpenTofu module.
apiVersion: iacstack.io/v1alpha1
kind: IaCStack
metadata:
name: hello-stack
namespace: platform-system
spec:
sourceRef:
repository: https://github.com/iacstack/iac-stack-controller.git
path: website/static/examples/quickstart/module
version: main
workflowRef:
name: direct
inputs:
message: Hello from IaCStack
lifecycle:
deletionPolicy: Retain
sourceRef identifies the module and revision. In this lab, the workflow resolves main to a specific commit before execution.workflowRef.name selects an alias registered by the operator. Here, direct points to the direct-apply WorkflowTemplate.inputs supplies the values the workflow passes to the module. In this case, message becomes the ConfigMap content.lifecycle.deletionPolicy determines what happens when deleting the stack. Retain preserves the managed resource. Destroy requests a teardown execution.The same manifest can be applied with kubectl or delivered through GitOps. API reference
intent.iacstack intent read to validate and read the intent, resolves the module to a commit, and runs OpenTofu validate, plan and apply when there is a change.iacstack to write the contract files. Argo publishes them as resolved-source and execution-result; the controller watches the Workflow and updates the stack’s status. The CLI is a ready-made way to speak the contract; you can use a different runner or implement the same contract yourself.Execution contract · CLI reference · Argo integration
Start with the Kubernetes status. The status.execution.workflow field identifies the execution in Argo.
kubectl -n platform-system describe iacstack hello-stack
kubectl -n platform-system get iacstack hello-stack -o jsonpath='{.status.execution.workflow}'
kubectl -n argo-workflows get workflow -l iacstack.io/stack-name=hello-stack
A Ready result indicates a completed execution for that intent. Its reason distinguishes Verified, when the workflow applied and verified a change, from NoChanges, when the plan confirmed the existing state. For native manual approval, open the corresponding node in Argo to review the plan. If an attempt fails or is blocked, compare the stack condition with the workflow result and logs.
In the lab, changing spec.inputs.message starts a new attempt and updates the ConfigMap. In a governed environment, a stack can also depend on another stack, schedule drift checks, and choose its deletion policy. For example, with a registered governed alias:
spec:
workflowRef:
name: governed
dependsOn:
- name: network
reconciliation:
driftCheckInterval: 24h
lifecycle:
deletionPolicy: Retain
This snippet is part of a stack. The workflow implements the check and reports the result to the controller. The interval schedules the attempt. The workflow policy determines whether detected drift needs review or can be corrected automatically. Try drift without AWS in the Kind labs. To see governance for AWS resources, follow the OPA lab on EKS.
Architecture and responsibilities · Operations
Configure the workflow that plans, reviews, and applies stack changes.