From 64d283e9da6a0a8511f36947def44a9b3a3c4f86 Mon Sep 17 00:00:00 2001 From: micnncim Date: Wed, 9 Feb 2022 21:20:42 +0900 Subject: [PATCH] Add authentication guide for Google Cloud APIs Adds a guide for configuring authentication to Google Cloud APIs. Though this provides enough information to cover the feature added in this PR, we should improve the way to configure a `ServiceAccount` for practical use cases since in any methods users need to reconfigure IAM stuff every time a new `ProviderRevision` is created. Signed-off-by: micnncim --- docs/AUTHENTICATION.md | 162 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 docs/AUTHENTICATION.md diff --git a/docs/AUTHENTICATION.md b/docs/AUTHENTICATION.md new file mode 100644 index 000000000..15c5abd83 --- /dev/null +++ b/docs/AUTHENTICATION.md @@ -0,0 +1,162 @@ +# Authenticating to Google Cloud APIs + +`provider-gcp` requires credentials to be provided in order to authenticate to +the Google Cloud APIs. This can be done in one of the following ways: + +- Authenticating using a base-64 encoded service account key in a Kubernetes + `Secret`. This is described in detail [here](https://crossplane.io/docs/v1.6/getting-started/install-configure.html#get-gcp-account-keyfile). +- Authenticating using [Workload Identity](https://cloud.google.com/kubernetes-engine/docs/concepts/workload-identity). + This is described in the [section below](#authenticating-with-workload-identity). + +## Authenticating with Workload Identity + +*Note: This method is supported in `provider-gcp` v0.20.0 and later.* + +Using Workload Identity requires some additional setup. +Many of the steps can also be found in the [documentation](https://cloud.google.com/kubernetes-engine/docs/how-to/workload-identity). + +### Steps + +These steps assume you already have a running GKE cluster which has already +enabled Workload Identity and has a sufficiently large node pool. + +Note that you can specify any valid strings to the variables below unless the +variable is explicitly assigned. + +#### 1. Install Crossplane + +Install Crossplane from `stable` channel: + +```bash +$ helm repo add crossplane-stable https://charts.crossplane.io/stable +$ helm install crossplane --create-namespace --namespace crossplane-system crossplane-stable/crossplane +``` + +`provider-gcp` can be installed with either the [Crossplane CLI](https://crossplane.io/docs/v1.6/getting-started/install-configure.html#install-crossplane-cli) +or a `Provider` resource as below: + +```console +$ cat <