Simplifying and Automating Scaling of Bare Metal UPI OpenShift Clusters Using Metal3 (With Machine API) - Part 1

Simplifying and Automating Scaling of Bare Metal UPI OpenShift Clusters Using Metal3 (With Machine API) - Part 1


In article, we saw that an OpenShift Agent based installer simplifies Bare Metal UPI (User Provisioned Infrastructure) cluster installations in disconnected or air-gapped environments. Using Agent based installer, we first generated an ISO image containing required cluster and node configurations and then simply booted 3 control plane nodes using ISO to form an OpenShift cluster automatically. That was straightforward!!

Agent based Bare Metal UPI cluster installations (with platform set as baremetal) readily provides metal3 and Machine API resources and one of the metal3 resource known as “baremetalhosts”; short name “bmh or bmhost” along with Machine API simplifies the day-2 Scale Out operations for UPI clusters. metal3 bmh resource helps to scale a user-provisioned cluster in a more automated way. This approach requires baseboard management controller (BMC) access to the hosts.

"With OpenShift Container Platform 4.13, you can scale bare metal hosts in an existing user-provisioned infrastructure cluster without using Machine API. This is achieved by using the Bare Metal Operator (BMO) and other metal3 components. By using the Bare Metal Operator in a user-provisioned cluster, you can simplify and automate the management and scaling of hosts."

This article will focus scaling using Metal3 and Machine API for the UPI Bare Metal Cluster installed in previous article. In next article (Part 2), I will cover scaling existing UPI Bare Metal Clusters without using Machine API. Let's get started!

Previous cluster installed using Agent based installer already has metal3 and Machine API resources readily available for consumption or usage. We can see "Bare Metal Hosts" tab available in Compute section for host management.

No alt text provided for this image
Bare Metal Hosts

We also see that Machine API resources e.g. Machines, Worker MachineSets are readily available for consumption. Please navigate here for Machine API overview.

No alt text provided for this image
Machines

Currently there is no worker machine provisioned using MachineSets as one can see Machines count is 0.

No alt text provided for this image
MachineSets

Now, let's populate required configuration for first worker Bare Metal Host (ocp-agi-worker1) to be added into cluster. Here is the bmh-worker1.yaml. Replace bmc address value with your actual redfish-virtualmedia URL.

--
apiVersion: v1
kind: Secret
metadata:
?name: ocp-agi-worker1-network-config-secret
type: Opaque
stringData:
?nmstate: |
? interfaces:
? - name: enp1s0
??? type: ethernet
??? state: up
??? ipv4:
????? address:
????? - ip: 192.168.101.9
??????? prefix-length: 24
????? enabled: true
? dns-resolver:
??? config:
????? server:
????? - 192.168.101.1
? routes:
??? config:
??? - destination: 0.0.0.0/0
????? next-hop-address: 192.168.101.254
????? next-hop-interface: enp1s0
---
apiVersion: metal3.io/v1alpha1
kind: BareMetalHost
metadata:
? name: worker1.ocp-agi.ocpcluster.localnet
? namespace: openshift-machine-api
spec:
? online: true
? bootMACAddress: 52:54:00:25:29:96
? bmc:
??? address: <<Place your redfish-virtualmedia url here>>
??? credentialsName: ocp-agi-bmc-secret
??? disableCertificateVerification: True        


# oc create -f bmh-worker1.yaml        

As soon as BareMetalHost resource is created, hardware inspection on worker1 host starts and completes successfully in some time. Soon after that, Bare Metal Host worker1 becomes available for image provisioning in next step.

No alt text provided for this image
No alt text provided for this image

Now its time to increase machine count in worker MachineSets, this triggers Image provisioning on host disk as seen in following screenshots:-

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image

Here we allow some time for following things to complete automatically.

  • Machine to be provisioned as Node.
  • Node is registered in Controller and successfully added into cluster.


No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


That's it. We just completed cluster scale out by adding 1 Bare Metal worker host automatically using Machine API and Metal3/BareMetalHost resource. In similar fashion, we can scale multiple Bare Metal Hosts simultaneously by increasing Machines Count in MachineSets accordingly. Only thing is you must have baseboard management controller (BMC) access to those hosts.

Conclusion

metal3 and Machine API resources are readily available for consumption in user-provisioned infrastructure (UPI) cluster created using Agent based installer (with platform set as baremetal) and we can leverage those to scale out worker hosts automatically in UPI clusters. This approach helps to you to scale a user-provisioned cluster quickly and in a more automated way.

With OpenShift Container Platform 4.13, you can scale bare metal hosts in an existing user-provisioned infrastructure clusters without using Machine API. We will see that in Part 2 of this Blog.

References

Bare metal host provisioning for Kubernetes

Scaling a user-provisioned cluster with the Bare Metal Operator

Manisha Singh

Transformation Coach | Leadership Development | Creating Safe Spaces for Personal & Professional Development | Human-Centric Leadership | Storytelling for Leadership Development | Championing Self-Awareness in Leadership

1 年

?? your passion shines through the article Anuvrat!

回复
Yatin Bhardwaj

General Manager - AI platform solution (NVIDIA/AMD), Cloud Engineering, Edge Computing, Openshift, Openstack.

1 年

Amazing article Anuvrat Sharma ????

回复

要查看或添加评论,请登录

Anuvrat Sharma的更多文章

社区洞察

其他会员也浏览了