|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * machine_management/creating-infrastructure-machinesets.adoc |
| 4 | +// * machine_management/creating_machinesets/creating-machineset-bare-metal.adoc |
| 5 | + |
| 6 | +ifeval::["{context}" == "creating-infrastructure-machinesets"] |
| 7 | +:infra: |
| 8 | +endif::[] |
| 9 | + |
| 10 | +:_content-type: REFERENCE |
| 11 | +[id="machineset-yaml-vsphere_{context}"] |
| 12 | += Sample YAML for a compute machine set custom resource on bare metal |
| 13 | + |
| 14 | +This sample YAML defines a compute machine set that runs on bare metal and creates nodes that are labeled with |
| 15 | +ifndef::infra[`node-role.kubernetes.io/<role>: ""`.] |
| 16 | +ifdef::infra[`node-role.kubernetes.io/infra: ""`.] |
| 17 | + |
| 18 | +In this sample, `<infrastructure_id>` is the infrastructure ID label that is based on the cluster ID that you set when you provisioned the cluster, and |
| 19 | +ifndef::infra[`<role>`] |
| 20 | +ifdef::infra[`<infra>`] |
| 21 | +is the node label to add. |
| 22 | + |
| 23 | +[source,yaml] |
| 24 | +---- |
| 25 | +apiVersion: machine.openshift.io/v1beta1 |
| 26 | +kind: MachineSet |
| 27 | +metadata: |
| 28 | + creationTimestamp: null |
| 29 | + labels: |
| 30 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 31 | +ifndef::infra[] |
| 32 | + name: <infrastructure_id>-<role> <2> |
| 33 | +endif::infra[] |
| 34 | +ifdef::infra[] |
| 35 | + name: <infrastructure_id>-infra <2> |
| 36 | +endif::infra[] |
| 37 | + namespace: openshift-machine-api |
| 38 | +spec: |
| 39 | + replicas: 1 |
| 40 | + selector: |
| 41 | + matchLabels: |
| 42 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 43 | +ifndef::infra[] |
| 44 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role> <2> |
| 45 | +endif::infra[] |
| 46 | +ifdef::infra[] |
| 47 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra <2> |
| 48 | +endif::infra[] |
| 49 | + template: |
| 50 | + metadata: |
| 51 | + creationTimestamp: null |
| 52 | + labels: |
| 53 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 54 | +ifndef::infra[] |
| 55 | + machine.openshift.io/cluster-api-machine-role: <role> <3> |
| 56 | + machine.openshift.io/cluster-api-machine-type: <role> <3> |
| 57 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role> <2> |
| 58 | +endif::infra[] |
| 59 | +ifdef::infra[] |
| 60 | + machine.openshift.io/cluster-api-machine-role: <infra> <3> |
| 61 | + machine.openshift.io/cluster-api-machine-type: <infra> <3> |
| 62 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-infra <2> |
| 63 | +endif::infra[] |
| 64 | + spec: |
| 65 | + metadata: |
| 66 | + creationTimestamp: null |
| 67 | + labels: |
| 68 | +ifndef::infra[] |
| 69 | + node-role.kubernetes.io/<role>: "" <3> |
| 70 | +endif::infra[] |
| 71 | +ifdef::infra[] |
| 72 | + node-role.kubernetes.io/infra: "" <3> |
| 73 | + taints: <4> |
| 74 | + - key: node-role.kubernetes.io/infra |
| 75 | + effect: NoSchedule |
| 76 | +endif::infra[] |
| 77 | + providerSpec: |
| 78 | + value: |
| 79 | + apiVersion: baremetal.cluster.k8s.io/v1alpha1 |
| 80 | + hostSelector: {} |
| 81 | + image: |
| 82 | + checksum: http:/172.22.0.3:6181/images/rhcos-<version>.<architecture>.qcow2.<md5sum> <4> |
| 83 | + url: http://172.22.0.3:6181/images/rhcos-<version>.<architecture>.qcow2 <5> |
| 84 | + kind: BareMetalMachineProviderSpec |
| 85 | + metadata: |
| 86 | + creationTimestamp: null |
| 87 | + userData: |
| 88 | + name: worker-user-data |
| 89 | +---- |
| 90 | +<1> Specify the infrastructure ID that is based on the cluster ID that you set when you provisioned the cluster. If you have the OpenShift CLI (`oc`) installed, you can obtain the infrastructure ID by running the following command: |
| 91 | ++ |
| 92 | +[source,terminal] |
| 93 | +---- |
| 94 | +$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster |
| 95 | +---- |
| 96 | +ifndef::infra[] |
| 97 | +<2> Specify the infrastructure ID and node label. |
| 98 | +<3> Specify the node label to add. |
| 99 | +<4> Edit the `checksum` URL to use the API VIP address. |
| 100 | +<5> Edit the `url` URL to use the API VIP address. |
| 101 | +endif::infra[] |
| 102 | + |
| 103 | +ifeval::["{context}" == "creating-infrastructure-machinesets"] |
| 104 | +:!infra: |
| 105 | +endif::[] |
| 106 | +ifeval::["{context}" == "cluster-tasks"] |
| 107 | +:!infra: |
| 108 | +endif::[] |
0 commit comments