|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * windows_containers/creating_windows_machinesets/creating-windows-machineset-gcp.adoc |
| 4 | + |
| 5 | +[id="windows-machineset-gcp_{context}"] |
| 6 | += Sample YAML for a Windows MachineSet object on GCP |
| 7 | + |
| 8 | +This sample YAML file defines a Windows `MachineSet` object running on Google Cloud Platform (GCP) that the Windows Machine Config Operator (WMCO) can use. |
| 9 | + |
| 10 | +[source,yaml] |
| 11 | +---- |
| 12 | +apiVersion: machine.openshift.io/v1beta1 |
| 13 | +kind: MachineSet |
| 14 | +metadata: |
| 15 | + labels: |
| 16 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 17 | + name: <infrastructure_id>-windows-worker-<zone_suffix> <2> |
| 18 | + namespace: openshift-machine-api |
| 19 | +spec: |
| 20 | + replicas: 1 |
| 21 | + selector: |
| 22 | + matchLabels: |
| 23 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 24 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-windows-worker-<zone_suffix> <2> |
| 25 | + template: |
| 26 | + metadata: |
| 27 | + labels: |
| 28 | + machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1> |
| 29 | + machine.openshift.io/cluster-api-machine-role: worker |
| 30 | + machine.openshift.io/cluster-api-machine-type: worker |
| 31 | + machine.openshift.io/cluster-api-machineset: <infrastructure_id>-windows-worker-<zone_suffix> <2> |
| 32 | + machine.openshift.io/os-id: Windows <3> |
| 33 | + spec: |
| 34 | + metadata: |
| 35 | + labels: |
| 36 | + node-role.kubernetes.io/worker: "" <4> |
| 37 | + providerSpec: |
| 38 | + value: |
| 39 | + apiVersion: machine.openshift.io/v1beta1 |
| 40 | + canIPForward: false |
| 41 | + credentialsSecret: |
| 42 | + name: gcp-cloud-credentials |
| 43 | + deletionProtection: false |
| 44 | + disks: |
| 45 | + - autoDelete: true |
| 46 | + boot: true |
| 47 | + image: <windows_server_image> <5> |
| 48 | + sizeGb: 128 |
| 49 | + type: pd-ssd |
| 50 | + kind: GCPMachineProviderSpec |
| 51 | + machineType: n1-standard-4 |
| 52 | + networkInterfaces: |
| 53 | + - network: <infrastructure_id>-network <1> |
| 54 | + subnetwork: <infrastructure_id>-worker-subnet |
| 55 | + projectID: <project_id> <6> |
| 56 | + region: <region> <7> |
| 57 | + serviceAccounts: |
| 58 | + - email: <infrastructure_id>-w@<project_id>.iam.gserviceaccount.com |
| 59 | + scopes: |
| 60 | + - https://www.googleapis.com/auth/cloud-platform |
| 61 | + tags: |
| 62 | + - <infrastructure_id>-worker |
| 63 | + userDataSecret: |
| 64 | + name: windows-user-data <8> |
| 65 | + zone: <zone> <9> |
| 66 | +---- |
| 67 | +<1> Specify the infrastructure ID that is based on the cluster ID that you set when you provisioned the cluster. You can obtain the infrastructure ID by running the following command: |
| 68 | ++ |
| 69 | +[source,terminal] |
| 70 | +---- |
| 71 | +$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster |
| 72 | +---- |
| 73 | +<2> Specify the infrastructure ID, worker label, and zone suffix (such as `a`). |
| 74 | +<3> Configure the machine set as a Windows machine. |
| 75 | +<4> Configure the Windows node as a compute machine. |
| 76 | +<5> Specify the full path to an image of a supported version of Windows Server. |
| 77 | +<6> Specify the GCP project that this cluster was created in. |
| 78 | +<7> Specify the GCP region, such as `us-central1`. |
| 79 | +<8> Created by the WMCO when it configures the first Windows machine. After that, the `windows-user-data` is available for all subsequent machine sets to consume. |
| 80 | +<9> Specify the zone within the chosen region, such as `us-central1-a`. |
0 commit comments