
If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.
I like to think of a machine as OpenShift representation of a Virtual Machine, such as an Amazon Web Services (AWS) EC2 Instance, or a VMWare Virtual Machine, and then a Node, and then the pods running on the node. Machine Configs can be used to configure the Virtual Machine Operating System, such as configuring a Linux systemd service such as sshd or chronyd or Network Manager.
The oc get machines command can be used to display the machines. The machines should be in the openshift-machine-api namespace.
~]$ oc get machines --namespace openshift-machine-api
NAME PHASE TYPE REGION ZONE AGE
lab001-edge-lm6wz Running 140d
lab001-edge-pmlls Running 140d
lab001-infra-c4v5h Running 140d
lab001-infra-mc8rc Running 140d
lab001-infra-p9cjv Running 140d
lab001-master-0 Running 143d
lab001-master-1 Running 143d
lab001-master-2 Running 143d
lab001-worker-hsjrp Running 140d
lab001-worker-v8r9r Running 140d
The -l or --selector option can be used to return machines that have a certain label.
oc get machines --namespace openshift-machine-api --selector machine.openshift.io/cluster-api-machine-type=worker
The -o yaml option can be used to output the YAML for the machine.
oc get machine/lab001-edge-lm6wz --namespace openshift-machine-api --output yaml
Which should return YAML that begins like this.
apiVersion: machine.openshift.io/v1beta1
kind: Machine
metadata:
annotations:
machine.openshift.io/instance-state: poweredOn
creationTimestamp: "2021-07-19T19:09:08Z"
finalizers:
- machine.machine.openshift.io
generateName: lab001-edge-
Did you find this article helpful?
If so, consider buying me a coffee over at