⎈ k8s knowledge compiler

Enable Or Disable Feature Gates [page]deterministic

tasks

This page shows how to enable or disable feature gates to control specific Kubernetes features in your cluster. Enabling feature gates allows you to test and use Alpha or Beta features before they become generally available.

> Note: For some stable (GA) gates, you can also disable them, usually for one minor release after GA; however if you do that, your cluster may not be conformant as Kubernetes.

##

You also need:

* Administrative access to your cluster * Knowledge of which feature gate you want to enable (see the [Feature Gates reference](/docs/reference/command-line-tools-reference/feature-gates/))

> Note: GA (stable) features are always enabled by default. You typically configure gates for Alpha or Beta features.

## Understand feature gate maturity

Before enabling a feature gate, check the [Feature Gates reference](/docs/reference/command-line-tools-reference/feature-gates/) for the feature's maturity level:

  • Alpha: Disabled by default, may be buggy. Use only in test clusters.
  • Beta: Usually enabled by default, well-tested.
  • GA: Always enabled by default; can sometimes be disabled for one release after GA.

## Identify which components need the feature gate

Different feature gates affect different Kubernetes components:

  • Some features require enabling the gate on multiple components (e.g., API server and controller manager)
  • Other features only need the gate on a single component (e.g., only kubelet)

The [Feature Gates reference](/docs/reference/command-line-tools-reference/feature-gates/) typically indicates which components are affected by each gate. All Kubernetes components share the same feature gate definitions, so all gates appear in help output, but only relevant gates affect each component's behavior.

## Configuration

### During cluster initialization

Create a configuration file to enable feature gates across relevant components:

```yaml apiVersion: kubeadm.k8s.io/v1beta4 kind: ClusterConfiguration apiServer: extraArgs: feature-gates: "FeatureName=true" controllerManager: extraArgs: feature-gates: "FeatureName=true" scheduler: extraArgs: feature-gates: "FeatureName=true" --- apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration featureGates: FeatureName: true ```

Initialize the cluster:

```shell kubeadm init --config kubeadm-config.yaml ```

### On an existing cluster

For kubeadm clusters, feature gate configuration can be set in several locations including manifest files, configuration files, and kubeadm configuration.

Edit control plane component manifests in `/etc/kubernetes/manifests/`:

1. For kube-apiserver, kube-controller-manager, or kube-scheduler, add the flag to the command:

```yaml spec: containers: - command: - kube-apiserver - --feature-gates=FeatureName=true # ... other flags ```

Save the file. The pod restarts automatically.

2. For kubelet, edit `/var/lib/kubelet/config.yaml`:

```yaml apiVersion: kubelet.config.k8s.io/v1beta1 kind: KubeletConfiguration featureGates: FeatureName: true ```

Restart kubelet:

```shell sudo systemctl restart kubelet ```

3. For kube-proxy, edit the ConfigMap:

```shell kubectl -n kube-system edit configmap kube-proxy ```

Add feature gates to the configuration:

```yaml featureGates: FeatureName: true ```

Restart the DaemonSet:

```shell kubectl -n kube-system rollout restart daemonset kube-proxy ```

## Configure multiple feature gates

Use comma-separated lists for command-line flags:

```shell --feature-gates=FeatureA=true,FeatureB=false,FeatureC=true ```

For components that support configuration files (kubelet, kube-proxy):

```yaml featureGates: FeatureA: true FeatureB: false FeatureC: true ```

> Note: In kubeadm clusters, control plane components (kube-apiserver, kube-controller-manager, and kube-scheduler) are typically conf …(trimmed)

Sources

tasks/administer-cluster/configure-feature-gates.md · docEnable Or Disable Feature Gates

Related (14)

part_of {{% heading "prerequisites" %}}describes conf=1
part_of Understand feature gate maturitydescribes conf=1
part_of Configurationdescribes conf=1
part_of Configure multiple feature gatesdescribes conf=1
part_of Verify feature gate configurationdescribes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1
part_of During cluster initializationdescribes conf=1
part_of On an existing clusterdescribes conf=1
part_of Check control plane component manifestsdescribes conf=1
part_of Check kubelet configurationdescribes conf=1
part_of Check via metrics endpointdescribes conf=1
part_of Check via /flagz endpointdescribes conf=1

← all Docs