Managing nodes

OKD uses a KubeletConfig custom resource (CR) to manage the configuration of nodes. By creating an instance of a KubeletConfig object, a managed machine config is created to override setting on the node.

Logging in to remote machines for the purpose of changing their configuration is not supported.

Modifying nodes

To make configuration changes to a cluster, or machine pool, you must create a custom resource definition (CRD), or kubeletConfig object. OKD uses the Machine Config Controller to watch for changes introduced through the CRD to apply the changes to the cluster.

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

  1. 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:

    1. Check current labels of the desired machine config pool.

      For example:

      1. $ oc get machineconfigpool --show-labels

      Example output

      1. NAME CONFIG UPDATED UPDATING DEGRADED LABELS
      2. master rendered-master-e05b81f5ca4db1d249a1bf32f9ec24fd True False False operator.machineconfiguration.openshift.io/required-for-upgrade=
      3. worker rendered-worker-f50e78e1bc06d8e82327763145bfcf62 True False False
    2. Add a custom label to the desired machine config pool.

      For example:

      1. $ oc label machineconfigpool worker custom-kubelet=enabled
  2. Create a kubeletconfig custom resource (CR) for your configuration change.

    For example:

    Sample configuration for a custom-config CR

    1. apiVersion: machineconfiguration.openshift.io/v1
    2. kind: KubeletConfig
    3. metadata:
    4. name: custom-config (1)
    5. spec:
    6. machineConfigPoolSelector:
    7. matchLabels:
    8. custom-kubelet: enabled (2)
    9. kubeletConfig: (3)
    10. podsPerCore: 10
    11. maxPods: 250
    12. systemReserved:
    13. cpu: 2000m
    14. memory: 1Gi
    1Assign a name to CR.
    2Specify the label to apply the configuration change, this is the label you added to the machine config pool.
    3Specify the new value(s) you want to change.
  3. Create the CR object.

    1. $ oc create -f <file-name>

    For example:

    1. $ oc create -f master-kube-config.yaml

Most KubeletConfig Options can be set by the user. The following options are not allowed to be overwritten:

  • CgroupDriver

  • ClusterDNS

  • ClusterDomain

  • RuntimeRequestTimeout

  • StaticPodPath