API Reference

Auto-generated reference for every Magos custom resource. Do not edit by hand; regenerate with 'make generate-api-reference' in the website repo.

API Reference

Packages

magosproject.io/v1alpha1

Package v1alpha1 contains API Schema definitions for the v1alpha1 API group.

Resource Types

Project

Project is the Schema for the projects API

FieldDescriptionDefaultValidation
apiVersion stringmagosproject.io/v1alpha1
kind stringProject
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec ProjectSpecspec defines the desired state of ProjectRequired: {}

ProjectSpec

ProjectSpec defines the desired state of Project

FieldDescriptionDefaultValidation
description stringDescription provides a human-readable description of the project's purpose.Optional: {}
variableSetRef VariableSetReference arrayVariableSetRef references one or more VariableSets to be applied to all Workspaces within this Project.Optional: {}
validation ValidationSpecValidation is the default plan-time validation configuration applied to
Workspaces in this Project that do not define their own. A Workspace
with an explicit Validation fully overrides this default.
Optional: {}

ValidationSpec

ValidationSpec configures how Terraform plans are evaluated against Kyverno ValidatingPolicy resources before apply. The same shape is used on both Project (where it defines the default for member Workspaces) and Workspace (where it overrides the Project default).

FieldDescriptionDefaultValidation
policySelector LabelSelectorPolicySelector selects Kyverno ValidatingPolicy resources
(policies.kyverno.io) by label. When nil, no policy validation is
performed. An empty selector ({}) matches every ValidatingPolicy in
the cluster. On a Project this acts as the default for any Workspace
that does not set its own Validation; on a Workspace this fully
overrides the Project default.
Optional: {}

VariableSetReference

VariableSetReference references a VariableSet resource

FieldDescriptionDefaultValidation
name stringName of the VariableSet.MinLength: 1
Required: {}

Workspace

Workspace is the Schema for the workspaces API

FieldDescriptionDefaultValidation
apiVersion stringmagosproject.io/v1alpha1
kind stringWorkspace
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec WorkspaceSpecspec defines the desired state of WorkspaceRequired: {}

WorkspaceSpec

WorkspaceSpec defines the desired state of Workspace

FieldDescriptionDefaultValidation
projectRef ProjectReferenceProjectRef is a reference to the project this workspace belongs toRequired: {}
autoApply booleanAutoApply dictates whether the workspace should automatically apply after a successful plantrueOptional: {}
annotations object (keys:string, values:string)Annotations to propagate to both plan and apply Job pod templates.
Per-phase annotations in spec.plan or spec.apply take precedence on conflict.
Optional: {}
plan JobOverridesPlan holds overrides applied only to plan Jobs.Optional: {}
apply JobOverridesApply holds overrides applied only to apply Jobs.Optional: {}
source SourceSpecSource defines the Git repository configurationRequired: {}
terraform TerraformSpecTerraform defines the Terraform or OpenTofu configurationRequired: {}
validation ValidationSpecValidation configures plan-time policy validation for this Workspace.
When nil, the parent Project's Validation applies if set. When non-nil,
this fully overrides the Project default rather than merging with it.
Optional: {}
variableSetRef VariableSetReference arrayVariableSetRef references one or more VariableSets that contribute
Terraform input variables to this Workspace. They layer on top of the
VariableSets attached to the parent Project: Project sets are applied
first in declaration order, then Workspace sets, and within that
combined order a later set's variable shadows an earlier set's
variable of the same name. Values resolved from VariableSets are
exposed to terraform as TF_VAR_<name> environment variables on the
plan and apply pods, which means they take precedence over any
matching variable declared in spec.terraform.tfvarsPath (env beats
.tfvars in Terraform's precedence rules).
Optional: {}
serviceAccountName stringServiceAccountName is the ServiceAccount that plan and apply Job pods
run under. The ServiceAccount must exist in the same namespace as the
Workspace. Defaults to magos-job, which the Helm chart creates with
get;list;watch on validatingpolicies.policies.kyverno.io so the job can
fetch ValidatingPolicies at runtime. Override this to run pods under a
different identity, for example to bind a GKE Workload Identity or AWS
IRSA annotation; the replacement must carry the same RBAC.
magos-jobOptional: {}

ProjectReference

ProjectReference references a Project resource

FieldDescriptionDefaultValidation
name stringName of the Project.MinLength: 1
Required: {}

JobOverrides

JobOverrides holds per-phase configuration that is merged on top of the shared spec-level settings. Fields set here take precedence over the corresponding shared field.

FieldDescriptionDefaultValidation
annotations object (keys:string, values:string)Annotations to add to the Job's pod template. Merged on top of
spec.annotations; values here win on conflict.
Optional: {}
timeoutSeconds integerTimeoutSeconds sets the activeDeadlineSeconds on the Kubernetes Job.
If the Job does not finish within this duration, Kubernetes marks it
as Failed, preventing a Workspace from being stuck in Planning or
Applying indefinitely. When unset, DefaultJobTimeoutSeconds (86400) is
used.
Optional: {}

SourceSpec

SourceSpec defines the Git repository configuration

FieldDescriptionDefaultValidation
repoURL stringRepoURL is the URL of the Git repository to cloneRequired: {}
targetRevision stringTargetRevision defines the commit, tag, or branch to checkoutRequired: {}
path stringPath is the directory path within the Git repository.Optional: {}

TerraformSpec

TerraformSpec defines the Terraform or OpenTofu configuration

FieldDescriptionDefaultValidation
version stringVersion is the Terraform or OpenTofu version to useRequired: {}
tfvarsPath stringTfvarsPath is the path to the tfvars file within the repositoryOptional: {}

Rollout

Rollout is the Schema for the rollouts API

FieldDescriptionDefaultValidation
apiVersion stringmagosproject.io/v1alpha1
kind stringRollout
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec RolloutSpecspec defines the desired state of RolloutRequired: {}

RolloutSpec

RolloutSpec defines the desired state of Rollout

FieldDescriptionDefaultValidation
projectRef stringProjectRef is a reference to the project this rollout orchestratesRequired: {}
strategy RolloutStrategyStrategy defines the rollout execution planRequired: {}

RolloutStrategy

RolloutStrategy defines how the rollout should proceed

FieldDescriptionDefaultValidation
steps RolloutStep arraySteps defines the sequential stages of the rolloutRequired: {}

RolloutStep

RolloutStep defines a single step in a rollout strategy

FieldDescriptionDefaultValidation
name stringName of the stepRequired: {}
selector LabelSelectorSelector to match workspaces for this stepRequired: {}

VariableSet

VariableSet is the Schema for the variablesets API

FieldDescriptionDefaultValidation
apiVersion stringmagosproject.io/v1alpha1
kind stringVariableSet
metadata ObjectMetaRefer to Kubernetes API documentation for fields of metadata.Optional: {}
spec VariableSetSpecspec defines the desired state of VariableSetRequired: {}

VariableSetSpec

VariableSetSpec defines the desired state of VariableSet.

A VariableSet is a reusable bundle of Terraform input variables that is composed onto Workspaces by reference. Values can be literal strings or drawn from a Kubernetes Secret or ConfigMap in the same namespace. The workspace controller is what actually injects the resolved values into the plan and apply Job pods as TF_VAR_<name> environment variables; this controller is only responsible for validating references and surfacing their status.

FieldDescriptionDefaultValidation
description stringDescription is a human-readable purpose for this VariableSet. Optional
and not consumed by any controller; it exists so that operators can
document intent in the same place as the data.
Optional: {}
variables Variable arrayVariables is the ordered list of Terraform variables this set
contributes. Each entry becomes TF_VAR_<name> on the plan and apply
pods of any Workspace that references this set. Order is preserved on
the wire so that consumers can rely on a stable iteration order when
computing hashes, but ordering does not change semantics within a
single set: duplicate names are rejected.
MinItems: 1

Variable

Variable is a single Terraform input variable definition. Exactly one of Value or ValueFrom must be set; the CEL rule on the type enforces that so the API server rejects misconfigured objects before they ever reach the controller.

FieldDescriptionDefaultValidation
name stringName is the Terraform variable name. The workspace controller exposes
it on the pod as TF_VAR_<name>, so it must be a valid Terraform
identifier: letters, digits, and underscores, not starting with a
digit.
MaxLength: 253
MinLength: 1
Pattern: ^[a-zA-Z_][a-zA-Z0-9_]*$
Required: {}
value stringValue is an inline literal. Use this only for non-sensitive data
because the value is stored verbatim in the CR and is visible to
anyone with read access to VariableSets in the namespace. For
sensitive material use ValueFrom.SecretKeyRef instead: the
controller never writes the resolved value to the CR, status, or
logs, and the kubelet performs the actual read from the source
Secret at pod start.
Optional: {}
valueFrom VariableSourceValueFrom sources the variable's value from another resource in the
same namespace. Mutually exclusive with Value.
Optional: {}

VariableSource

VariableSource describes where a variable's value should be read from. Exactly one of SecretKeyRef or ConfigMapKeyRef must be set.

FieldDescriptionDefaultValidation
secretKeyRef KeySelectorSecretKeyRef reads the value from a key inside a Kubernetes Secret in
the same namespace as the VariableSet. The kubelet resolves the value
at pod startup time when the workspace controller wires it into the
plan or apply Job, so the controller process never holds the secret
bytes in memory.
Optional: {}
configMapKeyRef KeySelectorConfigMapKeyRef reads the value from a key inside a ConfigMap in the
same namespace. Useful for non-sensitive shared settings (region,
account IDs, feature flags) that you still want versioned alongside
your application configuration.
Optional: {}

KeySelector

KeySelector references a specific key inside a Secret or ConfigMap.

FieldDescriptionDefaultValidation
name stringName of the Secret or ConfigMap.MinLength: 1
Required: {}
key stringKey inside the resource's data map. Must be present on the source
object unless Optional is true.
MinLength: 1
Required: {}
optional booleanOptional, when true, treats a missing resource or missing key as a
no-op rather than an error. The variable is omitted from the pod
environment, and the missing reference is not reported in
VariableSetStatus.UnresolvedReferences. Useful for variables that are
only present in some environments (e.g. an optional staging-only
override).
Optional: {}