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

OSDOCS#12977: Reference the config map in node pools

This commit is contained in:
xenolinux
2025-01-23 16:46:37 +05:30
committed by openshift-cherrypick-robot
parent 221024605a
commit 282d5a7ea7
3 changed files with 73 additions and 3 deletions

View File

@@ -8,6 +8,11 @@ toc::[]
In a standalone {product-title} cluster, a machine config pool manages a set of nodes. You can handle a machine configuration by using the `MachineConfigPool` custom resource (CR).
[TIP]
====
You can reference any `machineconfiguration.openshift.io` resources in the `nodepool.spec.config` field of the `NodePool` CR.
====
In {hcp}, the `MachineConfigPool` CR does not exist. A node pool contains a set of compute nodes. You can handle a machine configuration by using node pools.
[NOTE]
@@ -17,6 +22,8 @@ In {product-title} 4.18 or later, the default container runtime for worker nodes
include::modules/configuring-node-pools-for-hcp.adoc[leveloffset=+1]
include::modules/hcp-kubeconf-nodepool.adoc[leveloffset=+1]
include::modules/node-tuning-hosted-cluster.adoc[leveloffset=+1]
include::modules/sriov-operator-hosted-control-planes.adoc[leveloffset=+1]

View File

@@ -21,7 +21,7 @@ On {hcp}, you can configure node pools by creating a `MachineConfig` object insi
apiVersion: v1
kind: ConfigMap
metadata:
name: <configmap-name>
name: <configmap_name>
namespace: clusters
data:
config: |
@@ -30,7 +30,7 @@ data:
metadata:
labels:
machineconfiguration.openshift.io/role: worker
name: <machineconfig-name>
name: <machineconfig_name>
spec:
config:
ignition:
@@ -64,9 +64,10 @@ metadata:
# ...
spec:
config:
- name: ${configmap-name}
- name: <configmap_name> <1>
# ...
----
<1> Replace `<configmap_name>` with the name of your config map.
//.Verification

View File

@@ -0,0 +1,62 @@
// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-machine-config.adoc
:_mod-docs-content-type: PROCEDURE
[id="hcp-kubeconf-nodepool_{context}"]
= Referencing the kubelet configuration in node pools
To reference your kubelet configuration in node pools, you add the kubelet configuration in a config map and then apply the config map in the `NodePool` resource.
.Procedure
. Add the kubelet configuration inside of a config map in the management cluster by entering the following information:
+
.Example `ConfigMap` object with the kubelet configuration
[source,yaml]
----
apiVersion: v1
kind: ConfigMap
metadata:
name: <configmap_name> <1>
namespace: clusters
data:
config: |
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
name: <kubeletconfig_name> <2>
spec:
kubeletConfig:
registerWithTaints:
- key: "example.sh/unregistered"
value: "true"
effect: "NoExecute"
----
<1> Replace `<configmap_name>` with the name of your config map.
<2> Replace `<kubeletconfig_name>` with the name of the `KubeletConfig` resource.
. Apply the config map to the node pool by entering the following command:
+
[source,yaml]
----
$ oc edit nodepool <nodepool_name> --namespace clusters <1>
----
<1> Replace `<nodepool_name>` with the name of your node pool.
+
.Example `NodePool` resource configuration
[source,yaml]
----
apiVersion: hypershift.openshift.io/v1alpha1
kind: NodePool
metadata:
# ...
name: nodepool-1
namespace: clusters
# ...
spec:
config:
- name: <configmap_name> <1>
# ...
----
<1> Replace `<configmap_name>` with the name of your config map.