Skip to content

Commit 55a8a2a

Browse files
authored
Merge pull request #51171 from bscott-rh/OSDOCS-3940
OSDOCS-3940 Enabling GCP Shared VPC IPI installation
2 parents 98204d8 + 4011541 commit 55a8a2a

10 files changed

+252
-5
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,8 @@ Topics:
236236
File: installing-restricted-networks-gcp-installer-provisioned
237237
- Name: Installing a cluster on GCP into an existing VPC
238238
File: installing-gcp-vpc
239+
- Name: Installing a cluster on GCP into a shared VPC
240+
File: installing-gcp-shared-vpc
239241
- Name: Installing a private cluster on GCP
240242
File: installing-gcp-private
241243
- Name: Installing a cluster on GCP using Deployment Manager templates
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
:_content-type: ASSEMBLY
2+
[id="installing-gcp-shared-vpc"]
3+
= Installing a cluster on GCP into a shared VPC
4+
include::_attributes/common-attributes.adoc[]
5+
:context: installing-gcp-shared-vpc
6+
:FeatureName: Installing a cluster on GCP into a shared VPC
7+
8+
toc::[]
9+
10+
In {product-title} version {product-version}, you can install a cluster into a shared Virtual Private Cloud (VPC) on Google Cloud Platform (GCP). In this installation method, the cluster is configured to use a VPC from a different GCP project. A shared VPC enables an organization to connect resources from multiple projects to a common VPC network. You can communicate within the organization securely and efficiently by using internal IP addresses from that network. For more information about shared VPC, see link:https://cloud.google.com/vpc/docs/shared-vpc[Shared VPC overview in the GCP documentation].
11+
12+
The installation program provisions the rest of the required infrastructure, which you can further customize. To customize the installation, you modify parameters in the `install-config.yaml` file before you install the cluster.
13+
14+
include::snippets/technology-preview.adoc[leveloffset=+1]
15+
16+
[id="installation-gcp-shared-vpc-prerequisites_{context}"]
17+
== Prerequisites
18+
19+
* You reviewed details about the xref:../../architecture/architecture-installation.adoc#architecture-installation[{product-title} installation and update] processes.
20+
* You read the documentation on xref:../../installing/installing-preparing.adoc#installing-preparing[selecting a cluster installation method and preparing it for users].
21+
* If you use a firewall, you xref:../../installing/install_config/configuring-firewall.adoc#configuring-firewall[configured it to allow the sites] that your cluster requires access to.
22+
* If the cloud identity and access management (IAM) APIs are not accessible in your environment, or if you do not want to store an administrator-level credential secret in the `kube-system` namespace, you can xref:../../installing/installing_gcp/manually-creating-iam-gcp.adoc#manually-creating-iam-gcp[manually create and maintain IAM credentials].
23+
* You have a GCP host project which contains a shared VPC network.
24+
* You xref:../../installing/installing_gcp/installing-gcp-account.adoc#installing-gcp-account[configured a GCP project] to host the cluster. This project, known as the service project, must be attached to the host project. For more information, see link:https://cloud.google.com/vpc/docs/provisioning-shared-vpc#create-shared[Attaching service projects in the GCP documentation].
25+
* You have a GCP service account that has the xref:../../installing/installing_gcp/installing-gcp-account.adoc#installation-gcp-permissions_installing-gcp-account[required GCP permissions] in the host project.
26+
27+
include::modules/cluster-entitlements.adoc[leveloffset=+1]
28+
29+
include::modules/ssh-agent-using.adoc[leveloffset=+1]
30+
31+
include::modules/installation-obtaining-installer.adoc[leveloffset=+1]
32+
33+
include::modules/installation-user-infra-generate.adoc[leveloffset=+1]
34+
35+
include::modules/installation-initializing-manual.adoc[leveloffset=+2]
36+
37+
include::modules/installation-gcp-shared-vpc-config.adoc[leveloffset=+2]
38+
39+
include::modules/installation-configuration-parameters.adoc[leveloffset=+2]
40+
41+
include::modules/installation-configure-proxy.adoc[leveloffset=+2]
42+
43+
include::modules/installation-launching-installer.adoc[leveloffset=+1]
44+
45+
include::modules/cli-installing-cli.adoc[leveloffset=+1]
46+
47+
include::modules/cli-logging-in-kubeadmin.adoc[leveloffset=+1]
48+
49+
include::modules/installation-gcp-shared-vpc-ingress.adoc[leveloffset=+1]
50+
51+
[role="_additional-resources"]
52+
.Additional resources
53+
54+
* See xref:../../web_console/web-console.adoc#web-console[Accessing the web console] for more details about accessing and understanding the {product-title} web console.
55+
56+
include::modules/cluster-telemetry.adoc[leveloffset=+1]
57+
58+
[role="_additional-resources"]
59+
.Additional resources
60+
61+
* See xref:../../support/remote_health_monitoring/about-remote-health-monitoring.adoc#about-remote-health-monitoring[About remote health monitoring] for more information about the Telemetry service
62+
63+
[id="installation-gcp-shared-vpc-next-steps_{context}"]
64+
== Next steps
65+
66+
* xref:../../post_installation_configuration/cluster-tasks.adoc#available_cluster_customizations[Customize your cluster].
67+
* If necessary, you can
68+
xref:../../support/remote_health_monitoring/opting-out-of-remote-health-reporting.adoc#opting-out-remote-health-reporting_opting-out-remote-health-reporting[opt out of remote health reporting].

modules/installation-configuration-parameters.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
// * installing/installing_gcp/installing-gcp-network-customizations.adoc
2424
// * installing/installing_gcp/installing-gcp-private.adoc
2525
// * installing/installing_gcp/installing-gcp-vpc.adoc
26+
// * installing/installing_gcp/installing-gcp-shared-vpc.adoc
2627
// * installing/installing_gcp/installing-restricted-networks-gcp-installer-provisioned.adoc
2728
// * installing/installing_ibm_cloud_public/installing-ibm-cloud-customizations.adoc
2829
// * installing/installing_ibm_cloud_public/installing-ibm-cloud-network-customizations.adoc
@@ -114,6 +115,9 @@ endif::[]
114115
ifeval::["{context}" == "installing-gcp-vpc"]
115116
:gcp:
116117
endif::[]
118+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
119+
:gcp:
120+
endif::[]
117121
ifeval::["{context}" == "installing-restricted-networks-gcp-installer-provisioned"]
118122
:gcp:
119123
endif::[]
@@ -1811,6 +1815,9 @@ endif::[]
18111815
ifeval::["{context}" == "installing-gcp-vpc"]
18121816
:!gcp:
18131817
endif::[]
1818+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
1819+
:!gcp:
1820+
endif::[]
18141821
ifeval::["{context}" == "installing-restricted-networks-gcp-installer-provisioned"]
18151822
:!gcp:
18161823
endif::[]

modules/installation-gcp-permissions.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,18 @@ account requires the following permissions. If you deploy your cluster into an e
2424

2525
.Required roles for the installation program
2626
* Compute Admin
27-
* Security Admin
27+
* IAM Security Admin
2828
* Service Account Admin
2929
* Service Account User
3030
* Storage Admin
3131

3232
.Required roles for creating network resources during installation
3333
* DNS Administrator
3434

35+
.Required roles for using passthrough credentials mode
36+
* Compute Load Balancer Admin
37+
* IAM Role Viewer
38+
3539
ifdef::template[]
3640
.Required roles for user-provisioned GCP infrastructure
3741
* Deployment Manager Editor
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// This file is referenced in the following assembly:
2+
// installing/installing_gcp/installing-gcp-shared-vpc.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="installation-gcp-shared-vpc-config_{context}"]
6+
= Sample customized install-config.yaml file for shared VPC installation
7+
There are several configuration parameters which are required to install {product-title} on GCP using a shared VPC. The following is a sample `install-config.yaml` file which demonstrates these fields.
8+
9+
[IMPORTANT]
10+
====
11+
This sample YAML file is provided for reference only. You must modify this file with the correct values for your environment and cluster.
12+
====
13+
14+
[source,yaml]
15+
----
16+
apiVersion: v1
17+
baseDomain: example.com
18+
credentialsMode: Passthrough <1>
19+
metadata:
20+
name: cluster_name
21+
platform:
22+
gcp:
23+
computeSubnet: shared-vpc-subnet-1 <2>
24+
controlPlaneSubnet: shared-vpc-subnet-2 <3>
25+
createFirewallRules: Disabled <4>
26+
network: shared-vpc <5>
27+
networkProjectID: host-project-name <6>
28+
publicDNSZone:
29+
id: public-dns-zone <7>
30+
project: host-project-name <8>
31+
projectID: service-project-name <9>
32+
region: us-east1
33+
defaultMachinePlatform:
34+
tags: <10>
35+
- global-tag1
36+
controlPlane:
37+
name: master
38+
platform:
39+
gcp:
40+
tags: <10>
41+
- control-plane-tag1
42+
type: n2-standard-4
43+
zones:
44+
- us-central1-a
45+
- us-central1-c
46+
replicas: 3
47+
compute:
48+
- name: worker
49+
platform:
50+
gcp:
51+
tags: <10>
52+
- compute-tag1
53+
type: n2-standard-4
54+
zones:
55+
- us-central1-a
56+
- us-central1-c
57+
replicas: 3
58+
networking:
59+
clusterNetwork:
60+
- cidr: 10.128.0.0/14
61+
hostPrefix: 23
62+
machineNetwork:
63+
- cidr: 10.0.0.0/16
64+
pullSecret: '{"auths": ...}'
65+
sshKey: ssh-ed25519 AAAA... <11>
66+
----
67+
<1> `credentialsMode` must be set to `Passthrough` to allow the cluster to use the provided GCP service account after cluster creation. See the "Prerequisites" section for the required GCP permissions that your service account must have.
68+
<2> The name of the subnet in the shared VPC for compute machines to use.
69+
<3> The name of the subnet in the shared VPC for control plane machines to use.
70+
<4> Optional. If you set `createFirewallRules` to `Disabled`, you can create and manage firewall rules manually through the use of network tags. By default, the cluster will automatically create and manage the firewall rules that are required for cluster communication. Your service account must have `roles/compute.networkAdmin` and `roles/compute.securityAdmin` privileges in the host project to perform these tasks automatically. If your service account does not have the `roles/dns.admin` privilege in the host project, it must have the `dns.networks.bindPrivateDNSZone` permission.
71+
<5> The name of the shared VPC.
72+
<6> The name of the host project where the shared VPC exists.
73+
<7> Optional. The name of a public DNS zone in the host project. If you set this value, your service account must have the `roles/dns.admin` privilege in the host project. The public DNS zone domain must match the `baseDomain` parameter. If you do not set this value, the installation program will use the public DNS zone in the service project.
74+
<8> Optional. The name of the host project which contains the public DNS zone. This value is required if you specify a public DNS zone that exists in another project.
75+
<9> The name of the GCP project where you want to install the cluster.
76+
<10> Optional. If you want to manually create and manage your GCP firewall rules, you can set `platform.gcp.createFirewallRules` to `Disabled` and then specify one or more network tags. You can set tags on the compute machines, the control plane machines, or all machines.
77+
<11> You can optionally provide the `sshKey` value that you use to access the machines in your cluster.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// File included in the following assemblies:
2+
// * installation/installing_gcp/installing-gcp-shared-vpc.adoc
3+
4+
:_content-type: PROCEDURE
5+
[id="installation-gcp-shared-vpc-ingress_{context}"]
6+
= Optional: Adding Ingress DNS records for shared VPC installations
7+
If the public DNS zone exists in a host project outside the project where you installed your cluster, you must manually create DNS records that point at the Ingress load balancer. You can create either a wildcard `*.apps.{baseDomain}.` or specific records. You can use A, CNAME, and other records per your requirements.
8+
9+
.Prerequisites
10+
* You completed the installation of {product-title} on GCP into a shared VPC.
11+
* Your public DNS zone exists in a host project separate from the service project that contains your cluster.
12+
13+
.Procedure
14+
. Verify that the Ingress router has created a load balancer and populated the `EXTERNAL-IP` field by running the following command:
15+
+
16+
[source,terminal]
17+
----
18+
$ oc -n openshift-ingress get service router-default
19+
----
20+
+
21+
.Example output
22+
[source,terminal]
23+
----
24+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
25+
router-default LoadBalancer 172.30.18.154 35.233.157.184 80:32288/TCP,443:31215/TCP 98
26+
----
27+
. Record the external IP address of the router by running the following command:
28+
+
29+
[source,terminal]
30+
----
31+
$ oc -n openshift-ingress get service router-default --no-headers | awk '{print $4}'
32+
----
33+
. Add a record to your GCP public zone with the router's external IP address and the name `*.apps.<cluster_name>.<cluster_domain>`. You can use the `gcloud` command line utility or the GCP web console.
34+
. To add manual records instead of a wildcard record, create entries for each of the cluster's current routes. You can gather these routes by running the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ oc get --all-namespaces -o jsonpath='{range .items[*]}{range .status.ingress[*]}{.host}{"\n"}{end}{end}' routes
39+
----
40+
+
41+
.Example output
42+
[source,terminal]
43+
----
44+
oauth-openshift.apps.your.cluster.domain.example.com
45+
console-openshift-console.apps.your.cluster.domain.example.com
46+
downloads-openshift-console.apps.your.cluster.domain.example.com
47+
alertmanager-main-openshift-monitoring.apps.your.cluster.domain.example.com
48+
prometheus-k8s-openshift-monitoring.apps.your.cluster.domain.example.com
49+
----

modules/installation-initializing-manual.adoc

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// * installing/installing_azure_stack_hub/installing-azure-stack-hub-default.adoc
1010
// * installing/installing_bare_metal/installing-bare-metal.adoc
1111
// * installing/installing_gcp/installing-gcp-private.adoc
12+
// * installing/installing_gcp/installing-gcp-shared-vpc.adoc
1213
// * installing/installing_bare_metal/installing-restricted-networks-bare-metal.adoc
1314
// * installing/installing_platform_agnostic/installing-platform-agnostic.adoc
1415
// * installing/installing_vmc/installing-restricted-networks-vmc-user-infra.adoc
@@ -53,6 +54,9 @@ endif::[]
5354
ifeval::["{context}" == "installing-gcp-private"]
5455
:gcp-private:
5556
endif::[]
57+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
58+
:gcp-shared:
59+
endif::[]
5660
ifeval::["{context}" == "installing-azure-stack-hub-default"]
5761
:ash-default:
5862
endif::[]
@@ -64,9 +68,9 @@ endif::[]
6468
[id="installation-initializing-manual_{context}"]
6569
= Manually creating the installation configuration file
6670

67-
ifndef::aws-china,aws-gov,aws-secret,azure-gov,ash,aws-private,azure-private,gcp-private,ash-default,ash-network[]
71+
ifndef::aws-china,aws-gov,aws-secret,azure-gov,ash,aws-private,azure-private,gcp-private,gcp-shared,ash-default,ash-network[]
6872
For user-provisioned installations of {product-title}, you manually generate your installation configuration file.
69-
endif::aws-china,aws-gov,aws-secret,azure-gov,ash,aws-private,azure-private,gcp-private,ash-default,ash-network[]
73+
endif::aws-china,aws-gov,aws-secret,azure-gov,ash,aws-private,azure-private,gcp-private,gcp-shared,ash-default,ash-network[]
7074
ifdef::aws-china,aws-gov,aws-secret[]
7175
Installing the cluster requires that you manually generate the installation configuration file.
7276
//Made this update as part of feedback in PR3961. tl;dr Simply state you have to create the config file, instead of creating a number of conditions to explain why.
@@ -81,6 +85,9 @@ endif::aws-private,azure-private,gcp-private[]
8185
ifdef::ash-default,ash-network[]
8286
When installing {product-title} on Microsoft Azure Stack Hub, you must manually create your installation configuration file.
8387
endif::ash-default,ash-network[]
88+
ifdef::gcp-shared[]
89+
You must manually create your installation configuration file when installing {product-title} on GCP into a shared VPC using installer-provisioned infrastructure.
90+
endif::gcp-shared[]
8491

8592
.Prerequisites
8693

@@ -132,12 +139,12 @@ mirror the repository.
132139
endif::restricted[]
133140
+
134141

135-
ifndef::aws-china,aws-gov,aws-secret,azure-gov,ash,ash-default,ash-network[]
142+
ifndef::aws-china,aws-gov,aws-secret,azure-gov,ash,ash-default,ash-network,gcp-shared[]
136143
[NOTE]
137144
====
138145
For some platform types, you can alternatively run `./openshift-install create install-config --dir <installation_directory>` to generate an `install-config.yaml` file. You can provide details about your cluster configuration at the prompts.
139146
====
140-
endif::aws-china,aws-gov,aws-secret,azure-gov,ash,ash-default,ash-network[]
147+
endif::aws-china,aws-gov,aws-secret,azure-gov,ash,ash-default,ash-network,gcp-shared[]
141148
ifdef::ash[]
142149
+
143150
Make the following modifications for Azure Stack Hub:
@@ -228,6 +235,9 @@ endif::[]
228235
ifeval::["{context}" == "installing-gcp-private"]
229236
:!gcp-private:
230237
endif::[]
238+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
239+
:!gcp-shared:
240+
endif::[]
231241
ifeval::["{context}" == "installing-azure-stack-hub-default"]
232242
:!ash-default:
233243
endif::[]

modules/installation-initializing.adoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
// * installing/installing_gcp/installing-gcp-customizations.adoc
1515
// * installing/installing_gcp/installing-gcp-network-customizations.adoc
1616
// * installing/installing_gcp/installing-gcp-vpc.adoc
17+
// * installing/installing_gcp/installing-gcp-shared-vpc.adoc
1718
// * installing/installing_gcp/installing-gcp-user-infra.adoc
1819
// * installing/installing_gcp/installing-restricted-networks-gcp.adoc
1920
// * installing/installing_gcp/installing-restricted-networks-gcp-installer-provisioned.adoc
@@ -76,6 +77,9 @@ endif::[]
7677
ifeval::["{context}" == "installing-gcp-vpc"]
7778
:gcp:
7879
endif::[]
80+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
81+
:gcp:
82+
endif::[]
7983
ifeval::["{context}" == "installing-gcp-network-customizations"]
8084
:gcp:
8185
endif::[]
@@ -641,6 +645,9 @@ endif::[]
641645
ifeval::["{context}" == "installing-gcp-vpc"]
642646
:!gcp:
643647
endif::[]
648+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
649+
:!gcp:
650+
endif::[]
644651
ifeval::["{context}" == "installing-gcp-user-infra"]
645652
:!gcp:
646653
:!gcp-user-infra:

modules/installation-launching-installer.adoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
// * installing/installing_gcp/installing-gcp-private.adoc
2121
// * installing/installing_gcp/installing-gcp-default.adoc
2222
// * installing/installing_gcp/installing-gcp-vpc.adoc
23+
// * installing/installing_gcp/installing-gcp-shared-vpc.adoc
2324
// * installing/installing_gcp/installing-restricted-networks-gcp-installer-provisioned.adoc
2425
// * installing/installing_gcp/installing-ibm-cloud-customizations.adoc
2526
// * installing/installing_gcp/installing-ibm-cloud-vpc.adoc
@@ -101,6 +102,10 @@ ifeval::["{context}" == "installing-gcp-vpc"]
101102
:custom-config:
102103
:gcp:
103104
endif::[]
105+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
106+
:custom-config:
107+
:gcp:
108+
endif::[]
104109
ifeval::["{context}" == "installing-gcp-default"]
105110
:no-config:
106111
:gcp:
@@ -590,6 +595,10 @@ ifeval::["{context}" == "installing-gcp-vpc"]
590595
:!custom-config:
591596
:!gcp:
592597
endif::[]
598+
ifeval::["{context}" == "installing-gcp-shared-vpc"]
599+
:!custom-config:
600+
:!gcp:
601+
endif::[]
593602
ifeval::["{context}" == "installing-gcp-default"]
594603
:!no-config:
595604
:!gcp:

0 commit comments

Comments
 (0)