Skip to content

Commit 2d5eaf6

Browse files
authored
Merge pull request #52429 from jeana-redhat/OSDOCS-2971-mapi-gcp-marketplace-images
[OSDOCS-2971]: use GCP Marketplace image via machineset
2 parents 6801b91 + 270efad commit 2d5eaf6

File tree

1 file changed

+34
-55
lines changed

1 file changed

+34
-55
lines changed

modules/machineset-yaml-gcp.adoc

Lines changed: 34 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -27,39 +27,36 @@ kind: MachineSet
2727
metadata:
2828
labels:
2929
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
30-
name: <infrastructure_id>-w-a <1>
30+
name: <infrastructure_id>-w-a
3131
namespace: openshift-machine-api
3232
spec:
3333
replicas: 1
3434
selector:
3535
matchLabels:
36-
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
37-
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-w-a <1>
36+
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
37+
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-w-a
3838
template:
3939
metadata:
4040
creationTimestamp: null
4141
labels:
42-
machine.openshift.io/cluster-api-cluster: <infrastructure_id> <1>
42+
machine.openshift.io/cluster-api-cluster: <infrastructure_id>
4343
ifndef::infra[]
4444
machine.openshift.io/cluster-api-machine-role: <role> <2>
45-
machine.openshift.io/cluster-api-machine-type: <role> <2>
45+
machine.openshift.io/cluster-api-machine-type: <role>
4646
endif::infra[]
4747
ifdef::infra[]
4848
machine.openshift.io/cluster-api-machine-role: <infra> <2>
49-
machine.openshift.io/cluster-api-machine-type: <infra> <2>
49+
machine.openshift.io/cluster-api-machine-type: <infra>
5050
endif::infra[]
51-
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-w-a <1>
51+
machine.openshift.io/cluster-api-machineset: <infrastructure_id>-w-a
5252
spec:
5353
metadata:
5454
labels:
5555
ifndef::infra[]
56-
node-role.kubernetes.io/<role>: "" <2>
56+
node-role.kubernetes.io/<role>: ""
5757
endif::infra[]
5858
ifdef::infra[]
59-
node-role.kubernetes.io/infra: "" <2>
60-
taints: <3>
61-
- key: node-role.kubernetes.io/infra
62-
effect: NoSchedule
59+
node-role.kubernetes.io/infra: ""
6360
endif::infra[]
6461
providerSpec:
6562
value:
@@ -71,60 +68,49 @@ endif::infra[]
7168
disks:
7269
- autoDelete: true
7370
boot: true
74-
ifndef::infra[]
7571
image: <path_to_image> <3>
76-
endif::infra[]
77-
ifdef::infra[]
78-
image: <path_to_image> <4>
79-
endif::infra[]
8072
labels: null
8173
sizeGb: 128
8274
type: pd-ssd
83-
ifndef::infra[]
8475
gcpMetadata: <4>
85-
endif::infra[]
86-
ifdef::infra[]
87-
gcpMetadata: <5>
88-
endif::infra[]
8976
- key: <custom_metadata_key>
9077
value: <custom_metadata_value>
9178
kind: GCPMachineProviderSpec
9279
machineType: n1-standard-4
9380
metadata:
9481
creationTimestamp: null
9582
networkInterfaces:
96-
- network: <infrastructure_id>-network <1>
97-
subnetwork: <infrastructure_id>-worker-subnet <1>
98-
ifndef::infra[]
83+
- network: <infrastructure_id>-network
84+
subnetwork: <infrastructure_id>-worker-subnet
9985
projectID: <project_name> <5>
100-
endif::infra[]
101-
ifdef::infra[]
102-
projectID: <project_name> <6>
103-
endif::infra[]
10486
region: us-central1
10587
serviceAccounts:
106-
ifndef::infra[]
107-
- email: <infrastructure_id>-w@<project_name>.iam.gserviceaccount.com <1> <5>
108-
endif::infra[]
109-
ifdef::infra[]
110-
- email: <infrastructure_id>-w@<project_name>.iam.gserviceaccount.com <1> <6>
111-
endif::infra[]
88+
- email: <infrastructure_id>-w@<project_name>.iam.gserviceaccount.com
11289
scopes:
11390
- https://www.googleapis.com/auth/cloud-platform
11491
tags:
115-
- <infrastructure_id>-worker <1>
92+
- <infrastructure_id>-worker
11693
userDataSecret:
11794
name: worker-user-data
11895
zone: us-central1-a
96+
ifdef::infra[]
97+
taints: <6>
98+
- key: node-role.kubernetes.io/infra
99+
effect: NoSchedule
100+
endif::infra[]
119101
----
120-
<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 installed, you can obtain the infrastructure ID by running the following command:
102+
<1> For `<infrastructure_id>`, 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 installed, you can obtain the infrastructure ID by running the following command:
121103
+
122104
[source,terminal]
123105
----
124106
$ oc get -o jsonpath='{.status.infrastructureName}{"\n"}' infrastructure cluster
125107
----
126108
ifndef::infra[]
127-
<2> Specify the node label to add.
109+
<2> For `<node>`, specify the node label to add.
110+
endif::infra[]
111+
ifdef::infra[]
112+
<2> For `<infra>`, specify the `<infra>` node label.
113+
endif::infra[]
128114
<3> Specify the path to the image that is used in current compute machine sets. If you have the OpenShift CLI installed, you can obtain the path to the image by running the following command:
129115
+
130116
[source,terminal]
@@ -133,27 +119,20 @@ $ oc -n openshift-machine-api \
133119
-o jsonpath='{.spec.template.spec.providerSpec.value.disks[0].image}{"\n"}' \
134120
get machineset/<infrastructure_id>-worker-a
135121
----
122+
+
123+
To use a GCP Marketplace image, specify the offer to use:
124+
+
125+
--
126+
* {product-title}: `\https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-ocp-48-x86-64-202210040145`
127+
* {opp}: `\https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-opp-48-x86-64-202206140145`
128+
* {oke}: `\https://www.googleapis.com/compute/v1/projects/redhat-marketplace-public/global/images/redhat-coreos-oke-48-x86-64-202206140145`
129+
--
136130
<4> Optional: Specify custom metadata in the form of a `key:value` pair. For example use cases, see the GCP documentation for link:https://cloud.google.com/compute/docs/metadata/setting-custom-metadata[setting custom metadata].
137-
<5> Specify the name of the GCP project that you use for your cluster.
138-
endif::infra[]
131+
<5> For `<project_name>`, specify the name of the GCP project that you use for your cluster.
139132
ifdef::infra[]
140-
<2> Specify the `<infra>` node label.
141-
<3> Specify a taint to prevent user workloads from being scheduled on infra nodes.
142-
<4> Specify the path to the image that is used in current compute machine sets. If you have the OpenShift CLI installed, you can obtain the path to the image by running the following command:
143-
+
144-
[source,terminal]
145-
----
146-
$ oc -n openshift-machine-api \
147-
-o jsonpath='{.spec.template.spec.providerSpec.value.disks[0].image}{"\n"}' \
148-
get machineset/<infrastructure_id>-worker-a
149-
----
150-
<5> Optional: Specify custom metadata in the form of a `key:value` pair. For example use cases, see the GCP documentation for link:https://cloud.google.com/compute/docs/metadata/setting-custom-metadata[setting custom metadata].
151-
<6> Specify the name of the GCP project that you use for your cluster.
133+
<6> Specify a taint to prevent user workloads from being scheduled on infra nodes.
152134
endif::infra[]
153135

154136
ifeval::["{context}" == "creating-infrastructure-machinesets"]
155137
:!infra:
156138
endif::[]
157-
ifeval::["{context}" == "cluster-tasks"]
158-
:!infra:
159-
endif::[]

0 commit comments

Comments
 (0)