-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
70855cd
commit 6137392
Showing
12 changed files
with
400 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 129 additions & 0 deletions
129
...ication/managing_cloud_provider_credentials/cco-mode-gcp-workload-identity.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
:_content-type: ASSEMBLY | ||
[id="cco-mode-gcp-workload-identity"] | ||
= Using manual mode with GCP Workload Identity | ||
include::_attributes/common-attributes.adoc[] | ||
:context: cco-mode-gcp-workload-identity | ||
|
||
toc::[] | ||
|
||
Manual mode with GCP Workload Identity is supported for Google Cloud Platform (GCP). | ||
|
||
In manual mode with GCP Workload Identity, the individual {product-title} cluster components can impersonate IAM service accounts using short-term, limited-privilege credentials. | ||
|
||
Requests for new and refreshed credentials are automated by using an appropriately configured OpenID Connect (OIDC) identity provider, combined with IAM service accounts. {product-title} signs service account tokens that are trusted by GCP, and can be projected into a pod and used for authentication. Tokens are refreshed after one hour by default. | ||
|
||
//// | ||
to-do: GCP diagram from https://github.com/openshift/cloud-credential-operator/blob/master/docs/gcp_workload_identity_flow.png?raw=true | ||
|
||
.Workload Identity authentication flow | ||
image::<new_filename_for_gcp_workload_id.svg[Detailed authentication flow between GCP and the cluster when using GCP Workload Identity] | ||
//to-do: improve alt-text | ||
//// | ||
|
||
Using manual mode with GCP Workload Identity changes the content of the GCP credentials that are provided to individual {product-title} components. | ||
|
||
.GCP secret format | ||
|
||
[source,yaml] | ||
---- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
namespace: <target_namespace> <1> | ||
name: <target_secret_name> <2> | ||
data: | ||
service_account.json: <service_account> <3> | ||
---- | ||
<1> The namespace for the component. | ||
<2> The name of the component secret. | ||
<3> The Base64 encoded service account. | ||
|
||
.Content of the Base64 encoded `service_account.json` file using long-lived credentials | ||
|
||
[source,json] | ||
---- | ||
{ | ||
"type": "service_account", <1> | ||
"project_id": "<project_id>", | ||
"private_key_id": "<private_key_id>", | ||
"private_key": "<private_key>", <2> | ||
"client_email": "<client_email_address>", | ||
"client_id": "<client_id>", | ||
"auth_uri": "https://accounts.google.com/o/oauth2/auth", | ||
"token_uri": "https://oauth2.googleapis.com/token", | ||
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", | ||
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/<client_email_address>" | ||
} | ||
---- | ||
<1> The credential type is `service_account`. | ||
<2> The private RSA key that is used to authenticate to GCP. This key must be kept secure and is not rotated. | ||
|
||
.Content of the Base64 encoded `service_account.json` file using GCP Workload Identity | ||
|
||
[source,json] | ||
---- | ||
{ | ||
"type": "external_account", <1> | ||
"audience": "//iam.googleapis.com/projects/123456789/locations/global/workloadIdentityPools/test-pool/providers/test-provider", <2> | ||
"subject_token_type": "urn:ietf:params:oauth:token-type:jwt", | ||
"token_url": "https://sts.googleapis.com/v1/token", | ||
"service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/<client_email_address>:generateAccessToken", <3> | ||
"credential_source": { | ||
"file": "<path_to_token>", <4> | ||
"format": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
---- | ||
<1> The credential type is `external_account`. | ||
<2> The target audience is the GCP Workload Identity provider. | ||
<3> The resource URL of the service account that can be impersonated with these credentials. | ||
<4> The path to the service account token inside the pod. By convention, this is `/var/run/secrets/openshift/serviceaccount/token` for {product-title} components. | ||
|
||
//Supertask: Installing an OCP cluster configured for manual mode with GCP Workload Identity | ||
[id="gcp-workload-identity-mode-installing"] | ||
== Installing an {product-title} cluster configured for manual mode with GCP Workload Identity | ||
|
||
To install a cluster that is configured to use the Cloud Credential Operator (CCO) in manual mode with GCP Workload Identity: | ||
|
||
. xref:../../authentication/managing_cloud_provider_credentials/cco-mode-gcp-workload-identity.adoc#cco-ccoctl-configuring_cco-mode-gcp-workload-identity[Configure the Cloud Credential Operator utility]. | ||
. xref:../../authentication/managing_cloud_provider_credentials/cco-mode-gcp-workload-identity.adoc#cco-ccoctl-creating-at-once_cco-mode-gcp-workload-identity[Create the required GCP resources]. | ||
. xref:../../authentication/managing_cloud_provider_credentials/cco-mode-gcp-workload-identity.adoc#sts-mode-installing-manual-run-installer_cco-mode-gcp-workload-identity[Run the {product-title} installer]. | ||
. xref:../../authentication/managing_cloud_provider_credentials/cco-mode-gcp-workload-identity.adoc#sts-mode-installing-verifying_cco-mode-gcp-workload-identity[Verify that the cluster is using short-lived credentials]. | ||
|
||
//// | ||
// Remove until upgrade is supported. | ||
[NOTE] | ||
==== | ||
Because the cluster is operating in manual mode when using GCP Workload Identity, it is not able to create new credentials for components with the permissions that they require. When upgrading to a different minor version of {product-title}, there are often new GCP permission requirements. Before upgrading a cluster that is using GCP Workload Identity, the cluster administrator must manually ensure that the GCP permissions are sufficient for existing components and available to any new components. | ||
==== | ||
//// | ||
|
||
//Task part 1: Configuring the Cloud Credential Operator utility | ||
include::modules/cco-ccoctl-configuring.adoc[leveloffset=+2] | ||
|
||
//Task part 2: Creating the required GCP resources all at once | ||
include::modules/cco-ccoctl-creating-at-once.adoc[leveloffset=+2] | ||
|
||
//Task part 3: Run the OCP installer | ||
include::modules/sts-mode-installing-manual-run-installer.adoc[leveloffset=+2] | ||
|
||
//Task part 4: Verify that the cluster is using short-lived credentials | ||
include::modules/sts-mode-installing-verifying.adoc[leveloffset=+2] | ||
|
||
//// | ||
// No Upgrade in 4.10 but this should work exactly the same as AWS STS does. | ||
[id="gcp-workload-identity-mode-upgrading"] | ||
== Upgrading an {product-title} cluster configured for manual mode with GCP Workload Identity | ||
The release image for the version of {product-title} that you are upgrading to contains a version of the `ccoctl` binary and list of `CredentialsRequest` objects specific to that release. | ||
:context: sts-mode-upgrading | ||
include::modules/cco-ccoctl-configuring.adoc[leveloffset=+2] | ||
include::modules/cco-ccoctl-upgrading.adoc[leveloffset=+2] | ||
include::modules/manually-maintained-credentials-upgrade.adoc[leveloffset=+2] | ||
//// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.