Skip to content

Commit d8e3c06

Browse files
committed
OSDOCS-14662:Updated Creating a cluster on GC with WIF auth for DITA compliance.
1 parent 6463995 commit d8e3c06

12 files changed

+427
-360
lines changed

.vale.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
StylesPath = .vale/styles
2-
32
MinAlertLevel = suggestion
43

54
Packages = RedHat, AsciiDoc, OpenShiftAsciiDoc, https://github.com/jhradilek/asciidoctor-dita-vale/releases/latest/download/AsciiDocDITA.zip
Lines changed: 3 additions & 307 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
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-cli_{context}"]
88
= Creating a Workload Identity Federation cluster using the OCM CLI
99

10+
[role="_abstract"]
1011
You can create an {product-title} on {GCP} cluster with Workload Identity Federation (WIF) using the OpenShift Cluster Manager CLI (`ocm`) in interactive or non-interactive mode.
1112

1213
[NOTE]
@@ -27,138 +28,6 @@ Before creating the cluster, you must first create a WIF configuration.
2728
Migrating an existing non-WIF cluster to a WIF configuration is not supported. This feature can only be enabled during new cluster creation.
2829
====
2930

30-
[id="create-wif-configuration_{context}"]
31-
== Creating a WIF configuration
32-
33-
.Procedure
34-
You can create a WIF configuration using the `auto` mode or the `manual` mode.
35-
36-
The `auto` mode enables you to automatically create the service accounts for {product-title} components as well as other IAM resources.
37-
38-
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.
39-
40-
* Based on your mode preference, run one of the following commands to create a WIF configuration:
41-
42-
** Create a WIF configuration in auto mode by running the following command:
43-
+
44-
[source,terminal]
45-
----
46-
$ ocm gcp create wif-config --name <wif_name> \ <1>
47-
--project <gcp_project_id> \ <2>
48-
--version <osd_version> <3>
49-
--federated-project <gcp_project_id> <4>
50-
----
51-
<1> Replace `<wif_name>` with the name of your WIF configuration.
52-
<2> Replace `<gcp_project_id>` with the ID of the {GCP} project where the WIF configuration will be implemented.
53-
<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).
54-
<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.
55-
+
56-
[NOTE]
57-
=====
58-
Using a dedicated project to create and manage workload identity pools and providers is recommended by {GCP}.
59-
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.
60-
61-
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].
62-
=====
63-
+
64-
[IMPORTANT]
65-
====
66-
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`.
67-
====
68-
+
69-
--
70-
.Example output
71-
[source,terminal]
72-
----
73-
2024/09/26 13:05:41 Creating workload identity configuration...
74-
2024/09/26 13:05:47 Workload identity pool created with name 2e1kcps6jtgla8818vqs8tbjjls4oeub
75-
2024/09/26 13:05:47 workload identity provider created with name oidc
76-
2024/09/26 13:05:48 IAM service account osd-worker-oeub created
77-
2024/09/26 13:05:49 IAM service account osd-control-plane-oeub created
78-
2024/09/26 13:05:49 IAM service account openshift-gcp-ccm-oeub created
79-
2024/09/26 13:05:50 IAM service account openshift-gcp-pd-csi-driv-oeub created
80-
2024/09/26 13:05:50 IAM service account openshift-image-registry-oeub created
81-
2024/09/26 13:05:51 IAM service account openshift-machine-api-gcp-oeub created
82-
2024/09/26 13:05:51 IAM service account osd-deployer-oeub created
83-
2024/09/26 13:05:52 IAM service account cloud-credential-operator-oeub created
84-
2024/09/26 13:05:52 IAM service account openshift-cloud-network-c-oeub created
85-
2024/09/26 13:05:53 IAM service account openshift-ingress-gcp-oeub created
86-
2024/09/26 13:05:55 Role "osd_deployer_v4.19" updated
87-
----
88-
--
89-
+
90-
** Create a WIF configuration in manual mode by running the following command:
91-
+
92-
[source,terminal]
93-
----
94-
$ ocm gcp create wif-config --name <wif_name> \ <1>
95-
--project <gcp_project_id> \ <2>
96-
--mode=manual
97-
----
98-
<1> Replace `<wif_name>` with the name of your WIF configuration.
99-
<2> Replace `<gcp_project_id>` with the ID of the {GCP} project where the WIF configuration will be implemented.
100-
+
101-
Once the WIF is configured, the following service accounts, roles, and groups are created.
102-
+
103-
[NOTE]
104-
====
105-
Red{nbsp}Hat custom roles are versioned with every OpenShift y-stream release, for example 4.19.
106-
====
107-
+
108-
.WIF configuration service accounts, group and roles
109-
[cols="2a,3a",options="header"]
110-
|===
111-
112-
|Service Account/Group
113-
|{gcp-short} pre-defined roles and Red Hat custom roles
114-
115-
116-
|osd-deployer
117-
|osd_deployer_v<y-stream-version>
118-
119-
|osd-control-plane
120-
|- compute.instanceAdmin
121-
- compute.networkAdmin
122-
- compute.securityAdmin
123-
- compute.storageAdmin
124-
125-
|osd-worker
126-
|- compute.storageAdmin
127-
- compute.viewer
128-
129-
|cloud-credential-operator-gcp-ro-creds
130-
|cloud_credential_operator_gcp_ro_creds_v<y-stream-version>
131-
132-
|openshift-cloud-network-config-controller-gcp
133-
|openshift_cloud_network_config_controller_gcp_v<y-stream-version>
134-
135-
|openshift-gcp-ccm
136-
|openshift_gcp_ccm_v<y-stream-version>
137-
138-
|openshift-gcp-pd-csi-driver-operator
139-
|- compute.storageAdmin
140-
- iam.serviceAccountUser
141-
- resourcemanager.tagUser
142-
- openshift_gcp_pd_csi_driver_operator_v<y-stream-version>
143-
144-
|openshift-image-registry-gcp
145-
|openshift_image_registry_gcs_v<y-stream-version>
146-
147-
|openshift-ingress-gcp
148-
|openshift_ingress_gcp_v<y-stream-version>
149-
150-
|openshift-machine-api-gcp
151-
|openshift_machine_api_gcp_v<y-stream-version>
152-
153-
|Access via SRE group:sd-sre-platform-gcp-access
154-
|sre_managed_support
155-
|===
156-
157-
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].
158-
159-
[id="create-wif-cluster_{context}"]
160-
== Creating a WIF cluster
161-
16231
.Procedure
16332
You can create a WIF cluster using the `interactive` mode or the `non-interactive` mode.
16433

@@ -224,177 +93,4 @@ If an {product-title} version is specified, the version must also be supported b
22493
[IMPORTANT]
22594
====
22695
If your cluster deployment fails during installation, certain resources created during the installation process are not automatically removed from your {GCP} account. To remove these resources from your {gcp-short} account, you must delete the failed cluster.
227-
====
228-
229-
[id="ocm-cli-list-wif-commands_{context}"]
230-
== Listing WIF clusters
231-
232-
To list all of your {product-title} clusters that have been deployed using the WIF authentication type, run the following command:
233-
234-
[source,terminal]
235-
----
236-
$ ocm list clusters --parameter search="gcp.authentication.wif_config_id != ''"
237-
----
238-
To list all of your {product-title} clusters that have been deployed using a specific wif-config, run the following command:
239-
[source,terminal]
240-
----
241-
$ ocm list clusters --parameter search="gcp.authentication.wif_config_id = '<wif_config_id>'" <1>
242-
----
243-
<1> Replace `<wif_config_id>` with the ID of the WIF configuration.
244-
245-
[id="wif-configuration-update_{context}"]
246-
== Updating a WIF configuration
247-
248-
[NOTE]
249-
====
250-
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].
251-
====
252-
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.
253-
254-
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.
255-
256-
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].
257-
258-
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.
259-
260-
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.
261-
262-
.Example output
263-
[source,text]
264-
----
265-
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.
266-
----
267-
268-
.Procedure
269-
. To check the version of your `ocm`, run the following command:
270-
+
271-
[source,terminal]
272-
----
273-
$ ocm version
274-
----
275-
+
276-
. 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}.
277-
+
278-
. Update a wif-config to a specific {product-title} version by running the following command:
279-
+
280-
[source,terminal]
281-
----
282-
ocm gcp update wif-config <wif_name> \ <1>
283-
--version <version> <2>
284-
----
285-
<1> Replace `<wif_name>` with the name of the WIF configuration you want to update.
286-
<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).
287-
288-
[id="wif-removing-stale-permissions_{context}"]
289-
== Removing stale permissions from service accounts managed by a WIF configuration
290-
291-
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.
292-
293-
[id="wif-removing-stale-deployer-permissions_{context}"]
294-
=== Removing stale deployer permissions from service accounts managed by a WIF configuration
295-
296-
To remove the stale deployer permissions, run the following commands on a terminal with access to the {gcp-full} project hosting the service accounts.
297-
298-
.Procedure
299-
300-
. Retrieve the existing role definition, ensuring the `PROJECT_ID` environment variable points to your {gcp-full} project:
301-
+
302-
[source,terminal]
303-
----
304-
$ gcloud iam roles describe \
305-
osd_deployer_v4.18 \
306-
--project $PROJECT_ID \
307-
--format=yaml > /tmp/role.yaml
308-
----
309-
+
310-
. 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:
311-
+
312-
[source,terminal]
313-
----
314-
$ cat /tmp/role.yaml | \
315-
grep -v "resourcemanager.projects.setIamPolicy" | \
316-
grep -v "iam.serviceAccounts.signBlob" | \
317-
grep -v "iam.serviceAccounts.actAs" > /tmp/updated_role.yaml
318-
----
319-
+
320-
. Review the changes in the output between the original and updated role definitions to ensure only the unwanted permissions have been removed:
321-
+
322-
[source,terminal]
323-
----
324-
$ diff /tmp/role.yaml /tmp/updated_role.yaml
325-
----
326-
+
327-
. Update the role in {gcp-full} with the updated role definition file, ensuring the `PROJECT_ID` environment variable points to your {gcp-full} project:
328-
+
329-
[source,terminal]
330-
----
331-
$ gcloud iam roles update \
332-
osd_deployer_v4.18 \
333-
--project=$PROJECT_ID \
334-
--file=/tmp/updated_role.yaml
335-
----
336-
337-
[id="wif-removing-stale-support-permissions_{context}"]
338-
=== Removing stale support permissions from service accounts managed by a WIF configuration
339-
340-
To remove stale support permissions, run the following commands on a terminal with access to the {gcp-full} project hosting the service accounts.
341-
342-
.Procedure
343-
344-
. Retrieve the existing role defintion, ensuring the `PROJECT_ID` environment variable points to your {gcp-full} project:
345-
+
346-
[source,terminal]
347-
----
348-
$ gcloud iam roles describe sre_managed_support --project $PROJECT_ID --format=yaml > /tmp/role.yaml
349-
----
350-
+
351-
. 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:
352-
+
353-
[source,terminal]
354-
----
355-
$ cat /tmp/role.yaml | grep -v "compute.firewalls.create" > /tmp/updated_role.yaml
356-
----
357-
+
358-
. Review the changes in the output between the original and updated role definitions to ensure only the unwanted permissions have been removed:
359-
+
360-
[source,terminal]
361-
----
362-
$ diff /tmp/role.yaml /tmp/updated_role.yaml
363-
----
364-
+
365-
. Update the role in {gcp-full} with the updated role definition file, ensuring the `PROJECT_ID` environment variable points to your {gcp-full} project:
366-
+
367-
[source,terminal]
368-
----
369-
$ gcloud iam roles update sre_managed_support --project $PROJECT_ID --file=/tmp/updated_role.yaml
370-
----
371-
372-
[id="ocm-cli-verify-wif-commands_{context}"]
373-
== Verifying a WIF configuration
374-
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.
375-
376-
You need the name and ID of the WIF configuration you want to verify before verification.
377-
To obtain the name and ID of your active WIF configurations, run the following command:
378-
379-
[source,terminal]
380-
----
381-
$ ocm gcp list wif-configs
382-
----
383-
384-
To determine if the WIF configuration you want to verify is configured correctly, run the following command:
385-
386-
[source,terminal]
387-
----
388-
$ ocm gcp verify wif-config <wif_config_name>|<wif_config_id> <1>
389-
----
390-
<1> Replace `<wif_config_name>` and `<wif_config_id>` with the name and ID of your WIF configuration, respectively.
391-
392-
--
393-
.Example output
394-
[source,terminal]
395-
----
396-
Error: verification failed with error: missing role 'compute.storageAdmin'.
397-
Running 'ocm gcp update wif-config' may fix errors related to cloud resource misconfiguration.
398-
exit status 1.
399-
----
400-
--
96+
====

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:

0 commit comments

Comments
 (0)