-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
What would you like to be added (User Story)?
As a platform engineer using GitOps tools (ArgoCD, Flux) with automated dependency management (Renovate, Dependabot), I want to deploy Cluster API components directly from GitHub releases without requiring clusterctl or preprocessing, so that I can maintain declarative infrastructure with automatic version updates.
Detailed Description
Currently, release artifacts contain bash-style variable substitutions (e.g., ${CAPI_DIAGNOSTICS_ADDRESS:=:8443}) in container args that are intended for clusterctl processing. When these manifests are applied directly via GitOps tools, the variables are passed as literal strings, causing controller startup failures:
invalid argument "${CAPI_INSECURE_DIAGNOSTICS:=false}" for "--insecure-diagnostics" flag: strconv.ParseBool: parsing "${CAPI_INSECURE_DIAGNOSTICS:=false}": invalid syntax
Affected files:
core-components.yaml-capi-controller-managerdeploymentcontrol-plane-components.yaml-capi-kubeadm-control-plane-controller-managerdeploymentbootstrap-components.yaml-capi-kubeadm-bootstrap-controller-managerdeployment
Reproduction:
- Create ArgoCD Application pointing to
https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.12.0/core-components.yaml - Deploy the application
- Controller manager crashes with variable parsing errors
Current workarounds and their limitations:
clusterctl generate provider- Requires local execution and committing output, breaking automated dependency updates- Kustomize patches - Maintenance burden, must be updated when new variables are added
- Custom ArgoCD plugin with
envsubst- Treats symptom, adds complexity - capi-operator - Overkill for basic single-provider deployments where ArgoCD's reconciliation is sufficient
Proposed solutions:
-
Provide additional release artifacts with pre-substituted variables (e.g.,
core-components-gitops.yamlorcore-components-defaults.yaml)- Least disruptive: existing
clusterctlworkflows continue unchanged - GitOps users get directly consumable artifacts
- Enables automated dependency tracking via Renovate/Dependabot
- Least disruptive: existing
-
Use Kubernetes environment variables
- Define args using standard Kubernetes env var syntax:
--diagnostics-address=$(CAPI_DIAGNOSTICS_ADDRESS) - Set default values in container's
envsection - Allows customization through standard Kustomize patches that both
clusterctland GitOps tools support - Strategic merge patches can target env vars by name without needing array indices
- Kubernetes-native pattern
- Define args using standard Kubernetes env var syntax:
-
Use ConfigMap-based configuration
- Move configuration from command-line args to ConfigMaps
- Allows customization through standard Kustomize patches that both
clusterctland GitOps tools support - Kubernetes-native pattern
-
Provide official Kustomize bases
- Structure releases as Kustomize bases referenceable via URL:
https://github.com/kubernetes-sigs/cluster-api//config/default?ref=v1.12.0 - Users reference in their
kustomization.yamland apply patches as needed - Similar to Kubebuilder project structure
- Structure releases as Kustomize bases referenceable via URL:
Anything else you would like to add?
The current design assumes clusterctl as the primary installation method, which conflicts with modern GitOps practices. Many organizations use tools like Renovate to automatically track GitHub releases and create PRs for dependency updates. This workflow is impossible when manifests require preprocessing.
While capi-operator exists, it introduces significant complexity for simple use cases (single provider, static configuration) where ArgoCD's built-in reconciliation is sufficient. The operator shouldn't be required just to work around variable substitution in static manifests.
Related documentation:
- https://cluster-api.sigs.k8s.io/clusterctl/commands/generate-provider
- https://cluster-api.sigs.k8s.io/developer/providers/contracts/clusterctl
- https://cluster-api.sigs.k8s.io/tasks/workload-bootstrap-gitops (covers workload clusters, not CAPI installation)
Label(s) to be applied
/kind feature
/area clusterctl
/area provider/core
/area provider/bootstrap-kubeadm
/area provider/control-plane-kubeadm