|
| 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 | + |
0 commit comments