1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/nodes-nodes-managing-about.adoc

100 lines
3.1 KiB
Plaintext

// Module included in the following assemblies:
//
// * nodes/nodes-nodes-managing.adoc
:_mod-docs-content-type: PROCEDURE
[id="nodes-nodes-managing-about_{context}"]
= Modifying nodes
[role="_abstract"]
To make configuration changes to a cluster, or machine pool, you must create a custom resource definition (CRD), or `kubeletConfig` object. {product-title} uses the Machine Config Controller to watch for changes introduced through the CRD to apply the changes to the cluster.
[NOTE]
====
Because the fields in a `kubeletConfig` object are passed directly to the kubelet from upstream Kubernetes, the validation of those fields is handled directly by the kubelet itself. Please refer to the relevant Kubernetes documentation for the valid values for these fields. Invalid values in the `kubeletConfig` object can render cluster nodes unusable.
====
.Procedure
. Obtain the label associated with the static CRD, Machine Config Pool, for the type of node you want to configure.
Perform one of the following steps:
+
.. Check current labels of the desired machine config pool.
+
For example:
+
[source,terminal]
----
$ oc get machineconfigpool --show-labels
----
+
.Example output
[source,terminal]
----
NAME CONFIG UPDATED UPDATING DEGRADED LABELS
master rendered-master-e05b81f5ca4db1d249a1bf32f9ec24fd True False False operator.machineconfiguration.openshift.io/required-for-upgrade=
worker rendered-worker-f50e78e1bc06d8e82327763145bfcf62 True False False
----
+
.. Add a custom label to the desired machine config pool.
+
For example:
+
[source,terminal]
----
$ oc label machineconfigpool worker custom-kubelet=enabled
----
. Create a `kubeletconfig` custom resource (CR) for your configuration change, as demonstrated in the following sample configuration for a `custom-config` CR:
+
[source,yaml]
----
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
name: custom-config
spec:
machineConfigPoolSelector:
matchLabels:
custom-kubelet: enabled
kubeletConfig:
podsPerCore: 10
maxPods: 250
systemReserved:
cpu: 2000m
memory: 1Gi
#...
----
+
where:
+
`name`:: Assign a name to CR.
`custom-kubelet`:: Specify the label to apply the configuration change, this is the label you added to the machine config pool.
`kubeletConfig`:: Specify the new value(s) you want to change.
. Create the CR object:
+
[source,terminal]
----
$ oc create -f <file-name>
----
+
For example:
+
[source,terminal]
----
$ oc create -f master-kube-config.yaml
----
Most https://kubernetes.io/docs/reference/config-api/kubelet-config.v1beta1/[Kubelet Configuration options] can be set by the user. The following options are not allowed to be overwritten:
* CgroupDriver
* ClusterDNS
* ClusterDomain
* StaticPodPath
[NOTE]
====
If a single node contains more than 50 images, pod scheduling might be imbalanced across nodes. This is because the list of images on a node is shortened to 50 by default. You can disable the image limit by editing the `KubeletConfig` object and setting the value of `nodeStatusMaxImages` to `-1`.
====