Creating a MachineSet to build and scale nodes on VMware 6.7U3 and OCP 4.6
Ref:
YouTube Video https://youtu.be/3no-WT557ls
OCP Documentation - https://docs.openshift.com/container-platform/4.6/machine_management/creating-infrastructure-machinesets.html
I usually recommend backing up a copy of one of your worker mainifest during install time to make this a bit easier, but you can use the templates found in the documentation to create your instance(s), per your environment.
-
Retrieve your unique infrastrutor id.
oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
-
Edit (or Create) your MachineSet yaml.
vi 99_openshift-cluster-api_worker-machineset-0.yaml
-
In VMware, pay particutlar attention to the "workspace" section. In my video, I said that I did not have a "Resource Pool" so I had to remove that section. Otherwise the information will be what you completed as part of your install-config.yaml.
workspace: datacenter: <vcenter_datacenter_name> datastore: <vcenter_datastore_name> folder: <vcenter_vm_folder_path> resourcepool: <vsphere_resource_pool> server: <vcenter_server_ip
-
You also should include a label for your machine "role", here again I was using "infra" in the video. If you do not include a specific role, it will default to "worker".
spec: metadata: labels: node-role.kubernetes.io/<role>: ""
-
Verify your compute values...
diskGiB: 120 memoryMiB: 8192 numCPUs: 4 numCoresPerSocket: 1 network: devices: - networkName: "<vm_network_name>"
and your template name... ie, the VM cloning source image name.
template: <vm_template_name>
-
Make sure your userDataSecret remains unchanged since it holds the ignition data.
userDataSecret: name: worker-user-data
-
Install your MachineSet
oc create -f 99_openshift-cluster-api_worker-machineset-0.yaml
-
Access the UI and increment your # of Machines or set the replica value
Scale by OC...
a. View your machinesets
oc get machinesets -n openshift-machine-api
b. Scale the machineset
oc scale --replicas=${#} machineset ${machinesetname} -n openshift-machine-api