Expanding single-node OpenShift clusters with GitOps ZTP

You can expand single-node OpenShift clusters with GitOps ZTP. When you add worker nodes to single-node OpenShift clusters, the original single-node OpenShift cluster retains the control plane node role. Adding worker nodes does not require any downtime for the existing single-node OpenShift cluster.

Although there is no specified limit on the number of worker nodes that you can add to a single-node OpenShift cluster, you must revaluate the reserved CPU allocation on the control plane node for the additional worker nodes.

If you require workload partitioning on the worker node, you must deploy and remediate the managed cluster policies on the hub cluster before installing the node. This way, the workload partitioning MachineConfig objects are rendered and associated with the worker machine config pool before the GitOps ZTP workflow applies the MachineConfig ignition file to the worker node.

It is recommended that you first remediate the policies, and then install the worker node. If you create the workload partitioning manifests after installing the worker node, you must drain the node manually and delete all the pods managed by daemon sets. When the managing daemon sets create the new pods, the new pods undergo the workload partitioning process.

Adding worker nodes to single-node OpenShift clusters with GitOps ZTP is a Technology Preview feature only. Technology Preview features are not supported with Red Hat production service level agreements (SLAs) and might not be functionally complete. Red Hat does not recommend using them in production. These features provide early access to upcoming product features, enabling customers to test functionality and provide feedback during the development process.

For more information about the support scope of Red Hat Technology Preview features, see https://access.redhat.com/support/offerings/techpreview/.

Additional resources

Applying profiles to the worker node

You can configure the additional worker node with a DU profile.

You can apply a RAN distributed unit (DU) profile to the worker node cluster using the ZTP GitOps common, group, and site-specific PolicyGenTemplate resources. The GitOps ZTP pipeline that is linked to the ArgoCD policies application includes the following CRs that you can find in the out/argocd/example/policygentemplates folder when you extract the ztp-site-generate container:

  • common-ranGen.yaml

  • group-du-sno-ranGen.yaml

  • example-sno-site.yaml

  • ns.yaml

  • kustomization.yaml

Configuring the DU profile on the worker node is considered an upgrade. To initiate the upgrade flow, you must update the existing policies or create additional ones. Then, you must create a ClusterGroupUpgrade CR to reconcile the policies in the group of clusters.

(Optional) Ensuring PTP and SR-IOV daemon selector compatibility

If the DU profile was deployed using the GitOps ZTP plugin version 4.11 or earlier, the PTP and SR-IOV Operators might be configured to place the daemons only on nodes labelled as master. This configuration prevents the PTP and SR-IOV daemons from operating on the worker node. If the PTP and SR-IOV daemon node selectors are incorrectly configured on your system, you must change the daemons before proceeding with the worker DU profile configuration.

Procedure

  1. Check the daemon node selector settings of the PTP Operator on one of the spoke clusters:

    1. $ oc get ptpoperatorconfig/default -n openshift-ptp -ojsonpath='{.spec}' | jq

    Example output for PTP Operator

    1. {"daemonNodeSelector":{"node-role.kubernetes.io/master":""}} (1)
    1If the node selector is set to master, the spoke was deployed with the version of the ZTP plugin that requires changes.
  2. Check the daemon node selector settings of the SR-IOV Operator on one of the spoke clusters:

    1. $ oc get sriovoperatorconfig/default -n \
    2. openshift-sriov-network-operator -ojsonpath='{.spec}' | jq

    Example output for SR-IOV Operator

    1. {"configDaemonNodeSelector":{"node-role.kubernetes.io/worker":""},"disableDrain":false,"enableInjector":true,"enableOperatorWebhook":true} (1)
    1If the node selector is set to master, the spoke was deployed with the version of the ZTP plugin that requires changes.
  3. In the group policy, add the following complianceType and spec entries:

    1. spec:
    2. - fileName: PtpOperatorConfig.yaml
    3. policyName: "config-policy"
    4. complianceType: mustonlyhave
    5. spec:
    6. daemonNodeSelector:
    7. node-role.kubernetes.io/worker: ""
    8. - fileName: SriovOperatorConfig.yaml
    9. policyName: "config-policy"
    10. complianceType: mustonlyhave
    11. spec:
    12. configDaemonNodeSelector:
    13. node-role.kubernetes.io/worker: ""

    Changing the daemonNodeSelector field causes temporary PTP synchronization loss and SR-IOV connectivity loss.

  4. Commit the changes in Git, and then push to the Git repository being monitored by the GitOps ZTP ArgoCD application.

PTP and SR-IOV node selector compatibility

The PTP configuration resources and SR-IOV network node policies use node-role.kubernetes.io/master: "" as the node selector. If the additional worker nodes have the same NIC configuration as the control plane node, the policies used to configure the control plane node can be reused for the worker nodes. However, the node selector must be changed to select both node types, for example with the "node-role.kubernetes.io/worker" label.

Using PolicyGenTemplate CRs to apply worker node policies to worker nodes

You can create policies for worker nodes.

Procedure

  1. Create the following policy template:

    1. apiVersion: ran.openshift.io/v1
    2. kind: PolicyGenTemplate
    3. metadata:
    4. name: "example-sno-workers"
    5. namespace: "example-sno"
    6. spec:
    7. bindingRules:
    8. sites: "example-sno" (1)
    9. mcp: "worker" (2)
    10. sourceFiles:
    11. - fileName: MachineConfigGeneric.yaml (3)
    12. policyName: "config-policy"
    13. metadata:
    14. labels:
    15. machineconfiguration.openshift.io/role: worker
    16. name: enable-workload-partitioning
    17. spec:
    18. config:
    19. storage:
    20. files:
    21. - contents:
    22. source: data:text/plain;charset=utf-8;base64,W2NyaW8ucnVudGltZS53b3JrbG9hZHMubWFuYWdlbWVudF0KYWN0aXZhdGlvbl9hbm5vdGF0aW9uID0gInRhcmdldC53b3JrbG9hZC5vcGVuc2hpZnQuaW8vbWFuYWdlbWVudCIKYW5ub3RhdGlvbl9wcmVmaXggPSAicmVzb3VyY2VzLndvcmtsb2FkLm9wZW5zaGlmdC5pbyIKcmVzb3VyY2VzID0geyAiY3B1c2hhcmVzIiA9IDAsICJjcHVzZXQiID0gIjAtMyIgfQo=
    23. mode: 420
    24. overwrite: true
    25. path: /etc/crio/crio.conf.d/01-workload-partitioning
    26. user:
    27. name: root
    28. - contents:
    29. source: data:text/plain;charset=utf-8;base64,ewogICJtYW5hZ2VtZW50IjogewogICAgImNwdXNldCI6ICIwLTMiCiAgfQp9Cg==
    30. mode: 420
    31. overwrite: true
    32. path: /etc/kubernetes/openshift-workload-pinning
    33. user:
    34. name: root
    35. - fileName: PerformanceProfile.yaml
    36. policyName: "config-policy"
    37. metadata:
    38. name: openshift-worker-node-performance-profile
    39. spec:
    40. cpu: (4)
    41. isolated: "4-47"
    42. reserved: "0-3"
    43. hugepages:
    44. defaultHugepagesSize: 1G
    45. pages:
    46. - size: 1G
    47. count: 32
    48. realTimeKernel:
    49. enabled: true
    50. - fileName: TunedPerformancePatch.yaml
    51. policyName: "config-policy"
    52. metadata:
    53. name: performance-patch-worker
    54. spec:
    55. profile:
    56. - name: performance-patch-worker
    57. data: |
    58. [main]
    59. summary=Configuration changes profile inherited from performance created tuned
    60. include=openshift-node-performance-openshift-worker-node-performance-profile
    61. [bootloader]
    62. cmdline_crash=nohz_full=4-47 (5)
    63. [sysctl]
    64. kernel.timer_migration=1
    65. [scheduler]
    66. group.ice-ptp=0:f:10:*:ice-ptp.*
    67. [service]
    68. service.stalld=start,enable
    69. service.chronyd=stop,disable
    70. recommend:
    71. - profile: performance-patch-worker
    1The policies are applied to all clusters with this label.
    2The MCP field must be set to worker.
    3This generic MachineConfig CR is used to configure workload partitioning on the worker node.
    4The cpu.isolated and cpu.reserved fields must be configured for each particular hardware platform.
    5The cmdline_crash CPU set must match the cpu.isolated set in the PerformanceProfile section.

    A generic MachineConfig CR is used to configure workload partitioning on the worker node. You can generate the content of crio and kubelet configuration files.

  2. Add the created policy template to the Git repository monitored by the ArgoCD policies application.

  3. Add the policy in the kustomization.yaml file.

  4. Commit the changes in Git, and then push to the Git repository being monitored by the GitOps ZTP ArgoCD application.

  5. To remediate the new policies to your spoke cluster, create a TALM custom resource:

    1. $ cat <<EOF | oc apply -f -
    2. apiVersion: ran.openshift.io/v1alpha1
    3. kind: ClusterGroupUpgrade
    4. metadata:
    5. name: example-sno-worker-policies
    6. namespace: default
    7. spec:
    8. backup: false
    9. clusters:
    10. - example-sno
    11. enable: true
    12. managedPolicies:
    13. - group-du-sno-config-policy
    14. - example-sno-workers-config-policy
    15. - example-sno-config-policy
    16. preCaching: false
    17. remediationStrategy:
    18. maxConcurrency: 1
    19. EOF

Adding worker nodes to single-node OpenShift clusters with GitOps ZTP

You can add one or more worker nodes to existing single-node OpenShift clusters to increase available CPU resources in the cluster.

Prerequisites

  • Install and configure RHACM 2.6 or later in an OKD 4.11 or later bare-metal hub cluster

  • Install Topology Aware Lifecycle Manager in the hub cluster

  • Install Red Hat OpenShift GitOps in the hub cluster

  • Use the GitOps ZTP ztp-site-generate container image version 4.12 or later

  • Deploy a managed single-node OpenShift cluster with GitOps ZTP

  • Configure the Central Infrastructure Management as described in the RHACM documentation

  • Configure the DNS serving the cluster to resolve the internal API endpoint api-int.<cluster_name>.<base_domain>

Procedure

  1. If you deployed your cluster by using the example-sno.yaml SiteConfig manifest, add your new worker node to the spec.clusters['example-sno'].nodes list:

    1. nodes:
    2. - hostName: "example-node2.example.com"
    3. role: "worker"
    4. bmcAddress: "idrac-virtualmedia+https://[1111:2222:3333:4444::bbbb:1]/redfish/v1/Systems/System.Embedded.1"
    5. bmcCredentialsName:
    6. name: "example-node2-bmh-secret"
    7. bootMACAddress: "AA:BB:CC:DD:EE:11"
    8. bootMode: "UEFI"
    9. nodeNetwork:
    10. interfaces:
    11. - name: eno1
    12. macAddress: "AA:BB:CC:DD:EE:11"
    13. config:
    14. interfaces:
    15. - name: eno1
    16. type: ethernet
    17. state: up
    18. macAddress: "AA:BB:CC:DD:EE:11"
    19. ipv4:
    20. enabled: false
    21. ipv6:
    22. enabled: true
    23. address:
    24. - ip: 1111:2222:3333:4444::1
    25. prefix-length: 64
    26. dns-resolver:
    27. config:
    28. search:
    29. - example.com
    30. server:
    31. - 1111:2222:3333:4444::2
    32. routes:
    33. config:
    34. - destination: ::/0
    35. next-hop-interface: eno1
    36. next-hop-address: 1111:2222:3333:4444::1
    37. table-id: 254
  2. Create a BMC authentication secret for the new host, as referenced by the bmcCredentialsName field in the spec.nodes section of your SiteConfig file:

    1. apiVersion: v1
    2. data:
    3. password: "password"
    4. username: "username"
    5. kind: Secret
    6. metadata:
    7. name: "example-node2-bmh-secret"
    8. namespace: example-sno
    9. type: Opaque
  3. Commit the changes in Git, and then push to the Git repository that is being monitored by the GitOps ZTP ArgoCD application.

    When the ArgoCD cluster application synchronizes, two new manifests appear on the hub cluster generated by the ZTP plugin:

    • BareMetalHost

    • NMStateConfig

      The cpuset field should not be configured for the worker node. Workload partitioning for worker nodes is added through management policies after the node installation is complete.

Verification

You can monitor the installation process in several ways.

  • Check if the preprovisioning images are created by running the following command:

    1. $ oc get ppimg -n example-sno

    Example output

    1. NAMESPACE NAME READY REASON
    2. example-sno example-sno True ImageCreated
    3. example-sno example-node2 True ImageCreated
  • Check the state of the bare-metal hosts:

    1. $ oc get bmh -n example-sno

    Example output

    1. NAME STATE CONSUMER ONLINE ERROR AGE
    2. example-sno provisioned true 69m
    3. example-node2 provisioning true 4m50s (1)
    1The provisioning state indicates that node booting from the installation media is in progress.
  • Continuously monitor the installation process:

    1. Watch the agent install process by running the following command:

      1. $ oc get agent -n example-sno --watch

      Example output

      1. NAME CLUSTER APPROVED ROLE STAGE
      2. 671bc05d-5358-8940-ec12-d9ad22804faa example-sno true master Done
      3. [...]
      4. 14fd821b-a35d-9cba-7978-00ddf535ff37 example-sno true worker Starting installation
      5. 14fd821b-a35d-9cba-7978-00ddf535ff37 example-sno true worker Installing
      6. 14fd821b-a35d-9cba-7978-00ddf535ff37 example-sno true worker Writing image to disk
      7. [...]
      8. 14fd821b-a35d-9cba-7978-00ddf535ff37 example-sno true worker Waiting for control plane
      9. [...]
      10. 14fd821b-a35d-9cba-7978-00ddf535ff37 example-sno true worker Rebooting
      11. 14fd821b-a35d-9cba-7978-00ddf535ff37 example-sno true worker Done
    2. When the worker node installation is finished, the worker node certificates are approved automatically. At this point, the worker appears in the ManagedClusterInfo status. Run the following command to see the status:

      1. $ oc get managedclusterinfo/example-sno -n example-sno -o \
      2. jsonpath='{range .status.nodeList[*]}{.name}{"\t"}{.conditions}{"\t"}{.labels}{"\n"}{end}'

      Example output

      1. example-sno [{"status":"True","type":"Ready"}] {"node-role.kubernetes.io/master":"","node-role.kubernetes.io/worker":""}
      2. example-node2 [{"status":"True","type":"Ready"}] {"node-role.kubernetes.io/worker":""}