<commit_before>/ Module included in the following assemblies:
//
// * machine_management/creating-infrastructure-machinesets.adoc
// * machine_management/creating-machineset-gcp.adoc

[id="machineset-yaml-gcp_{context}"]
=  Sample YAML for a MachineSet Custom Resource on GCP

This sample YAML defines a MachineSet that runs in Google Cloud Platform (GCP_
and creates nodes that are labeled with `node-role.kubernetes.io/<role>: ""`

In this sample, `<infrastructureID>` is the infrastructure ID label that is
based on the cluster ID that you set when you provisioned
the cluster, and `<role>` is the node label to add.

[source,yaml]
----
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
  labels:
    machine.openshift.io/cluster-api-cluster: <infrastructureID> <1>
  name: <infrastructureID>-w-a <2>
  namespace: openshift-machine-api
spec:
  replicas: 1
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: <infrastructureID> <1>
      machine.openshift.io/cluster-api-machineset: <infrastructureID>-w-a <2>
  template:
    metadata:
      creationTimestamp: null
      labels:
        machine.openshift.io/cluster-api-cluster: <infrastructureID> <1>
        machine.openshift.io/cluster-api-machine-role: worker
        machine.openshift.io/cluster-api-machine-type: worker
        machine.openshift.io/cluster-api-machineset: <infrastructureID>-w-a <2>
    spec:
      metadata:
        labels:
          node-role.kubernetes.io/<role>: "" <3>
      providerSpec:
        value:
          apiVersion: gcpprovider.openshift.io/v1beta1
          canIPForward: false
          credentialsSecret:
            name: gcp-cloud-credentials
          deletionProtection: false
          disks:
          - autoDelete: true
            boot: true
            image: <infrastructureID>-rhcos-image <1>
            labels: null
            sizeGb: 128
            type: pd-ssd
          kind: GCPMachineProviderSpec
          machineType: n1-standard-4
          metadata:
            creationTimestamp: null
          networkInterfaces:
          - network: <infrastructureID>-network
            subnetwork: <infrastructureID>-worker-subnet <1>
          projectID: openshift-gce-devel
          region: us-central1
          serviceAccounts:
          - email: <<EMAIL> <1>
            scopes:
            - https://www.googleapis.com/auth/cloud-platform
          tags:
          - <infrastructureID>-<role> <2>
          userDataSecret:
            name: worker-user-data
          zone: us-central1-a
----
<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 and `jq`
package installed, you can obtain the infrastructure ID by running the following
command:
+
----
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
----
<2> Specify the infrastructure ID and node label.
<3> Specify the node label to add.<commit_msg>OSDOCS-478 updates to GCP machinesets<commit_after>// Module included in the following assemblies:
//
// * machine_management/creating-infrastructure-machinesets.adoc
// * machine_management/creating-machineset-gcp.adoc

[id="machineset-yaml-gcp_{context}"]
=  Sample YAML for a MachineSet Custom Resource on GCP

This sample YAML defines a MachineSet that runs in Google Cloud Platform (GCP)
and creates nodes that are labeled with `node-role.kubernetes.io/<role>: ""`

In this sample, `<infrastructureID>` is the infrastructure ID label that is
based on the cluster ID that you set when you provisioned
the cluster, and `<role>` is the node label to add.

[source,yaml]
----
apiVersion: machine.openshift.io/v1beta1
kind: MachineSet
metadata:
  labels:
    machine.openshift.io/cluster-api-cluster: <infrastructureID> <1>
  name: <infrastructureID>-w-a <1>
  namespace: openshift-machine-api
spec:
  replicas: 1
  selector:
    matchLabels:
      machine.openshift.io/cluster-api-cluster: <infrastructureID> <1>
      machine.openshift.io/cluster-api-machineset: <infrastructureID>-w-a <1>
  template:
    metadata:
      creationTimestamp: null
      labels:
        machine.openshift.io/cluster-api-cluster: <infrastructureID> <1>
        machine.openshift.io/cluster-api-machine-role: <role> <3>
        machine.openshift.io/cluster-api-machine-type: <role> <3>
        machine.openshift.io/cluster-api-machineset: <infrastructureID>-w-a <1>
    spec:
      metadata:
        labels:
          node-role.kubernetes.io/<role>: "" <3>
      providerSpec:
        value:
          apiVersion: gcpprovider.openshift.io/v1beta1
          canIPForward: false
          credentialsSecret:
            name: gcp-cloud-credentials
          deletionProtection: false
          disks:
          - autoDelete: true
            boot: true
            image: <infrastructureID>-rhcos-image <1>
            labels: null
            sizeGb: 128
            type: pd-ssd
          kind: GCPMachineProviderSpec
          machineType: n1-standard-4
          metadata:
            creationTimestamp: null
          networkInterfaces:
          - network: <infrastructureID>-network <1>
            subnetwork: <infrastructureID>-<role>-subnet <2>
          projectID: <project_name> <4>
          region: us-central1
          serviceAccounts:
          - email: <<EMAIL>>-<EMAIL> <1>
            scopes:
            - https://www.googleapis.com/auth/cloud-platform
          tags:
          - <infrastructureID>-<role> <2>
          userDataSecret:
            name: worker-user-data
          zone: us-central1-a
----
<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 and `jq`
package installed, you can obtain the infrastructure ID by running the following
command:
+
----
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
----
<2> Specify the infrastructure ID and node label.
<3> Specify the node label to add.
<4> Specify the name of the GCP project that you use for your cluster.
{'fraction_non_alphanumeric': 0.10036196117143797, 'fraction_numerical': 0.009871668311944718, 'mean_word_length': 2.5949142519219395, 'pattern_counts': {'":': 0, '<': 75, '<?xml version=': 0, '>': 74, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3723882', 'n_tokens_mistral': 1842, 'n_tokens_neox': 1754, 'n_words': 493}