Skip to content

Latest commit

 

History

History
106 lines (89 loc) · 4.05 KB

File metadata and controls

106 lines (89 loc) · 4.05 KB

Enabling individual feature gates using the CustomNoUpgrade feature set

You can use the {oc-first} to enable or disable individual feature gates on your cluster by setting the CustomNoUpgrade feature set on the FeatureGate custom resource (CR). Unlike TechPreviewNoUpgrade, which enables all Technology Preview features, CustomNoUpgrade gives you granular control over individual feature gates.

Warning

Enabling the CustomNoUpgrade feature set on your cluster cannot be undone and prevents minor version updates. Once applied, you cannot revert the featureSet field back to its default value. You can continue to modify the individual gates within customNoUpgrade.enabled and customNoUpgrade.disabled, but the CustomNoUpgrade feature set itself is permanent.

This feature set is not supported for production clusters. Because of its nature, this setting cannot be validated. If you have any typos or accidentally apply invalid combinations, your cluster may fail in an unrecoverable way.

Prerequisites
  • You have installed the {oc-first}.

  • You have cluster administrator privileges.

Procedure
  1. Enable a specific feature gate by patching the FeatureGate CR:

    $ oc patch featuregate cluster --type=merge -p \
      '{"spec":{"featureSet":"CustomNoUpgrade","customNoUpgrade":{"enabled":["<feature_gate_name>"]}}}'

    where <feature_gate_name> is the name of the feature gate you want to enable, for example ClusterAPIMachineManagement. The spec.customNoUpgrade.enabled field accepts a string array. Each element is a feature gate name as a plain string. Do not use the object format {"name": "FeatureGateName"}, which appears in status.featureGates but is not valid for the spec.

  2. To enable multiple feature gates at once:

    $ oc patch featuregate cluster --type=merge -p \
      '{"spec":{"featureSet":"CustomNoUpgrade","customNoUpgrade":{"enabled":["<feature_gate_1>","<feature_gate_2>"]}}}'
  3. To remove a previously enabled feature gate from the enabled list:

    $ oc patch featuregate cluster --type=merge -p \
      '{"spec":{"customNoUpgrade":{"enabled":[]}}}'
    Note

    This removes all individually enabled gates but does not revert the CustomNoUpgrade feature set. The cluster remains on CustomNoUpgrade and minor version upgrades remain blocked.

  4. Alternatively, you can enable the feature set by editing the FeatureGate CR directly:

    $ oc edit featuregate cluster
    Sample FeatureGate custom resource with CustomNoUpgrade
    apiVersion: config.openshift.io/v1
    kind: FeatureGate
    metadata:
      name: cluster
    spec:
      featureSet: CustomNoUpgrade
      customNoUpgrade:
        enabled:
          - <feature_gate_name>
        disabled:
          - <feature_gate_name>

    where:

    spec.featureSet

    Must be set to CustomNoUpgrade to use the customNoUpgrade field.

    spec.customNoUpgrade.enabled

    A list of feature gate names to enable, specified as plain strings.

    spec.customNoUpgrade.disabled

    Optional. A list of feature gate names to explicitly disable.

    After you save the changes, new machine configs are created, the machine config pools are updated, and scheduling on each node is disabled while the change is being applied.

Note

The syntax for enabling feature gates differs between the install-config.yaml file and the FeatureGate CR:

  • In install-config.yaml, use featureGates: ["<feature_gate_name>=true"]

  • In the FeatureGate CR at runtime, use customNoUpgrade.enabled: ["<feature_gate_name>"]

You can also verify the enabled feature gates by checking the FeatureGate CR status:

$ oc get featuregate cluster -o jsonpath='{.status.featureGates[0].enabled[*].name}' | tr ' ' '\n'