Skip to content

Commit f3c6298

Browse files
authored
Merge pull request #102371 from AedinC/OSDOCS-14662
OSDOCS-14662:CQA on Creating a cluster on GC with WIF auth guide
2 parents 5d43caa + 0458172 commit f3c6298

11 files changed

+435
-364
lines changed

modules/create-wif-cluster-cli.adoc

Lines changed: 3 additions & 320 deletions
Large diffs are not rendered by default.

modules/create-wif-cluster-ocm.adoc

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
// Module included in the following assemblies:
22
//
3-
// * osd_install_access_delete_cluster/creating-a-gcp-cluster-with-workload-identity-federation.adoc
3+
// * osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
44

55

66
:_mod-docs-content-type: PROCEDURE
77
[id="create-wif-cluster-ocm_{context}"]
88
= Creating a Workload Identity Federation cluster using {cluster-manager}
99

10+
[role="_abstract"]
11+
Follow the steps in this procedure to create an {product-title} cluster on {gcp-full} using Workload Identity Federation (WIF) for authentication through the {cluster-manager} web console
12+
13+
.Prerequisites
14+
15+
* You have created a WIF configuration. For more information, see "Creating a Workload Identity Federation configuration".
16+
* You have access to the {cluster-manager} web console. For more information, see _Accessing {cluster-manager}_ in the _Additional resources_ section.
17+
1018
.Procedure
1119

1220
. Log in to {cluster-manager-url} and click *Create cluster* on the {product-title} card.
@@ -30,26 +38,7 @@ Workload Identity Federation (WIF), {gcp-full}'s recommended method of authentic
3038
.. Read and complete all the required prerequisites.
3139
3240
.. Click the checkbox indicating that you have read and completed all the required prerequisites.
33-
34-
+
35-
. To create a new WIF configuration, open a terminal window and run the following OCM CLI command.
36-
+
37-
38-
[source,terminal]
39-
----
40-
$ ocm gcp create wif-config --name <wif_name> \ <1>
41-
--project <gcp_project_id> \ <2>
42-
--version <osd_version> <3>
43-
--federated-project <gcp_project_id> <4>
44-
----
45-
<1> Replace `<wif_name>` with the name of your WIF configuration.
46-
<2> Replace `<gcp_project_id>` with the ID of the {GCP} project where the WIF configuration will be implemented.
47-
<3> Optional: Replace `<osd_version>` with the desired {product-title} version the wif-config will need to support. If you do not specify a version, the wif-config will support the latest {product-title} y-stream version as well as the last three supported {product-title} y-stream versions (beginning with version 4.17).
48-
<4> Optional: Replace `<gcp_project_id>` with the ID of the dedicated project where the workload identity pools and providers will be created and managed. If `--federated-project` is not specified, the workload identity pools and providers will be created and managed in the project specified by the `--project flag`.
49-
+
50-
. Select a configured WIF configuration from the *WIF configuration* drop-down list. If you want to select the WIF configuration you created in the last step, click *Refresh* first.
51-
+
52-
41+
. Select a configured WIF configuration from the *WIF configuration* drop-down list.
5342
. Click *Next*.
5443
. On the *Details* page, provide a name for your cluster and specify the cluster details:
5544
.. In the *Cluster name* field, enter a name for your cluster.
@@ -212,7 +201,7 @@ If the cluster privacy is set to *Private*, you cannot access your cluster until
212201
+
213202
[NOTE]
214203
====
215-
You can review the end-of-life dates in the update lifecycle documentation for {product-title}. For more information, see link:https://access.redhat.com/documentation/en-us/openshift_dedicated/4/html/introduction_to_openshift_dedicated/policies-and-service-definition#osd-life-cycle[OpenShift Dedicated update life cycle].
204+
You can review the end-of-life dates in the update lifecycle documentation for {product-title}. For more information, see link:https://docs.redhat.com/en/documentation/openshift_dedicated/4/html/introduction_to_openshift_dedicated/policies-and-service-definition#osd-life-cycle[OpenShift Dedicated update life cycle].
216205
====
217206
+
218207
.. Provide administrator approval based on your cluster update method:
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="create-wif-configuration_{context}"]
7+
= Creating a Workforce Identity Federation configuration
8+
9+
[role="_abstract"]
10+
11+
You can create a WIF configuration using the `auto` mode or the `manual` mode in the `ocm` CLI.
12+
13+
The `auto` mode enables you to automatically create the service accounts for {product-title} components as well as other IAM resources.
14+
15+
Alternatively, you can use the `manual` mode. In `manual` mode, you are provided with commands within a `script.sh` file which you use to manually create the service accounts for {product-title} components as well as other IAM resources.
16+
17+
.Procedure
18+
19+
* Based on your mode preference, run one of the following commands to create a WIF configuration:
20+
21+
** Create a WIF configuration in auto mode by running the following command:
22+
+
23+
[source,terminal]
24+
----
25+
$ ocm gcp create wif-config --name <wif_name> \ <1>
26+
--project <gcp_project_id> \ <2>
27+
--version <osd_version> <3>
28+
--federated-project <gcp_project_id> <4>
29+
----
30+
<1> Replace `<wif_name>` with the name of your WIF configuration.
31+
<2> Replace `<gcp_project_id>` with the ID of the {GCP} project where the WIF configuration will be implemented.
32+
<3> Optional: Replace `<osd_version>` with the desired {product-title} version the wif-config will need to support. If you do not specify a version, the wif-config will support the latest {product-title} y-stream version as well as the last three supported {product-title} y-stream versions (beginning with version 4.17).
33+
<4> Optional: Replace `<gcp_project_id>` with the ID of the dedicated project where the workload identity pools and providers will be created and managed. If the `--federated-project` flag is not specified, the workload identity pools and providers will be created and managed in the project specified by the `--project` flag.
34+
+
35+
[IMPORTANT]
36+
=====
37+
Using a dedicated project to create and manage workload identity pools and providers is recommended by {GCP}.
38+
Using a dedicated project helps you to establish centralized governance over the configuration of workload identity pools and providers, enforce uniform attribute mappings and conditions throughout all projects and applications, and ensure that only authorized identity providers can authenticate with WIF.
39+
40+
Creating and managing workload identity pools and providers in a dedicated project is only allowed during initial WIF configuration creation. The `--federated-project` flag cannot be applied to existing `wif-configs`.
41+
42+
For more information, see link:https://cloud.google.com/iam/docs/best-practices-for-using-workload-identity-federation#dedicated-project[Use a dedicated project to manage workload identity pools and providers].
43+
=====
44+
+
45+
--
46+
**Example output**
47+
[source,terminal]
48+
----
49+
2024/09/26 13:05:41 Creating workload identity configuration...
50+
2024/09/26 13:05:47 Workload identity pool created with name 2e1kcps6jtgla8818vqs8tbjjls4oeub
51+
2024/09/26 13:05:47 workload identity provider created with name oidc
52+
2024/09/26 13:05:48 IAM service account osd-worker-oeub created
53+
2024/09/26 13:05:49 IAM service account osd-control-plane-oeub created
54+
2024/09/26 13:05:49 IAM service account openshift-gcp-ccm-oeub created
55+
2024/09/26 13:05:50 IAM service account openshift-gcp-pd-csi-driv-oeub created
56+
2024/09/26 13:05:50 IAM service account openshift-image-registry-oeub created
57+
2024/09/26 13:05:51 IAM service account openshift-machine-api-gcp-oeub created
58+
2024/09/26 13:05:51 IAM service account osd-deployer-oeub created
59+
2024/09/26 13:05:52 IAM service account cloud-credential-operator-oeub created
60+
2024/09/26 13:05:52 IAM service account openshift-cloud-network-c-oeub created
61+
2024/09/26 13:05:53 IAM service account openshift-ingress-gcp-oeub created
62+
2024/09/26 13:05:55 Role "osd_deployer_v4.19" updated
63+
----
64+
--
65+
+
66+
** Create a WIF configuration in manual mode by running the following command:
67+
+
68+
[source,terminal]
69+
----
70+
$ ocm gcp create wif-config --name <wif_name> \ <1>
71+
--project <gcp_project_id> \ <2>
72+
--mode=manual
73+
----
74+
<1> Replace `<wif_name>` with the name of your WIF configuration.
75+
<2> Replace `<gcp_project_id>` with the ID of the {GCP} project where the WIF configuration will be implemented.
76+
+
77+
Once the WIF is configured, the following service accounts, roles, and groups are created.
78+
+
79+
[NOTE]
80+
====
81+
Red{nbsp}Hat custom roles are versioned with every OpenShift y-stream release, for example 4.19.
82+
====
83+
+
84+
.WIF configuration service accounts, group and roles
85+
[cols="2a,3a",options="header"]
86+
|===
87+
88+
|Service Account/Group
89+
|{gcp-short} pre-defined roles and Red Hat custom roles
90+
91+
92+
|osd-deployer
93+
|osd_deployer_v<y-stream-version>
94+
95+
|osd-control-plane
96+
|- compute.instanceAdmin
97+
- compute.networkAdmin
98+
- compute.securityAdmin
99+
- compute.storageAdmin
100+
101+
|osd-worker
102+
|- compute.storageAdmin
103+
- compute.viewer
104+
105+
|cloud-credential-operator-gcp-ro-creds
106+
|cloud_credential_operator_gcp_ro_creds_v<y-stream-version>
107+
108+
|openshift-cloud-network-config-controller-gcp
109+
|openshift_cloud_network_config_controller_gcp_v<y-stream-version>
110+
111+
|openshift-gcp-ccm
112+
|openshift_gcp_ccm_v<y-stream-version>
113+
114+
|openshift-gcp-pd-csi-driver-operator
115+
|- compute.storageAdmin
116+
- iam.serviceAccountUser
117+
- resourcemanager.tagUser
118+
- openshift_gcp_pd_csi_driver_operator_v<y-stream-version>
119+
120+
|openshift-image-registry-gcp
121+
|openshift_image_registry_gcs_v<y-stream-version>
122+
123+
|openshift-ingress-gcp
124+
|openshift_ingress_gcp_v<y-stream-version>
125+
126+
|openshift-machine-api-gcp
127+
|openshift_machine_api_gcp_v<y-stream-version>
128+
129+
|Access via SRE group:sd-sre-platform-gcp-access
130+
|sre_managed_support
131+
|===
132+
+
133+
For the complete list of WIF configuration roles and their assigned permissions, see link:https://github.com/openshift/managed-cluster-config/blob/master/resources/wif/4.19/vanilla.yaml[managed-cluster-config].
134+
135+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="ocm-cli-list-wif-commands_{context}"]
7+
= Listing Workforce Identity Federation clusters
8+
9+
[role="_abstract"]
10+
You can list {product-title} clusters that have been deployed using Workload Identity Federation (WIF) authentication by using the {cluster-manager} CLI (`ocm`).
11+
12+
.Procedure
13+
14+
* To list all of your {product-title} clusters that have been deployed using the WIF authentication type, run one of the following commands:
15+
+
16+
** Using the `--parameter` flag with the `search` option:
17+
+
18+
[source,terminal]
19+
----
20+
$ ocm list clusters --parameter search="gcp.authentication.wif_config_id != ''"
21+
----
22+
+
23+
** Using a specific wif-config ID to filter the clusters associated with that configuration:
24+
+
25+
[source,terminal]
26+
----
27+
$ ocm list clusters --parameter search="gcp.authentication.wif_config_id = '<wif_config_id>'" <1>
28+
----
29+
<1> Replace `<wif_config_id>` with the ID of the WIF configuration.
30+
31+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="ocm-cli-verify-wif-commands_{context}"]
8+
= Verifying a Workforce Identity Federation configuration
9+
10+
[role="_abstract"]
11+
You can verify that the configuration of resources associated with a WIF configuration are correct by running the `ocm gcp verify wif-config` command. If a misconfiguration is found, the output provides details about the misconfiguration and recommends that you update the WIF configuration.
12+
13+
You need the name and ID of the WIF configuration you want to verify before verification.
14+
To obtain the name and ID of your active WIF configurations, run the following command:
15+
16+
[source,terminal]
17+
----
18+
$ ocm gcp list wif-configs
19+
----
20+
21+
To determine if the WIF configuration you want to verify is configured correctly, run the following command:
22+
23+
[source,terminal]
24+
----
25+
$ ocm gcp verify wif-config <wif_config_name>|<wif_config_id> <1>
26+
----
27+
<1> Replace `<wif_config_name>` and `<wif_config_id>` with the name and ID of your WIF configuration, respectively.
28+
29+
--
30+
**Example output**
31+
[source,terminal]
32+
----
33+
Error: verification failed with error: missing role 'compute.storageAdmin'.
34+
Running 'ocm gcp update wif-config' may fix errors related to cloud resource misconfiguration.
35+
exit status 1.
36+
----
37+
--
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="wif-configuration-update_{context}"]
8+
= Updating a Workforce Identity Federation configuration
9+
10+
[role="_abstract"]
11+
You can update an existing Workload Identity Federation (WIF) configuration to support newer {product-title} y-stream versions and to align with the latest security best practices.
12+
13+
[NOTE]
14+
====
15+
Updating a WIF configuration is only applicable for y-stream updates. For an overview of the update process, including details regarding version semantics, see link:https://www.redhat.com/en/blog/the-ultimate-guide-to-openshift-release-and-upgrade-process-for-cluster-administrators#:~:text=Ongoing%20security%20patches%20and%20bug,is%20the%20dark%20green%20bar.[The Ultimate Guide to OpenShift Release and Upgrade Process for Cluster Administrators].
16+
====
17+
Before upgrading a WIF-enabled {product-title} cluster to a newer version, you must update the wif-config to that version as well. If you do not update the wif-config version before attempting to upgrade the cluster version, the cluster version upgrade will fail.
18+
19+
As part of Red{nbsp}Hat's ongoing commitment to the principle of least privilege, certain permissions previously assigned to the `osd-deployer` service account in WIF configurations have been removed. These changes help enhance the security of your clusters by ensuring that service accounts have only the permissions they need to perform their functions.
20+
21+
For the complete list of WIF configuration roles and their assigned permissions, see link:https://github.com/openshift/managed-cluster-config/blob/master/resources/wif/4.19/vanilla.yaml[managed-cluster-config].
22+
23+
To align your existing WIF configurations with these updated permissions, you can run the `ocm gcp update wif-config` command. This command updates the WIF configuration to include the latest permissions and roles required for optimal operation.
24+
25+
When you update a wif-config or create a new one, ensure your {cluster-manager} CLI (`ocm`) is up to date. Not updating to the latest version of the `ocm` can result in error messages and service disruptions.
26+
27+
**Example output**
28+
[source,text]
29+
----
30+
Error: failed to create wif-config: failed to create wif-config: status is 400, identifier is '400', code is 'CLUSTERS-MGMT-400', at '2025-10-06T15:18:37Z' and operation identifier is 'f9551d63-a58a-4e3c-b847-5f99ba1b0b74': Client version is out of date for WIF operations. Please update from vOCM-CLI/1.0.7 to v1.0.8 and try again.
31+
----
32+
33+
.Procedure
34+
. To check the version of your `ocm`, run the following command:
35+
+
36+
[source,terminal]
37+
----
38+
$ ocm version
39+
----
40+
+
41+
. Optional: If your `ocm` version is not the latest available, download and install the latest version from the link:https://console.redhat.com/openshift/downloads[Downloads] page on {cluster-manager}.
42+
+
43+
. Update a wif-config to a specific {product-title} version by running the following command:
44+
+
45+
[source,terminal]
46+
----
47+
ocm gcp update wif-config <wif_name> \ <1>
48+
--version <version> <2>
49+
----
50+
<1> Replace `<wif_name>` with the name of the WIF configuration you want to update.
51+
<2> Optional: Replace `<version>` with the {product-title} y-stream version you plan to update the cluster to. If you do not specify a version, the wif-config will be updated to support the latest {product-title} y-stream version as well as the last three {product-title} supported y-stream versions (beginning with version 4.17).
52+
53+
.Next steps
54+
55+
The stale set of permissions previously assigned to the `osd-deployer` service account will remain on the account after updating the wif-config. You need to manually access the roles and remove these stale permissions from them.
56+
57+
Follow the instructions in the "Removing stale deployer permissions from service accounts managed by a WIF configuration" and "Removing stale support permissions from service accounts managed by a WIF configuration" guides to remove these stale permissions.

modules/wif-overview.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
// Module included in the following assemblies:
22
//
3-
// * osd_install_access_delete_cluster/creating-a-gcp-cluster-with-workload-identity-federation.adoc
3+
// *osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
44

55

66
:_mod-docs-content-type: CONCEPT
77
[id="workload-identity-federation-overview_{context}"]
88
= Workload Identity Federation overview
99

10+
[role="_abstract"]
1011
Workload Identity Federation (WIF) is a {GCP} Identity and Access Management (IAM) feature that provides third parties a secure method to access resources on a customer's cloud account. WIF eliminates the need for service account keys, and is {gcp-full}'s preferred method of credential authentication.
1112
12-
While service account keys can provide powerful access to your {gcp-full} resources, they must be maintained by the user and can be a security risk if they are not managed properly. WIF does not use service keys as an access method for your Google cloud resources. Instead, WIF grants access by using credentials from external identity providers to generate short-lived credentials for workloads. The workloads can then use these credentials to temporarily impersonate service accounts and access {gcp-full} resources. This removes the burden of having to properly maintain service account keys, and removes the risk of unauthorized users gaining access to service account keys.
13+
While service account keys can provide powerful access to your {gcp-full} resources, they must be maintained by the user and can be a security risk if they are not managed properly. WIF does not use service keys as an access method for your {gcp-full} resources. Instead, WIF grants access by using credentials from external identity providers to generate short-lived credentials for workloads. The workloads can then use these credentials to temporarily impersonate service accounts and access {gcp-full} resources. This removes the burden of having to properly maintain service account keys, and removes the risk of unauthorized users gaining access to service account keys.
1314
1415
The following bulleted items provides a basic overview of the Workload Identity Federation process:
1516
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * osd_gcp_clusters/osd-creating-a-cluster-on-gcp-with-workload-identity-federation.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="wif-removing-stale-deployer-permissions_{context}"]
8+
= Removing stale deployer permissions from service accounts managed by a WIF configuration
9+
10+
[role="_abstract"]
11+
To remove the stale deployer permissions from service accounts managed by a WIF configuration, run the following commands on a terminal with access to the {gcp-full} project hosting the service accounts.
12+
13+
.Procedure
14+
15+
. Retrieve the existing role definition, ensuring the `PROJECT_ID` environment variable points to your {gcp-full} project:
16+
+
17+
[source,terminal]
18+
----
19+
$ gcloud iam roles describe \
20+
osd_deployer_v4.18 \
21+
--project $PROJECT_ID \
22+
--format=yaml > /tmp/role.yaml
23+
----
24+
+
25+
. Remove the unwanted permissions. You can do this by filtering out the unwanted permissions from the role definition file and saving the updated definition to a new file:
26+
+
27+
[source,terminal]
28+
----
29+
$ cat /tmp/role.yaml | \
30+
grep -v "resourcemanager.projects.setIamPolicy" | \
31+
grep -v "iam.serviceAccounts.signBlob" | \
32+
grep -v "iam.serviceAccounts.actAs" > /tmp/updated_role.yaml
33+
----
34+
+
35+
. Review the changes in the output between the original and updated role definitions to ensure only the unwanted permissions have been removed:
36+
+
37+
[source,terminal]
38+
----
39+
$ diff /tmp/role.yaml /tmp/updated_role.yaml
40+
----
41+
+
42+
. Update the role in {gcp-full} with the updated role definition file, ensuring the `PROJECT_ID` environment variable points to your {gcp-full} project:
43+
+
44+
[source,terminal]
45+
----
46+
$ gcloud iam roles update \
47+
osd_deployer_v4.18 \
48+
--project=$PROJECT_ID \
49+
--file=/tmp/updated_role.yaml
50+
----

0 commit comments

Comments
 (0)