Questo contenuto non è disponibile nella lingua selezionata.
Chapter 4. Deploying a virtualized control plane
After preparing your environment, install the virtualized control plane cluster by using your preferred installation method. The agent-based installer and GitOps Zero Touch Provisioning (ZTP) are the recommended methods for virtualized control plane deployments.
4.1. Deploying a virtualized control plane with the Agent-based installer Copia collegamentoCollegamento copiato negli appunti!
Use the Agent-based Installer to deploy a virtualized control plane cluster. This method generates a bootable ISO containing all required configuration.
You must mount the ISO to both the virtualized control plane nodes, by using KubeVirt Redfish, and the baremetal worker nodes, by using the Redfish API.
Prerequisites
- KubeVirt Redfish is installed and configured on the hosting cluster.
- Control plane VMs are created on the hosting cluster and powered off. In this state, you can manage the VM power lifecycle and boot configuration through KubeVirt Redfish.
- You have network access to the KubeVirt Redfish route.
- An HTTP server is available to host the agent ISO.
Procedure
Create an
install-config.yamlfile with BMC addresses pointing to KubeVirt Redfish for the virtualized control plane nodes and real Redfish endpoints for the baremetal worker nodes:apiVersion: v1 metadata: name: my-vcp-cluster baseDomain: example.com controlPlane: architecture: amd64 hyperthreading: Enabled name: master replicas: 3 compute: - name: worker architecture: amd64 hyperthreading: Enabled replicas: 2 networking: networkType: OVNKubernetes clusterNetwork: - cidr: 10.128.0.0/14 hostPrefix: 23 serviceNetwork: - 172.30.0.0/16 machineNetwork: - cidr: 10.0.0.0/24 platform: baremetal: provisioningNetwork: Disabled apiVIPs: - 10.0.0.10 ingressVIPs: - 10.0.0.11 hosts: - name: master-0 role: master bootMACAddress: 52:54:00:00:00:01 bootMode: UEFI rootDeviceHints: deviceName: /dev/vda bmc: address: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-0 username: admin password: <password> disableCertificateVerification: false networkConfig: interfaces: - name: enp1s0 mac-address: 52:54:00:00:00:01 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: master-1 role: master bootMACAddress: 52:54:00:00:00:02 bootMode: UEFI rootDeviceHints: deviceName: /dev/vda bmc: address: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-1 username: admin password: <password> disableCertificateVerification: false networkConfig: interfaces: - name: enp1s0 mac-address: 52:54:00:00:00:02 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: master-2 role: master bootMACAddress: 52:54:00:00:00:03 bootMode: UEFI rootDeviceHints: deviceName: /dev/vda bmc: address: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-2 username: admin password: <password> disableCertificateVerification: false networkConfig: interfaces: - name: enp1s0 mac-address: 52:54:00:00:00:03 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: worker-0 role: worker bootMACAddress: e4:43:4b:00:00:01 bootMode: UEFI rootDeviceHints: deviceName: /dev/nvme0n1 bmc: address: redfish-virtualmedia+https://<worker_0_bmc_ip>/redfish/v1/Systems/System.Embedded.1 username: <bmc_username> password: <bmc_password> disableCertificateVerification: false networkConfig: interfaces: - name: ens1f0 mac-address: e4:43:4b:00:00:01 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: worker-1 role: worker bootMACAddress: e4:43:4b:00:00:02 bootMode: UEFI rootDeviceHints: deviceName: /dev/nvme0n1 bmc: address: redfish-virtualmedia+https://<worker_1_bmc_ip>/redfish/v1/Systems/System.Embedded.1 username: <bmc_username> password: <bmc_password> disableCertificateVerification: false networkConfig: interfaces: - name: ens1f0 mac-address: e4:43:4b:00:00:02 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true pullSecret: '<pull_secret>' sshKey: '<ssh_public_key>'where:
-
platform: baremetalenables the installer to manage the control plane VMs through KubeVirt Redfish endpoints. -
apiVIPsandingressVIPsspecifies the virtual IP addresses that must be allocated from the machine network. TheapiVIPsmust reside on the same L2 network segment as the control plane VMs, and theingressVIPsmust reside on the same L2 network segment as the worker nodes. -
bootMACAddressmust match the MAC address of the network interface on the corresponding control plane VM. When using DHCP, ensure this MAC has a reserved IP address configured in your DHCP server. -
bmc.addressfor control plane nodes specifies the KubeVirt Redfish route. The<vm_namespace>.<vm_name>format corresponds to the enhanced system ID convention configured in KubeVirt Redfish. Replace<kubevirt_redfish_route>with your route hostname and<vm_namespace>with the namespace containing your VMs.
-
Create an
agent-config.yamlYAML file similar to the following example:apiVersion: v1alpha1 kind: AgentConfig metadata: name: my-vcp-cluster rendezvousIP: 10.0.0.20where: * The
rendezvousIPfield specifies the IP address of the first control plane node. This node coordinates the installation.Generate the agent ISO by running the following command:
$ openshift-install agent create image --dir <installation_directory>-
Host the generated
agent.x86_64.isoon an HTTP server accessible from your hosting cluster. Boot each node from the agent ISO:
- For virtualized control plane nodes, use KubeVirt Redfish to mount the ISO and power on the VMs.
- For baremetal worker nodes, use the server’s BMC interface to mount the ISO and boot.
Monitor the installation progress by running the following command:
$ openshift-install agent wait-for install-complete --dir <installation_directory>-
Replace
<installation_directory>with the path to the directory where the agent ISO was generated.
-
Replace
Verification
After installation completes, verify the cluster is operational:
$ export KUBECONFIG=<installation_directory>/auth/kubeconfig $ oc get nodes
4.2. Deploying a virtualized control plane with GitOps ZTP Copia collegamentoCollegamento copiato negli appunti!
Use GitOps Zero Touch Provisioning (ZTP) to deploy virtualized control plane clusters at scale. GitOps Zero Touch Provisioning (ZTP) uses GitOps to manage cluster deployments declaratively through Red Hat Advanced Cluster Management (RHACM).
Prerequisites
- RHACM is installed on a hub cluster.
- KubeVirt Redfish is installed and configured on the hosting cluster.
- Control plane VMs are created and powered off.
- A Git repository is configured for GitOps ZTP manifests.
- A pull secret is available for the cluster.
Procedure
Create
Secretcustom resources (CRs) that contain the BMC credentials for each node. The following example shows a secret for a control plane node:apiVersion: v1 kind: Secret metadata: name: master-0-bmc-secret namespace: my-vcp-cluster type: Opaque data: username: <base64_encoded_username> password: <base64_encoded_password>Create similar
SecretCRs for each node, for examplemaster-1-bmc-secret,worker-0-bmc-secretand so on. For virtualized control plane nodes, use the KubeVirt Redfish credentials. For baremetal worker nodes, use the physical server’s BMC credentials.Create a
ClusterInstancecustom resource (CR) that defines the cluster. Specify BMC addresses pointing to KubeVirt Redfish for the virtualized control plane nodes and real Redfish endpoints for the baremetal worker nodes:apiVersion: siteconfig.open-cluster-management.io/v1alpha1 kind: ClusterInstance metadata: name: my-vcp-cluster namespace: my-vcp-cluster spec: baseDomain: example.com clusterImageSetNameRef: "openshift-5.0" clusterName: my-vcp-cluster clusterType: HighlyAvailable platformType: BareMetal networkType: OVNKubernetes clusterNetwork: - cidr: 10.128.0.0/14 hostPrefix: 23 serviceNetwork: - cidr: 172.30.0.0/16 machineNetwork: - cidr: 10.0.0.0/24 apiVIPs: - 10.0.0.10 ingressVIPs: - 10.0.0.11 pullSecretRef: name: assisted-deployment-pull-secret sshPublicKey: "<ssh_public_key>" extraLabels: ManagedCluster: common: "true" sites: "my-vcp-cluster" templateRefs: - name: ai-cluster-templates-v1 namespace: open-cluster-management nodes: - hostName: master-0.my-vcp-cluster.example.com role: master bmcAddress: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-0 bmcCredentialsName: name: master-0-bmc-secret bootMACAddress: 52:54:00:00:00:01 bootMode: UEFI automatedCleaningMode: disabled rootDeviceHints: deviceName: /dev/vda templateRefs: - name: ai-node-templates-v1 namespace: open-cluster-management - hostName: master-1.my-vcp-cluster.example.com role: master bmcAddress: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-1 bmcCredentialsName: name: master-1-bmc-secret bootMACAddress: 52:54:00:00:00:02 bootMode: UEFI automatedCleaningMode: disabled rootDeviceHints: deviceName: /dev/vda templateRefs: - name: ai-node-templates-v1 namespace: open-cluster-management - hostName: master-2.my-vcp-cluster.example.com role: master bmcAddress: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-2 bmcCredentialsName: name: master-2-bmc-secret bootMACAddress: 52:54:00:00:00:03 bootMode: UEFI automatedCleaningMode: disabled rootDeviceHints: deviceName: /dev/vda templateRefs: - name: ai-node-templates-v1 namespace: open-cluster-management - hostName: worker-0.my-vcp-cluster.example.com role: worker bmcAddress: redfish-virtualmedia+https://<worker_0_bmc_ip>/redfish/v1/Systems/System.Embedded.1 bmcCredentialsName: name: worker-0-bmc-secret bootMACAddress: e4:43:4b:00:00:01 bootMode: UEFI automatedCleaningMode: disabled rootDeviceHints: deviceName: /dev/nvme0n1 templateRefs: - name: ai-node-templates-v1 namespace: open-cluster-management - hostName: worker-1.my-vcp-cluster.example.com role: worker bmcAddress: redfish-virtualmedia+https://<worker_1_bmc_ip>/redfish/v1/Systems/System.Embedded.1 bmcCredentialsName: name: worker-1-bmc-secret bootMACAddress: e4:43:4b:00:00:02 bootMode: UEFI automatedCleaningMode: disabled rootDeviceHints: deviceName: /dev/nvme0n1 templateRefs: - name: ai-node-templates-v1 namespace: open-cluster-managementwhere:
-
platformType: BareMetalenables the installer to manage the control plane VMs through KubeVirt Redfish endpoints. -
apiVIPsandingressVIPsspecifies the virtual IP addresses that must be allocated from the machine network. TheapiVIPsmust reside on the same L2 network segment as the control plane VMs, and theingressVIPsmust reside on the same L2 network segment as the worker nodes. -
bmcAddressfor control plane nodes specifies the KubeVirt Redfish route. The<vm_namespace>.<vm_name>format corresponds to the enhanced system ID convention configured in KubeVirt Redfish. Replace<kubevirt_redfish_route>with your route hostname and<vm_namespace>with the namespace containing your VMs. -
bootMACAddressmust match the MAC address assigned to the network interface on the corresponding control plane VM. When using DHCP, ensure this MAC has a reserved IP address configured in your DHCP server.
-
- Commit the manifests to your Git repository.
Apply the configuration through ArgoCD or your GitOps tooling.
ZTP generates the required resources and uses KubeVirt Redfish to provision the VMs automatically.
Verification
Monitor the cluster deployment from the hub cluster:
$ oc get managedcluster my-vcp-cluster $ oc get agentclusterinstall my-vcp-cluster -n my-vcp-cluster -o jsonpath='{.status.debugInfo.stateInfo}'
4.3. Deploying a virtualized control plane with installer-provisioned infrastructure Copia collegamentoCollegamento copiato negli appunti!
Use installer-provisioned infrastructure to deploy a virtualized control plane cluster. Installer-provisioned infrastructure provides full lifecycle management where the installation program automates hardware provisioning, power states, and cluster initialization.
Installer-provisioned infrastructure for virtualized control planes requires a provisioning network or a RHEL 9 provisioner node. Verify Installer-provisioned infrastructure support for virtualized control plane deployments with your Red Hat representative, as this combination may have additional requirements.
Prerequisites
- KubeVirt Redfish is installed and configured on the hosting cluster.
- Control plane VMs are created on the hosting cluster and powered off. In this state, the installation manages the VM power lifecycle and boot configuration through KubeVirt Redfish.
- A RHEL 9 provisioner node is available, or a provisioning network is configured.
- You have network access to the KubeVirt Redfish route.
Procedure
Create the
install-config.yamlfile with BMC addresses pointing to KubeVirt Redfish for the virtualized control plane nodes and real Redfish endpoints for the baremetal worker nodes:apiVersion: v1 metadata: name: my-vcp-cluster baseDomain: example.com controlPlane: architecture: amd64 hyperthreading: Enabled name: master replicas: 3 platform: baremetal: {} compute: - name: worker architecture: amd64 hyperthreading: Enabled replicas: 2 platform: baremetal: {} networking: networkType: OVNKubernetes clusterNetwork: - cidr: 10.128.0.0/14 hostPrefix: 23 serviceNetwork: - 172.30.0.0/16 machineNetwork: - cidr: 10.0.0.0/24 platform: baremetal: apiVIPs: - 10.0.0.10 ingressVIPs: - 10.0.0.11 provisioningNetwork: Disabled hosts: - name: master-0 role: master bootMACAddress: 52:54:00:00:00:01 bootMode: UEFI rootDeviceHints: deviceName: /dev/vda bmc: address: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-0 username: admin password: <password> disableCertificateVerification: false networkConfig: interfaces: - name: enp1s0 mac-address: 52:54:00:00:00:01 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: master-1 role: master bootMACAddress: 52:54:00:00:00:02 bootMode: UEFI rootDeviceHints: deviceName: /dev/vda bmc: address: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-1 username: admin password: <password> disableCertificateVerification: false networkConfig: interfaces: - name: enp1s0 mac-address: 52:54:00:00:00:02 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: master-2 role: master bootMACAddress: 52:54:00:00:00:03 bootMode: UEFI rootDeviceHints: deviceName: /dev/vda bmc: address: redfish-virtualmedia+https://<kubevirt_redfish_route>/redfish/v1/Systems/<vm_namespace>.control-plane-2 username: admin password: <password> disableCertificateVerification: false networkConfig: interfaces: - name: enp1s0 mac-address: 52:54:00:00:00:03 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: worker-0 role: worker bootMACAddress: e4:43:4b:00:00:01 bootMode: UEFI rootDeviceHints: deviceName: /dev/nvme0n1 bmc: address: redfish-virtualmedia+https://<worker_0_bmc_ip>/redfish/v1/Systems/System.Embedded.1 username: <bmc_username> password: <bmc_password> disableCertificateVerification: false networkConfig: interfaces: - name: ens1f0 mac-address: e4:43:4b:00:00:01 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true - name: worker-1 role: worker bootMACAddress: e4:43:4b:00:00:02 bootMode: UEFI rootDeviceHints: deviceName: /dev/nvme0n1 bmc: address: redfish-virtualmedia+https://<worker_1_bmc_ip>/redfish/v1/Systems/System.Embedded.1 username: <bmc_username> password: <bmc_password> disableCertificateVerification: false networkConfig: interfaces: - name: ens1f0 mac-address: e4:43:4b:00:00:02 type: ethernet state: up ipv4: enabled: true dhcp: true auto-dns: true ipv6: enabled: true pullSecret: '<pull_secret>' sshKey: '<ssh_public_key>'where:
-
platform: baremetalenables the installer to manage the control plane VMs through KubeVirt Redfish endpoints. -
apiVIPsandingressVIPsspecifies the virtual IP addresses that must be allocated from the machine network. TheapiVIPsmust reside on the same L2 network segment as the control plane VMs, and theingressVIPsmust reside on the same L2 network segment as the worker nodes. -
bootMACAddressmust match the MAC address of the network interface on the corresponding control plane VM. When using DHCP, ensure this MAC has a reserved IP address configured in your DHCP server. -
bmc.addressfor control plane nodes specifies the KubeVirt Redfish route. The<vm_namespace>.<vm_name>format corresponds to the enhanced system ID convention configured in KubeVirt Redfish. Replace<kubevirt_redfish_route>with your route hostname and<vm_namespace>with the namespace containing your VMs.
-
Run the installation by running the following command:
$ openshift-install create cluster --dir <installation_directory>The installation process uses KubeVirt Redfish to manage VM power states and boot configuration automatically.
Verification
After installation completes, verify the cluster is operational by running the following commands:
$ export KUBECONFIG=<installation_directory>/auth/kubeconfig $ oc get nodes