Disrupting OpenShift — Part 2
Introduction
In my last blog, I talked about what happen when I destroy the master Machines CR in an OpenShift 4.1 cluster (https://medium.com/@epatro/disrupting-openshift-part-1-2ba73ef8b46c).
In my experiment, OpenShift didn’t create a new master, as there is no MachineSet associated with the master Machines.
In this blog, I will talk how to recreate an OpenShift master. It’s pretty simple.
Rebuilding a master
My environment is in danger, as I am running with just 2 masters, and if anything happens with one master, OpenShift would simply halt (until most masters are available).
So, let’s rebuild the third master. Again, I follow the concept of Machine CR to create the VM.
First, I need the definition of a Machine CR that I can use to create a new one. So, I run the following commands to create the YAML file:
So now I have a YAML file with the master-1 definition, which I can modify to create the master-0. I just changed metadata.name and ran the following command:
oc create -f master1.yaml
Then I can confirm the machine master-0 has been created:
After a few minutes, I can confirm OpenShift has created a new master:
Voilà: environment restored, with 3 master nodes.
Conclusion
The use of the Machine CR makes very simple to add infrastructure (VMs) to an OpenShift environment.
In this article, I showed how a master node can be created when one is accidentally (or intentionally) destroyed.
Bring your plan to the IBM Garage.
Are you ready to learn more about working with the IBM Garage? We’re here to help. Contact us today to schedule time to speak with a Garage expert about your next big idea. Learn about our IBM Garage Method, the design, development and startup communities we work in, and the deep expertise and capabilities we bring to the table.
Schedule a no-charge visit with the IBM Garage.