In a previous blog I discussed how one could provide Intelligent Platform Management Interface (IPMI) capabilities to a VmWare virtual machine. I also eluded to being able to deploy OpenShift Baremetal IPI on VmWare virtual machines given the IPMI requirement was met for the purpose of a non production lab scenario. However since I do not have enough lab equipment to run a full blown VmWare ESXi with enough virtual machines to mimic an OpenShift Baremetal IPI deployment, I will do the next best thing and demonstrate how to add a VmWare virtual machine acting as an OpenShift worker using the scale up capability.
Before we get started though lets review the lab setup for this exercise. The diagram below shows that we have a 3 master cluster on a RHEL KVM hypervisor node. These nodes while virtual are using VBMC to enable IPMI and hence the cluster was deployed as a OpenShift Baremetal IPI cluster. We have an additional worker we would like to add that resides on an ESXi hypervisor host. Using the virtualbmcforvsphere container (discussed in a previous blog) we can mimic IPMI for that worker node and thus treat it like a baremetal node.
Now that we have an understanding of the lab layout lets get to adding the additional VmWare worker node to our cluster. The first step is to create the vmware-bmh.yaml which will contain the secret information for the IPMI credentials base64 encoded and the baremetal host information:
$ cat << EOF > ~/vmware-bmh.yaml --- apiVersion: v1 kind: Secret metadata: name: worker-4-bmc-secret type: Opaque data: username: YWRtaW4= password: cGFzc3dvcmQ= --- apiVersion: metal3.io/v1alpha1 kind: BareMetalHost metadata: name: worker-4 spec: online: true bootMACAddress: 00:50:56:83:da:a1 bmc: address: ipmi://192.168.0.10:6801 credentialsName: worker-4-bmc-secret EOF
$ oc create -f vmware-bmh.yaml -n openshift-machine-api secret/worker-4-bmc-secret created baremetalhost.metal3.io/worker-4 created
$ oc get baremetalhosts -n openshift-machine-api NAME STATE CONSUMER ONLINE ERROR master-0 externally provisioned kni20-cmq65-master-0 true master-1 externally provisioned kni20-cmq65-master-1 true master-2 externally provisioned kni20-cmq65-master-2 true worker-4 registering true
$ oc get baremetalhosts -n openshift-machine-api NAME STATE CONSUMER ONLINE ERROR master-0 externally provisioned kni20-cmq65-master-0 true master-1 externally provisioned kni20-cmq65-master-1 true master-2 externally provisioned kni20-cmq65-master-2 true worker-4 inspecting true $ oc get baremetalhosts -n openshift-machine-api NAME STATE CONSUMER ONLINE ERROR master-0 externally provisioned kni20-cmq65-master-0 true master-1 externally provisioned kni20-cmq65-master-1 true master-2 externally provisioned kni20-cmq65-master-2 true worker-4 match profile true $ oc get baremetalhosts -n openshift-machine-api NAME STATE CONSUMER ONLINE ERROR master-0 externally provisioned kni20-cmq65-master-0 true master-1 externally provisioned kni20-cmq65-master-1 true master-2 externally provisioned kni20-cmq65-master-2 true worker-4 ready true
$ oc -n openshift-machine-api get machineset NAME DESIRED CURRENT READY AVAILABLE AGE kni20-cmq65-worker-0 0 0 17h $ oc -n openshift-machine-api scale machineset kni20-cmq65-worker-0 --replicas=1 machineset.machine.openshift.io/kni20-cmq65-worker-0 scaled
$ oc get baremetalhosts -n openshift-machine-api NAME STATE CONSUMER ONLINE ERROR master-0 externally provisioned kni20-cmq65-master-0 true master-1 externally provisioned kni20-cmq65-master-1 true master-2 externally provisioned kni20-cmq65-master-2 true worker-4 provisioning kni20-cmq65-worker-0-lhd92 true
$ oc get baremetalhosts -n openshift-machine-api NAME STATE CONSUMER ONLINE ERROR master-0 externally provisioned kni20-cmq65-master-0 true master-1 externally provisioned kni20-cmq65-master-1 true master-2 externally provisioned kni20-cmq65-master-2 true worker-4 provisioned kni20-cmq65-worker-0-lhd92 true
$ oc get nodes NAME STATUS ROLES AGE VERSION master-0.kni20.schmaustech.com Ready master,worker 17h v1.22.0-rc.0+a44d0f0 master-1.kni20.schmaustech.com Ready master,worker 17h v1.22.0-rc.0+a44d0f0 master-2.kni20.schmaustech.com Ready master,worker 17h v1.22.0-rc.0+a44d0f0 worker-4.kni20.schmaustech.com NotReady worker 39s v1.22.0-rc.0+a44d0f0
$ oc get nodes NAME STATUS ROLES AGE VERSION master-0.kni20.schmaustech.com Ready master,worker 17h v1.22.0-rc.0+a44d0f0 master-1.kni20.schmaustech.com Ready master,worker 17h v1.22.0-rc.0+a44d0f0 master-2.kni20.schmaustech.com Ready master,worker 17h v1.22.0-rc.0+a44d0f0 worker-4.kni20.schmaustech.com Ready worker 58s v1.22.0-rc.0+a44d0f0