Deploying user-defined firmware to cluster hosts with GitOps ZTP
You can deploy user-defined firmware settings to cluster hosts by creating custom node templates that include HostFirmwareSettings CRs, and referencing them in the ClusterInstance CR.
You can configure hardware profiles to apply to hosts in the following scenarios:
-
All hosts in the cluster
-
Individual hosts in the cluster
|
|
You can configure host hardware profiles to be applied in a hierarchy. Node-level profiles override cluster-wide settings. |
-
You have installed the OpenShift CLI (
oc). -
You have installed Red Hat Advanced Cluster Management (RHACM) version 2.12 or later and logged in to the hub cluster as a user with
cluster-adminprivileges. -
You have installed the SiteConfig Operator in the hub cluster.
-
You created a Git repository where you manage your custom site configuration data. The repository must be accessible from the hub cluster and be defined as a source repository for the Argo CD application.
-
Create the
HostFirmwareSettingsCR that contains the firmware settings you want to apply. For example, create the following YAML file:host-firmware-settings.yamlapiVersion: metal3.io/v1alpha1 kind: HostFirmwareSettings metadata: name: "site1-sno-du" namespace: "site1-sno-du" spec: settings: BootMode: "Uefi" LogicalProc: "Enabled" ProcVirtualization: "Enabled" -
Save the
HostFirmwareSettingsCR file relative to thekustomization.yamlfile that you use to provision the cluster. For example:site-configs/ └── site1-sno-du/ ├── clusterinstance-site1-sno-du.yaml ├── kustomization.yaml └── host-firmware-settings.yaml -
Create a
ConfigMapto store theHostFirmwareSettingsCR. You can use akustomization.yamlfile withconfigMapGeneratorto create theConfigMap. For example:apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - clusterinstance-site1-sno-du.yaml configMapGenerator: - name: host-firmware-settings-cm namespace: site1-sno-du files: - host-firmware-settings.yaml generatorOptions: disableNameSuffixHash: true-
namespacemust match theClusterInstancenamespace. -
host-firmware-settings.yamlis the name of theHostFirmwareSettingsCR.
-
-
To apply a hardware profile to all hosts in the cluster, reference the
ConfigMapin thespec.templateRefsfield of yourClusterInstanceCR. For example:apiVersion: siteconfig.open-cluster-management.io/v1alpha1 kind: ClusterInstance metadata: name: "site1-sno-du" namespace: "site1-sno-du" spec: clusterName: "site1-sno-du" # ... templateRefs: - name: host-firmware-settings-cm namespace: site1-sno-du nodes: - hostName: "node1.example.com" # ...-
templateRefsapplies the firmware profile to all hosts in the cluster.
-
-
Optional: To apply a hardware profile to a specific host in the cluster, reference the
ConfigMapin thespec.nodes[].templateRefsfield. For example:apiVersion: siteconfig.open-cluster-management.io/v1alpha1 kind: ClusterInstance metadata: name: "site1-sno-du" namespace: "site1-sno-du" spec: clusterName: "site1-sno-du" # ... nodes: - hostName: "node1.example.com" # ... templateRefs: - name: host-firmware-node1-cm namespace: site1-sno-du - hostName: "node2.example.com" # ...-
nodes[].templateRefsapplies the firmware profile only to thenode1.example.comhost.Node-level
templateRefssettings override cluster-leveltemplateRefssettings.
-
-
Commit the
ClusterInstanceCR,ConfigMap, and associatedkustomization.yamlchanges in your Git repository and push the changes.The Argo CD pipeline detects the changes and begins the managed cluster deployment.
Cluster deployment proceeds even if an invalid firmware setting is detected. To apply a correction using GitOps ZTP, re-deploy the cluster with the corrected hardware profile.
-
Check that the firmware settings have been applied in the managed cluster host. For example, run the following command:
$ oc get hfs -n <managed_cluster_namespace> <managed_cluster_name> -o jsonpath='{.status.conditions[?(@.type=="Valid")].status}' -
<managed_cluster_namespace>is the namespace of the managed cluster and<managed_cluster_name>is the name of the managed cluster.The following example output shows valid firmware settings:
True