Skip to content

Commit 1c69ff9

Browse files
committed
Updated control plane module
1 parent 543f033 commit 1c69ff9

7 files changed

Lines changed: 75 additions & 85 deletions

installing/installing_gcp/installing-gcp-user-infra-vpc.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ include::modules/installation-infrastructure-manager-bootstrap.adoc[leveloffset=
143143

144144
include::modules/installation-creating-gcp-control-plane.adoc[leveloffset=+1]
145145

146-
include::modules/installation-deployment-manager-control-plane.adoc[leveloffset=+2]
146+
include::modules/installation-infrastructure-manager-control-plane.adoc[leveloffset=+2]
147147

148148
// Removing bootstrap resources in GCP
149149
include::modules/installation-gcp-user-infra-wait-for-bootstrap.adoc[leveloffset=+1]

installing/installing_gcp/installing-gcp-user-infra.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ include::modules/installation-infrastructure-manager-bootstrap.adoc[leveloffset=
148148

149149
include::modules/installation-creating-gcp-control-plane.adoc[leveloffset=+1]
150150

151-
include::modules/installation-deployment-manager-control-plane.adoc[leveloffset=+2]
151+
include::modules/installation-infrastructure-manager-control-plane.adoc[leveloffset=+2]
152152

153153
// Removing bootstrap resources in GCP
154154
include::modules/installation-gcp-user-infra-wait-for-bootstrap.adoc[leveloffset=+1]

installing/installing_gcp/installing-restricted-networks-gcp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ include::modules/installation-infrastructure-manager-bootstrap.adoc[leveloffset=
147147

148148
include::modules/installation-creating-gcp-control-plane.adoc[leveloffset=+1]
149149

150-
include::modules/installation-deployment-manager-control-plane.adoc[leveloffset=+2]
150+
include::modules/installation-infrastructure-manager-control-plane.adoc[leveloffset=+2]
151151

152152
include::modules/installation-gcp-user-infra-wait-for-bootstrap.adoc[leveloffset=+1]
153153

modules/installation-creating-gcp-bootstrap.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ If you do not use the provided Deployment Manager template to create your bootst
2525

2626
. Copy the template from the *Infrastructure Manager template for the bootstrap machine* section of this topic and save it as `04_bootstrap.tf` in a folder called `04_bootstrap` on your computer. This template describes the bootstrap machine that your cluster requires.
2727

28-
.. You can edit the `04_bootstrap.tf` file to add additional tags to the bootstrap machine, by modifying the existing `tags` stanza as follows:
28+
** You can edit the `04_bootstrap.tf` file to add additional tags to the bootstrap machine, by modifying the existing `tags` stanza as follows:
2929
+
3030
[source,bash]
3131
----

modules/installation-creating-gcp-control-plane.adoc

Lines changed: 51 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4,122 +4,112 @@
44
// * installing/installing_gcp/installing-restricted-networks-gcp.adoc
55
// * installing/installing_gcp/installing-gcp-user-infra-vpc.adoc
66

7-
ifeval::["{context}" == "installing-gcp-user-infra-vpc"]
8-
:shared-vpc:
9-
endif::[]
10-
117
:_mod-docs-content-type: PROCEDURE
128
[id="installation-creating-gcp-control-plane_{context}"]
139
= Creating the control plane machines in {gcp-short}
1410

15-
You must create the control plane machines in {gcp-first} for
16-
your cluster to use. One way to create these machines is to modify the
17-
provided Deployment Manager template.
11+
[role="_abstract"]
12+
You must create the control plane machines in {gcp-first} for your cluster to use. One way to create these machines is to modify the provided Infrastructure Manager template.
1813

1914
[NOTE]
2015
====
21-
If you do not use the provided Deployment Manager template to create your
22-
control plane machines, you must review the provided information and manually
23-
create the infrastructure. If your cluster does not initialize correctly, you
24-
might have to contact Red Hat support with your installation logs.
16+
If you do not use the provided template to create your control plane machines, you must review the provided information and manually create the infrastructure. If your cluster does not initialize correctly, you might have to contact Red Hat support with your installation logs.
2517
====
2618

2719
.Prerequisites
2820

29-
* Ensure you defined the variables in the _Exporting common variables_, _Creating load balancers in {gcp-short}_, _Creating IAM roles in {gcp-short}_, and _Creating the bootstrap machine in {gcp-short}_ sections.
30-
* Create the bootstrap machine.
21+
* You defined the variables in the _Exporting common variables_, _Creating load balancers in {gcp-short}_, _Creating IAM roles in {gcp-short}_, and _Creating the bootstrap machine in {gcp-short}_ sections.
22+
* You created the bootstrap machine.
23+
* You created the Ignition configuration files.
3124
3225
.Procedure
3326

34-
. Copy the template from the *Deployment Manager template for control plane machines*
35-
section of this topic and save it as `05_control_plane.py` on your computer.
36-
This template describes the control plane machines that your cluster requires.
27+
. Copy the template from the *Infrastructure Manager template for control plane machines* section of this topic and save it as `05_control_plane.tf` in a folder called `05_control_plane` on your computer. This template describes the control plane machines that your cluster requires.
28+
29+
** You can edit the `05_control_plane.tf` file to add additional tags to the control plane machines, by modifying the existing `tags` stanza. The following example adds a custom tag to the first control plane machine, which is named `master_0`:
30+
+
31+
[source,bash]
32+
----
33+
resource "google_compute_instance" "master_0" {
34+
# ...
35+
tags = [
36+
"${var.infra_id}-master"
37+
"custom_tag_example"
38+
]
39+
# ...
40+
}
41+
----
3742

38-
. Export the following variable required by the resource definition:
43+
. Copy the `master.ign` file from your installation directory into the `05_control_plane` folder by running the following command:
3944
+
4045
[source,terminal]
4146
----
42-
$ export MASTER_IGNITION=`cat <installation_directory>/master.ign`
47+
$ cp <installation_directory>/master.ign 05_control_plane/master.ign
4348
----
49+
`<installation_directory>` specifies the directory where you created the Ignition configuration files.
4450

45-
. Create a `05_control_plane.yaml` resource definition file:
51+
. Create the control plane deployment by running the following command:
4652
+
4753
[source,terminal]
4854
----
49-
$ cat <<EOF >05_control_plane.yaml
50-
imports:
51-
- path: 05_control_plane.py
52-
53-
resources:
54-
- name: cluster-control-plane
55-
type: 05_control_plane.py
56-
properties:
57-
infra_id: '${INFRA_ID}' <1>
58-
zones: <2>
59-
- '${ZONE_0}'
60-
- '${ZONE_1}'
61-
- '${ZONE_2}'
62-
63-
control_subnet: '${CONTROL_SUBNET}' <3>
64-
image: '${CLUSTER_IMAGE}' <4>
65-
machine_type: 'n1-standard-4' <5>
66-
root_volume_size: '128'
67-
service_account_email: '${MASTER_SERVICE_ACCOUNT}' <6>
68-
69-
ignition: '${MASTER_IGNITION}' <7>
70-
EOF
71-
----
72-
<1> `infra_id` is the `INFRA_ID` infrastructure name from the extraction step.
73-
<2> `zones` are the zones to deploy the control plane instances into, for example `us-central1-a`, `us-central1-b`, and `us-central1-c`.
74-
<3> `control_subnet` is the `selfLink` URL to the control subnet.
75-
<4> `image` is the `selfLink` URL to the {op-system} image.
76-
<5> `machine_type` is the machine type of the instance, for example `n1-standard-4`.
77-
<6> `service_account_email` is the email address for the master service account that you created.
78-
<7> `ignition` is the contents of the `master.ign` file.
79-
80-
. Create the deployment by using the `gcloud` CLI:
55+
$ gcloud infra-manager deployments apply <control_plane_deployment> \
56+
--location=${REGION} \
57+
--project=${PROJECT_NAME} \
58+
--local-source=./05_control_plane \
59+
--input-values=infra_id=${INFRA_ID},project=${PROJECT_NAME},region=${REGION},zone_0=${ZONE_0},zone_1=${ZONE_1},zone_2=${ZONE_2},subnet=${CONTROL_SUBNET},image=${CLUSTER_IMAGE},service_account_email=${MASTER_SERVICE_ACCOUNT} \
60+
--service-account=${INSTALL_SERVICE_ACCOUNT}
61+
----
62+
`<control_plane_deployment>` specifies the name of the control plane deployment.
63+
64+
. Delete the temporary ignition file from the `05_control_plane` folder by running the following command:
8165
+
8266
[source,terminal]
8367
----
84-
$ gcloud deployment-manager deployments create ${INFRA_ID}-control-plane --config 05_control_plane.yaml
68+
$ rm 05_control_plane/master.ign
8569
----
8670

87-
. The templates do not manage load balancer membership due to limitations of Deployment
88-
Manager, so you must add the control plane machines manually.
89-
** Run the following commands to add the control plane machines to the appropriate instance groups:
71+
. The templates do not manage load balancer membership due to limitations of Infrastructure Manager, so you must add the control plane machines manually.
72+
73+
.. Add the first control plane machine to an internal load balancer instance group by running the following command:
9074
+
9175
[source,terminal]
9276
----
9377
$ gcloud compute instance-groups unmanaged add-instances ${INFRA_ID}-master-${ZONE_0}-ig --zone=${ZONE_0} --instances=${INFRA_ID}-master-0
9478
----
79+
80+
.. Add the second control plane machine to an internal load balancer instance group by running the following command:
9581
+
9682
[source,terminal]
9783
----
9884
$ gcloud compute instance-groups unmanaged add-instances ${INFRA_ID}-master-${ZONE_1}-ig --zone=${ZONE_1} --instances=${INFRA_ID}-master-1
9985
----
86+
87+
.. Add the third control plane machine to an internal load balancer instance group by running the following command:
10088
+
10189
[source,terminal]
10290
----
10391
$ gcloud compute instance-groups unmanaged add-instances ${INFRA_ID}-master-${ZONE_2}-ig --zone=${ZONE_2} --instances=${INFRA_ID}-master-2
10492
----
10593

106-
** For an external cluster, you must also run the following commands to add the control plane machines to the target pools:
94+
. For an external cluster, you must also add the control plane machines to external load balancer target pools.
95+
96+
.. Add the first control plane machine to an external load balancer pool by running the following command:
10797
+
10898
[source,terminal]
10999
----
110100
$ gcloud compute target-pools add-instances ${INFRA_ID}-api-target-pool --instances-zone="${ZONE_0}" --instances=${INFRA_ID}-master-0
111101
----
102+
103+
.. Add the first control plane machine to an external load balancer pool by running the following command:
112104
+
113105
[source,terminal]
114106
----
115107
$ gcloud compute target-pools add-instances ${INFRA_ID}-api-target-pool --instances-zone="${ZONE_1}" --instances=${INFRA_ID}-master-1
116108
----
109+
110+
.. Add the first control plane machine to an external load balancer pool by running the following command:
117111
+
118112
[source,terminal]
119113
----
120114
$ gcloud compute target-pools add-instances ${INFRA_ID}-api-target-pool --instances-zone="${ZONE_2}" --instances=${INFRA_ID}-master-2
121-
----
122-
123-
ifeval::["{context}" == "installing-gcp-user-infra-vpc"]
124-
:!shared-vpc:
125-
endif::[]
115+
----

modules/installation-deployment-manager-control-plane.adoc

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * installing/installing_gcp/installing-gcp-user-infra.adoc
4+
// * installing/installing_gcp/installing-restricted-networks-gcp.adoc
5+
6+
:_mod-docs-content-type: REFERENCE
7+
[id="installation-infrastructure-manager-control-plane_{context}"]
8+
= Infrastructure Manager template for control plane machines
9+
10+
[role="_abstract"]
11+
You can use the following Infrastructure Manager template to deploy the control plane machines that you need for your {product-title} cluster:
12+
13+
.`05_control_plane.tf` Infrastructure Manager template
14+
[%collapsible]
15+
====
16+
[source,python]
17+
----
18+
include::https://raw.githubusercontent.com/openshift/installer/release-4.22/upi/gcp/05_control_plane/05_control_plane.tf[]
19+
----
20+
====

0 commit comments

Comments
 (0)