|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * machine_management/creating-infrastructure-machinesets.adoc |
| 4 | +// * machine_management/creating_machinesets/creating-machineset-nutanix.adoc |
| 5 | + |
| 6 | +ifeval::["{context}" == "creating-infrastructure-machinesets"] |
| 7 | +:infra: |
| 8 | +endif::[] |
| 9 | + |
| 10 | +:_content-type: REFERENCE |
| 11 | +[id="machineset-yaml-nutanix_{context}"] |
| 12 | += Sample YAML for a machine set custom resource on Nutanix |
| 13 | + |
| 14 | +This sample YAML defines a Nutanix machine set that 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 | + labels: |
| 29 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 30 | +ifndef::infra[] |
| 31 | + machine.openshift.io/cluster-api-machine-role: <role> <2> |
| 32 | + machine.openshift.io/cluster-api-machine-type: <role> <2> |
| 33 | + name: <infrastructure_id>-<role>-<zone> <3> |
| 34 | +endif::infra[] |
| 35 | +ifdef::infra[] |
| 36 | + machine.openshift.io/cluster-api-machine-role: <infra> <2> |
| 37 | + machine.openshift.io/cluster-api-machine-type: <infra> <2> |
| 38 | + name: <infrastructure_id>-<infra>-<zone> <3> |
| 39 | +endif::infra[] |
| 40 | + namespace: openshift-machine-api |
| 41 | + annotations: <4> |
| 42 | + machine.openshift.io/memoryMb: "16384" |
| 43 | + machine.openshift.io/vCPU: "4" |
| 44 | +spec: |
| 45 | + replicas: 3 |
| 46 | + selector: |
| 47 | + matchLabels: |
| 48 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 49 | +ifndef::infra[] |
| 50 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<zone> <3> |
| 51 | +endif::infra[] |
| 52 | +ifdef::infra[] |
| 53 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<infra>-<zone> <3> |
| 54 | +endif::infra[] |
| 55 | + template: |
| 56 | + metadata: |
| 57 | + labels: |
| 58 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 59 | +ifndef::infra[] |
| 60 | + machine.openshift.io/cluster-api-machine-role: <role> <2> |
| 61 | + machine.openshift.io/cluster-api-machine-type: <role> <2> |
| 62 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<role>-<zone> <3> |
| 63 | +endif::infra[] |
| 64 | +ifdef::infra[] |
| 65 | + machine.openshift.io/cluster-api-machine-role: <infra> <2> |
| 66 | + machine.openshift.io/cluster-api-machine-type: <infra> <2> |
| 67 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-<infra>-<zone> <3> |
| 68 | +endif::infra[] |
| 69 | + spec: |
| 70 | + metadata: |
| 71 | + labels: |
| 72 | +ifndef::infra[] |
| 73 | + node-role.kubernetes.io/<role>: "" |
| 74 | +endif::infra[] |
| 75 | +ifdef::infra[] |
| 76 | + node-role.kubernetes.io/infra: "" |
| 77 | +endif::infra[] |
| 78 | + providerSpec: |
| 79 | + value: |
| 80 | + apiVersion: machine.openshift.io/v1 |
| 81 | + cluster: |
| 82 | + type: uuid |
| 83 | + uuid: <cluster_uuid> |
| 84 | + credentialsSecret: |
| 85 | + name: nutanix-creds-secret |
| 86 | + image: |
| 87 | + name: <infrastructure_id>-rhcos <5> |
| 88 | + type: name |
| 89 | + kind: NutanixMachineProviderConfig |
| 90 | + memorySize: 16Gi <6> |
| 91 | + subnets: |
| 92 | + - type: uuid |
| 93 | + uuid: <subnet_uuid> |
| 94 | + systemDiskSize: 120Gi <7> |
| 95 | + userDataSecret: |
| 96 | + name: <user_data_secret> <8> |
| 97 | + vcpuSockets: 4 <9> |
| 98 | + vcpusPerSocket: 1 <10> |
| 99 | +ifdef::infra[] |
| 100 | + taints: <11> |
| 101 | + - key: node-role.kubernetes.io/infra |
| 102 | + effect: NoSchedule |
| 103 | +endif::infra[] |
| 104 | +---- |
| 105 | +<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: |
| 106 | ++ |
| 107 | +[source,terminal] |
| 108 | +---- |
| 109 | +$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster |
| 110 | +---- |
| 111 | +ifndef::infra[] |
| 112 | +<2> Specify the node label to add. |
| 113 | +<3> Specify the infrastructure ID, node label, and zone. |
| 114 | +endif::infra[] |
| 115 | +ifdef::infra[] |
| 116 | +<2> Specify the `<infra>` node label. |
| 117 | +<3> Specify the infrastructure ID, `<infra>` node label, and zone. |
| 118 | +endif::infra[] |
| 119 | +<4> Annotations for the cluster autoscaler. |
| 120 | +<5> Specify the image to use. Use an image from an existing default machine set for the cluster. |
| 121 | +<6> Specify the amount of memory for the cluster in Gi. |
| 122 | +<7> Specify the size of the system disk in Gi. |
| 123 | +<8> Specify the name of the secret in the user data YAML file that is in the `openshift-machine-api` namespace. Use the value that the installer populates in the default machine set. |
| 124 | +<9> Specify the number of vCPU sockets. |
| 125 | +<10> Specify the number of vCPUs per socket. |
| 126 | +ifdef::infra[] |
| 127 | +<11> Specify a taint to prevent user workloads from being scheduled on infra nodes. |
| 128 | +endif::infra[] |
| 129 | + |
| 130 | +ifeval::["{context}" == "creating-infrastructure-machinesets"] |
| 131 | +:!infra: |
| 132 | +endif::[] |
| 133 | +ifeval::["{context}" == "cluster-tasks"] |
| 134 | +:!infra: |
| 135 | +endif::[] |
0 commit comments