Skip to content

Commit 38e2cae

Browse files
authored
Merge pull request #52790 from mburke5678/mco-custom-label
BZ2062718:Atomatically allocating system-reserved define a custom label on MCP but not actuallly using it in the kubeletConfig CR
2 parents 64cc98d + 698ada9 commit 38e2cae

6 files changed

+116
-156
lines changed

modules/nodes-cluster-overcommit-node-enforcing.adoc

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -18,54 +18,40 @@ If you disable CPU limit enforcement, it is important to understand the impact o
1818

1919
.Prerequisites
2020

21-
. Obtain the label associated with the static `MachineConfigPool` CRD for the type of node you want to configure. Perform one of the following steps:
22-
23-
.. View the machine config pool:
21+
. Obtain the label associated with the static `MachineConfigPool` CRD for the type of node you want to configure by entering the following command:
2422
+
2523
[source,terminal]
2624
----
27-
$ oc describe machineconfigpool <name>
25+
$ oc edit machineconfigpool <name>
2826
----
2927
+
3028
For example:
3129
+
3230
[source,terminal]
3331
----
34-
$ oc describe machineconfigpool worker
32+
$ oc edit machineconfigpool worker
3533
----
3634
+
3735
.Example output
38-
[source,terminal]
36+
[source,yaml]
3937
----
4038
apiVersion: machineconfiguration.openshift.io/v1
4139
kind: MachineConfigPool
4240
metadata:
43-
creationTimestamp: 2019-02-08T14:52:39Z
44-
generation: 1
41+
creationTimestamp: "2022-11-16T15:34:25Z"
42+
generation: 4
4543
labels:
46-
custom-kubelet: small-pods <1>
47-
----
48-
<1> If a label has been added it appears under `labels`.
49-
50-
.. If the label is not present, add a key/value pair:
51-
+
52-
[source,terminal]
53-
----
54-
$ oc label machineconfigpool worker custom-kubelet=small-pods
44+
pools.operator.machineconfiguration.openshift.io/worker: "" <1>
45+
name: worker
5546
----
47+
<1> The label appears under Labels.
5648
+
5749
[TIP]
5850
====
59-
You can alternatively apply the following YAML to add the label:
51+
If the label is not present, add a key/value pair such as:
6052
61-
[source,yaml]
6253
----
63-
apiVersion: machineconfiguration.openshift.io/v1
64-
kind: MachineConfigPool
65-
metadata:
66-
labels:
67-
custom-kubelet: small-pods
68-
name: worker
54+
$ oc label machineconfigpool worker custom-kubelet=small-pods
6955
----
7056
====
7157

@@ -83,11 +69,18 @@ metadata:
8369
spec:
8470
machineConfigPoolSelector:
8571
matchLabels:
86-
custom-kubelet: small-pods <2>
72+
pools.operator.machineconfiguration.openshift.io/worker: "" <2>
8773
kubeletConfig:
8874
cpuCfsQuota: <3>
8975
- "false"
9076
----
9177
<1> Assign a name to CR.
92-
<2> Specify the label to apply the configuration change.
78+
<2> Specify the label from the machine config pool.
9379
<3> Set the `cpuCfsQuota` parameter to `false`.
80+
81+
. Run the following command to create the CR:
82+
+
83+
[source,terminal]
84+
----
85+
$ oc create -f <file_name>.yaml
86+
----

modules/nodes-nodes-garbage-collection-configuring.adoc

Lines changed: 22 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,57 +17,46 @@ As an administrator, you can configure how {product-title} performs garbage coll
1717

1818
You can configure any combination of the following:
1919

20-
* Soft eviction for containers
20+
* Soft eviction for containers
2121
* Hard eviction for containers
2222
* Eviction for images
2323
2424
.Prerequisites
2525

26-
. Obtain the label associated with the static `MachineConfigPool` CRD for the type of node you want to configure.
27-
Perform one of the following steps:
28-
29-
.. View the machine config pool:
26+
. Obtain the label associated with the static `MachineConfigPool` CRD for the type of node you want to configure by entering the following command:
3027
+
3128
[source,terminal]
3229
----
33-
$ oc describe machineconfigpool <name>
30+
$ oc edit machineconfigpool <name>
3431
----
3532
+
3633
For example:
3734
+
3835
[source,terminal]
3936
----
40-
$ oc describe machineconfigpool worker
37+
$ oc edit machineconfigpool worker
4138
----
4239
+
4340
.Example output
4441
[source,yaml]
4542
----
46-
Name: worker
47-
Namespace:
48-
Labels: custom-kubelet=small-pods <1>
49-
----
50-
<1> If a label has been added it appears under `Labels`.
51-
52-
.. If the label is not present, add a key/value pair:
53-
+
54-
[source,terminal]
55-
----
56-
$ oc label machineconfigpool worker custom-kubelet=small-pods
43+
apiVersion: machineconfiguration.openshift.io/v1
44+
kind: MachineConfigPool
45+
metadata:
46+
creationTimestamp: "2022-11-16T15:34:25Z"
47+
generation: 4
48+
labels:
49+
pools.operator.machineconfiguration.openshift.io/worker: "" <1>
50+
name: worker
5751
----
52+
<1> The label appears under Labels.
5853
+
5954
[TIP]
6055
====
61-
You can alternatively apply the following YAML to add the label:
56+
If the label is not present, add a key/value pair such as:
6257

63-
[source,yaml]
6458
----
65-
apiVersion: machineconfiguration.openshift.io/v1
66-
kind: MachineConfigPool
67-
metadata:
68-
labels:
69-
custom-kubelet: small-pods
70-
name: worker
59+
$ oc label machineconfigpool worker custom-kubelet=small-pods
7160
----
7261
====
7362
@@ -90,7 +79,7 @@ metadata:
9079
spec:
9180
machineConfigPoolSelector:
9281
matchLabels:
93-
custom-kubelet: small-pods <2>
82+
pools.operator.machineconfiguration.openshift.io/worker: "" <2>
9483
kubeletConfig:
9584
evictionSoft: <3>
9685
memory.available: "500Mi" <4>
@@ -116,7 +105,7 @@ spec:
116105
imageGCLowThresholdPercent: 75 <10>
117106
----
118107
<1> Name for the object.
119-
<2> Selector label.
108+
<2> Specify the label from the machine config pool.
120109
<3> Type of eviction: `evictionSoft` or `evictionHard`.
121110
<4> Eviction thresholds based on a specific eviction trigger signal.
122111
<5> Grace periods for the soft eviction. This parameter does not apply to `eviction-hard`.
@@ -127,11 +116,11 @@ For `evictionHard` you must specify all of these parameters. If you do not spec
127116
<9> The percent of disk usage (expressed as an integer) that triggers image garbage collection.
128117
<10> The percent of disk usage (expressed as an integer) that image garbage collection attempts to free.
129118

130-
. Create the object:
119+
. Run the following command to create the CR:
131120
+
132121
[source,terminal]
133122
----
134-
$ oc create -f <file-name>.yaml
123+
$ oc create -f <file_name>.yaml
135124
----
136125
+
137126
For example:
@@ -147,7 +136,9 @@ $ oc create -f gc-container.yaml
147136
kubeletconfig.machineconfiguration.openshift.io/gc-container created
148137
----
149138

150-
. Verify that garbage collection is active. The Machine Config Pool you specified in the custom resource appears with `UPDATING` as 'true` until the change is fully implemented:
139+
.Verification
140+
141+
. Verify that garbage collection is active by entering the following command. The Machine Config Pool you specified in the custom resource appears with `UPDATING` as 'true` until the change is fully implemented:
151142
+
152143
[source,terminal]
153144
----

modules/nodes-nodes-managing-max-pods-proc.adoc

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,18 @@ For example, if `podsPerCore` is set to `10` on a node with 4 processor cores, t
1313

1414
.Prerequisites
1515

16-
. Obtain the label associated with the static `MachineConfigPool` CRD for the type of node you want to configure.
17-
Perform one of the following steps:
18-
19-
.. View the machine config pool:
16+
. Obtain the label associated with the static `MachineConfigPool` CRD for the type of node you want to configure by entering the following command:
2017
+
2118
[source,terminal]
2219
----
23-
$ oc describe machineconfigpool <name>
20+
$ oc edit machineconfigpool <name>
2421
----
2522
+
2623
For example:
2724
+
2825
[source,terminal]
2926
----
30-
$ oc describe machineconfigpool worker
27+
$ oc edit machineconfigpool worker
3128
----
3229
+
3330
.Example output
@@ -36,32 +33,20 @@ $ oc describe machineconfigpool worker
3633
apiVersion: machineconfiguration.openshift.io/v1
3734
kind: MachineConfigPool
3835
metadata:
39-
creationTimestamp: 2019-02-08T14:52:39Z
40-
generation: 1
36+
creationTimestamp: "2022-11-16T15:34:25Z"
37+
generation: 4
4138
labels:
42-
custom-kubelet: small-pods <1>
43-
----
44-
<1> If a label has been added it appears under `labels`.
45-
46-
.. If the label is not present, add a key/value pair:
47-
+
48-
[source,terminal]
49-
----
50-
$ oc label machineconfigpool worker custom-kubelet=small-pods
39+
pools.operator.machineconfiguration.openshift.io/worker: "" <1>
40+
name: worker
5141
----
42+
<1> The label appears under Labels.
5243
+
5344
[TIP]
5445
====
55-
You can alternatively apply the following YAML to add the label:
46+
If the label is not present, add a key/value pair such as:
5647

57-
[source,yaml]
5848
----
59-
apiVersion: machineconfiguration.openshift.io/v1
60-
kind: MachineConfigPool
61-
metadata:
62-
labels:
63-
custom-kubelet: small-pods
64-
name: worker
49+
$ oc label machineconfigpool worker custom-kubelet=small-pods
6550
----
6651
====
6752
@@ -79,13 +64,13 @@ metadata:
7964
spec:
8065
machineConfigPoolSelector:
8166
matchLabels:
82-
custom-kubelet: small-pods <2>
67+
pools.operator.machineconfiguration.openshift.io/worker: "" <2>
8368
kubeletConfig:
8469
podsPerCore: 10 <3>
8570
maxPods: 250 <4>
8671
----
8772
<1> Assign a name to CR.
88-
<2> Specify the label to apply the configuration change.
73+
<2> Specify the label from the machine config pool.
8974
<3> Specify the number of pods the node can run based on the number of processor cores on the node.
9075
<4> Specify the number of pods the node can run to a fixed value, regardless of the properties of the node.
9176
+
@@ -96,6 +81,15 @@ Setting `podsPerCore` to `0` disables this limit.
9681
+
9782
In the above example, the default value for `podsPerCore` is `10` and the default value for `maxPods` is `250`. This means that unless the node has 25 cores or more, by default, `podsPerCore` will be the limiting factor.
9883

84+
. Run the following command to create the CR:
85+
+
86+
[source,terminal]
87+
----
88+
$ oc create -f <file_name>.yaml
89+
----
90+
91+
.Verification
92+
9993
. List the `MachineConfigPool` CRDs to see if the change is applied. The `UPDATING` column reports `True` if the change is picked up by the Machine Config Controller:
10094
+
10195
[source,terminal]

0 commit comments

Comments
 (0)