Skip to content

Commit d56abe8

Browse files
authored
Merge pull request #87581 from openshift-cherrypick-robot/cherry-pick-87519-to-enterprise-4.16
[enterprise-4.16] OSDOCS#12977: Reference the config map in node pools
2 parents 99c8a1b + 14ef724 commit d56abe8

File tree

3 files changed

+73
-3
lines changed

3 files changed

+73
-3
lines changed

hosted_control_planes/hcp-machine-config.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,17 @@ toc::[]
88

99
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).
1010

11+
[TIP]
12+
====
13+
You can reference any `machineconfiguration.openshift.io` resources in the `nodepool.spec.config` field of the `NodePool` CR.
14+
====
15+
1116
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.
1217

1318
include::modules/configuring-node-pools-for-hcp.adoc[leveloffset=+1]
1419

20+
include::modules/hcp-kubeconf-nodepool.adoc[leveloffset=+1]
21+
1522
include::modules/node-tuning-hosted-cluster.adoc[leveloffset=+1]
1623

1724
include::modules/sriov-operator-hosted-control-planes.adoc[leveloffset=+1]

modules/configuring-node-pools-for-hcp.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ On {hcp}, you can configure node pools by creating a `MachineConfig` object insi
2222
apiVersion: v1
2323
kind: ConfigMap
2424
metadata:
25-
name: <configmap-name>
25+
name: <configmap_name>
2626
namespace: clusters
2727
data:
2828
config: |
@@ -31,7 +31,7 @@ data:
3131
metadata:
3232
labels:
3333
machineconfiguration.openshift.io/role: worker
34-
name: <machineconfig-name>
34+
name: <machineconfig_name>
3535
spec:
3636
config:
3737
ignition:
@@ -65,9 +65,10 @@ metadata:
6565
# ...
6666
spec:
6767
config:
68-
- name: ${configmap-name}
68+
- name: <configmap_name> <1>
6969
# ...
7070
----
71+
<1> Replace `<configmap_name>` with the name of your config map.
7172

7273
//.Verification
7374

modules/hcp-kubeconf-nodepool.adoc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-machine-config.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="hcp-kubeconf-nodepool_{context}"]
7+
= Referencing the kubelet configuration in node pools
8+
9+
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.
10+
11+
.Procedure
12+
13+
. Add the kubelet configuration inside of a config map in the management cluster by entering the following information:
14+
+
15+
.Example `ConfigMap` object with the kubelet configuration
16+
[source,yaml]
17+
----
18+
apiVersion: v1
19+
kind: ConfigMap
20+
metadata:
21+
name: <configmap_name> <1>
22+
namespace: clusters
23+
data:
24+
config: |
25+
apiVersion: machineconfiguration.openshift.io/v1
26+
kind: KubeletConfig
27+
metadata:
28+
name: <kubeletconfig_name> <2>
29+
spec:
30+
kubeletConfig:
31+
registerWithTaints:
32+
- key: "example.sh/unregistered"
33+
value: "true"
34+
effect: "NoExecute"
35+
----
36+
<1> Replace `<configmap_name>` with the name of your config map.
37+
<2> Replace `<kubeletconfig_name>` with the name of the `KubeletConfig` resource.
38+
39+
. Apply the config map to the node pool by entering the following command:
40+
+
41+
[source,yaml]
42+
----
43+
$ oc edit nodepool <nodepool_name> --namespace clusters <1>
44+
----
45+
<1> Replace `<nodepool_name>` with the name of your node pool.
46+
+
47+
.Example `NodePool` resource configuration
48+
[source,yaml]
49+
----
50+
apiVersion: hypershift.openshift.io/v1alpha1
51+
kind: NodePool
52+
metadata:
53+
# ...
54+
name: nodepool-1
55+
namespace: clusters
56+
# ...
57+
spec:
58+
config:
59+
- name: <configmap_name> <1>
60+
# ...
61+
----
62+
<1> Replace `<configmap_name>` with the name of your config map.

0 commit comments

Comments
 (0)