Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Feature Gates

The following tables are a summary of the feature gates that are available in Cluster API.

Feature gateMaturity levelNote
ClusterClassInlineTemplatesAlphaenv var: EXP_CLUSTERCLASS_INLINE_TEMPLATES
See this ClusterClass with inline templates.
Important!: This feature gate should only be enabled if there are no more clients in the environment that are using the v1beta1 ClusterClass API.
ClusterTopologyAlphaenv var: CLUSTER_TOPOLOGY
See ClusterClass.
InPlaceUpdatesAlphaenv var: EXP_IN_PLACE_UPDATES
See proposal.
Important!: Also requires RuntimeSDK.
KubeadmBootstrapFormatIgnitionAlphaenv var: EXP_KUBEADM_BOOTSTRAP_FORMAT_IGNITION
See Ignition.
MachinePoolBetaenv var: EXP_MACHINE_POOL
See MachinePools.
MachineSetPreflightChecksBetaenv var: EXP_MACHINE_SET_PREFLIGHT_CHECKS
See MachineSetPreflightChecks.
MachineTaintPropagationAlphaenv var: EXP_MACHINE_TAINT_PROPAGATION
See Taint propagation.
PriorityQueueGAenv var: EXP_PRIORITY_QUEUE
See issue.
ReconcilerRateLimitingGAenv var: EXP_RECONCILER_RATE_LIMITING
See issue.
Important!: starting from CAPI v1.12.4 ReconcilerRateLimiting also requires PriorityQueue.
RuntimeSDKAlphaenv var: EXP_RUNTIME_SDK
See Runtime extensions.

Enabling Feature Gates for Management Clusters Started with clusterctl

Users can enable/disable features gates by setting OS environment variables before running clusterctl init, e.g.:

export EXP_SOME_FEATURE_NAME=true

clusterctl init --infrastructure vsphere

As an alternative to environment variables, it is also possible to set variables in the clusterctl config file located at $XDG_CONFIG_HOME/cluster-api/clusterctl.yaml, e.g.:

# Values for environment variable substitution
EXP_SOME_FEATURE_NAME: "true"

In case a variable is defined in both the config file and as an OS environment variable, the environment variable takes precedence. For more information on how to set variables for clusterctl, see clusterctl Configuration File

Some features like MachinePools may require infrastructure providers to implement a separate CRD that handles the infrastructure side of the feature too. For such a feature to work, infrastructure providers should also enable their controllers if it is implemented as a feature. If it is not implemented as a feature, no additional step is necessary. As an example, Cluster API Provider Azure (CAPZ) has support for MachinePool through the infrastructure type AzureMachinePool.

Enabling Feature Gates for e2e Tests

One way to enable fature gates for E2E tests it to set environment variables on the clusterctl config file used to boostrap the management cluster used during the test. For CAPI, these configs are under ./test/e2e/config/… such as docker.yaml:

variables:
  CLUSTER_TOPOLOGY: "true"
  EXP_RUNTIME_SDK: "true"
  EXP_MACHINE_SET_PREFLIGHT_CHECKS: "true"

Another way is to set them as environmental variables before running e2e tests.

Enabling Feature Gates on Tilt

On development environments started with Tilt, features gates can be enabled by setting the feature variables in kustomize_substitutions, e.g.:

kustomize_substitutions:
  CLUSTER_TOPOLOGY: 'true'
  EXP_RUNTIME_SDK: 'true'
  EXP_MACHINE_SET_PREFLIGHT_CHECKS: 'true'

For more details on setting up a development environment with tilt, see Developing Cluster API with Tilt

Enabling Feature Gates on Existing Management Clusters

To enable/disable features gates on existing management clusters, users can edit the corresponding controller manager deployments, which will then trigger a restart with the requested features. E.g. for the CAPI controller manager deployment:

kubectl edit -n capi-system deployment.apps/capi-controller-manager
// Enable/disable available features by modifying Args below.
    Args:
      --leader-elect
      --feature-gates=MachinePool=true,ClusterResourceSet=true

Similarly, to validate if a particular feature is enabled, see the arguments by issuing:

kubectl describe -n capi-system deployment.apps/capi-controller-manager

Following controller manager deployments have to be edited in order to enable/disable their respective feature gates: