Skip to content

Commit 0bf4d51

Browse files
authored
Merge pull request #63519 from amolnar-rh/TELCODOCS-1347
TELCODOCS-1347: Add support for node labels to SiteConfig
2 parents 45c8edd + 1957470 commit 0bf4d51

File tree

3 files changed

+74
-14
lines changed

3 files changed

+74
-14
lines changed

modules/ztp-deploying-a-site.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,31 @@ For more information, see "Customizing extra installation manifests in the {ztp}
8888
. Commit the `SiteConfig` CR and associated `kustomization.yaml` changes in your Git repository and push the changes.
8989
+
9090
The ArgoCD pipeline detects the changes and begins the managed cluster deployment.
91+
92+
.Verification
93+
94+
* Verify that the custom roles and labels are applied after the node is deployed:
95+
+
96+
[source,terminal]
97+
----
98+
$ oc describe node example-node.example.com
99+
----
100+
101+
.Example output
102+
[source,terminal]
103+
----
104+
Name: example-node.example.com
105+
Roles: control-plane,example-label,master,worker
106+
Labels: beta.kubernetes.io/arch=amd64
107+
beta.kubernetes.io/os=linux
108+
custom-label/parameter1=true
109+
kubernetes.io/arch=amd64
110+
kubernetes.io/hostname=cnfdf03.telco5gran.eng.rdu2.redhat.com
111+
kubernetes.io/os=linux
112+
node-role.kubernetes.io/control-plane=
113+
node-role.kubernetes.io/example-label= <1>
114+
node-role.kubernetes.io/master=
115+
node-role.kubernetes.io/worker=
116+
node.openshift.io/os_id=rhcos
117+
----
118+
<1> The custom label is applied to the node.

modules/ztp-generating-install-and-config-crs-manually.adoc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,31 @@ ref
151151
----
152152

153153
. Use the generated CRs as the basis for the CRs that you use to install the cluster. You apply the installation CRs to the hub cluster as described in "Installing a single managed cluster". The configuration CRs can be applied to the cluster after cluster installation is complete.
154+
155+
.Verification
156+
157+
* Verify that the custom roles and labels are applied after the node is deployed:
158+
+
159+
[source,terminal]
160+
----
161+
$ oc describe node example-node.example.com
162+
----
163+
164+
.Example output
165+
[source,terminal]
166+
----
167+
Name: example-node.example.com
168+
Roles: control-plane,example-label,master,worker
169+
Labels: beta.kubernetes.io/arch=amd64
170+
beta.kubernetes.io/os=linux
171+
custom-label/parameter1=true
172+
kubernetes.io/arch=amd64
173+
kubernetes.io/hostname=cnfdf03.telco5gran.eng.rdu2.redhat.com
174+
kubernetes.io/os=linux
175+
node-role.kubernetes.io/control-plane=
176+
node-role.kubernetes.io/example-label= <1>
177+
node-role.kubernetes.io/master=
178+
node-role.kubernetes.io/worker=
179+
node.openshift.io/os_id=rhcos
180+
----
181+
<1> The custom label is applied to the node.

snippets/ztp-example-siteconfig.adoc

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,18 @@ spec:
3434
nodes:
3535
- hostName: "example-node.example.com" <6>
3636
role: "master"
37-
bmcAddress: idrac-virtualmedia://<out_of_band_ip>/<system_id>/ <7>
37+
nodeLabels: <7>
38+
node-role.kubernetes.io/example-label:
39+
custom-label/parameter1: true
40+
bmcAddress: idrac-virtualmedia://<out_of_band_ip>/<system_id>/ <8>
3841
bmcCredentialsName:
39-
name: "bmh-secret" <8>
42+
name: "bmh-secret" <9>
4043
bootMACAddress: "AA:BB:CC:DD:EE:11"
41-
bootMode: "UEFI" <9>
42-
rootDeviceHints: <10>
44+
bootMode: "UEFI" <10>
45+
rootDeviceHints: <11>
4346
wwn: "0x11111000000asd123"
44-
cpuset: "0-1,52-53" <11>
45-
nodeNetwork: <12>
47+
cpuset: "0-1,52-53" <12>
48+
nodeNetwork: <13>
4649
interfaces:
4750
- name: eno1
4851
macAddress: "AA:BB:CC:DD:EE:11"
@@ -53,7 +56,7 @@ spec:
5356
state: up
5457
ipv4:
5558
enabled: false
56-
ipv6: <13>
59+
ipv6: <14>
5760
enabled: true
5861
address:
5962
- ip: 1111:2222:3333:4444::aaaa:1
@@ -77,10 +80,11 @@ spec:
7780
<4> Cluster labels must correspond to the `bindingRules` field in the `PolicyGenTemplate` CRs that you define. For example, `policygentemplates/common-ranGen.yaml` applies to all clusters with `common: true` set, `policygentemplates/group-du-sno-ranGen.yaml` applies to all clusters with `group-du-sno: ""` set.
7881
<5> Optional. The CR specifed under `KlusterletAddonConfig` is used to override the default `KlusterletAddonConfig` that is created for the cluster.
7982
<6> For single-node deployments, define a single host. For three-node deployments, define three hosts. For standard deployments, define three hosts with `role: master` and two or more hosts defined with `role: worker`.
80-
<7> BMC address that you use to access the host. Applies to all cluster types. {ztp} supports iPXE and virtual media booting by using Redfish or IPMI protocols. To use iPXE booting, you must use {rh-rhacm} 2.8 or later. For more information about BMC addressing, see the _Additional resources_ section.
81-
<8> Name of the `bmh-secret` CR that you separately create with the host BMC credentials. When creating the `bmh-secret` CR, use the same namespace as the `SiteConfig` CR that provisions the host.
82-
<9> Configures the boot mode for the host. The default value is `UEFI`. Use `UEFISecureBoot` to enable secure boot on the host.
83-
<10> Specifies the device for deployment. Identifiers that are stable across reboots are recommended, for example `wwn: <disk_wwn>` or `deviceName: /dev/disk/by-path/<device_path>`. For a detailed list of stable identifiers, see the _About root device hints_ section.
84-
<11> `cpuset` must match the value set in the cluster `PerformanceProfile` CR `spec.cpu.reserved` field for workload partitioning.
85-
<12> Specifies the network settings for the node.
86-
<13> Configures the IPv6 address for the host. For {sno} clusters with static IP addresses, the node-specific API and Ingress IPs should be the same.
83+
<7> Specify custom roles to your nodes in your managed clusters. These are additional roles which are not used by any {product-title} components, only by the user. When you add a custom role, it can be associated with a custom machine config pool that references a specific configuration for that role. Adding your custom labels or roles during installation makes the deployment process more effective and prevents the need for additional reboots after the installation is complete.
84+
<8> BMC address that you use to access the host. Applies to all cluster types. {ztp} supports iPXE and virtual media booting by using Redfish or IPMI protocols. To use iPXE booting, you must use {rh-rhacm} 2.8 or later. For more information about BMC addressing, see the _Additional resources_ section.
85+
<9> Name of the `bmh-secret` CR that you separately create with the host BMC credentials. When creating the `bmh-secret` CR, use the same namespace as the `SiteConfig` CR that provisions the host.
86+
<10> Configures the boot mode for the host. The default value is `UEFI`. Use `UEFISecureBoot` to enable secure boot on the host.
87+
<11> Specifies the device for deployment. Identifiers that are stable across reboots are recommended, for example `wwn: <disk_wwn>` or `deviceName: /dev/disk/by-path/<device_path>`. For a detailed list of stable identifiers, see the _About root device hints_ section.
88+
<12> `cpuset` must match the value set in the cluster `PerformanceProfile` CR `spec.cpu.reserved` field for workload partitioning.
89+
<13> Specifies the network settings for the node.
90+
<14> Configures the IPv6 address for the host. For {sno} clusters with static IP addresses, the node-specific API and Ingress IP addresses must be the same.

0 commit comments

Comments
 (0)