4.11.3. Enabling feature sets using the CLI
You can use the OpenShift CLI (oc) to enable feature sets for all of the nodes in a cluster by editing the FeatureGate custom resource (CR). Completing this task enables non-default features in your cluster.
Prerequisites
-
You have installed the OpenShift CLI (
oc).
Procedure
Edit the
FeatureGateCR namedcluster:$ oc edit featuregate cluster주의Enabling the
TechPreviewNoUpgradefeature set on your cluster cannot be undone and prevents minor version updates. You should not enable this feature set on production clusters.Sample FeatureGate custom resource
apiVersion: config.openshift.io/v1 kind: FeatureGate metadata: name: cluster # ... spec: featureSet: TechPreviewNoUpgradewhere:
metadata.name-
Specifies the name of the
FeatureGateCR. This must becluster. spec.featureSetSpecifies the feature set that you want to enable:
-
TechPreviewNoUpgradeenables specific Technology Preview features.
-
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.
Verification
You can verify that the feature gates are enabled by looking at the kubelet.conf file on a node after the nodes return to the ready state.
-
From the Administrator perspective in the web console, navigate to Compute
Nodes. - Select a node.
- In the Node details page, click Terminal.
In the terminal window, change your root directory to
/host:sh-4.2# chroot /hostView the
kubelet.conffile:sh-4.2# cat /etc/kubernetes/kubelet.confSample output
# ... featureGates: InsightsOperatorPullingSCA: true, LegacyNodeRoleBehavior: false # ...The features that are listed as
trueare enabled on your cluster.참고The features listed vary depending upon the OpenShift Container Platform version.