From f3111de02c4880f84d5049c18f54637b090f4ee1 Mon Sep 17 00:00:00 2001 From: Gazandi Date: Mon, 1 Mar 2021 23:24:09 +0700 Subject: [PATCH] docs: how to get serviceAccountToken Signed-off-by: gazandi --- docs/features/kubernetes/configuration.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/features/kubernetes/configuration.md b/docs/features/kubernetes/configuration.md index 3e138a7a0b..d76167d3cb 100644 --- a/docs/features/kubernetes/configuration.md +++ b/docs/features/kubernetes/configuration.md @@ -73,10 +73,18 @@ cluster. Valid values are: | `serviceAccount` | This will use a Kubernetes [service account](https://kubernetes.io/docs/reference/access-authn-authz/service-accounts-admin/) to access the Kubernetes API. When this is used the `serviceAccountToken` field should also be set. | | `google` | This will use a user's Google auth token from the [Google auth plugin](https://backstage.io/docs/auth/) to access the Kubernetes API. | -### `clusters.\*.serviceAccount` (optional) +### `clusters.\*.serviceAccountToken` (optional) The service account token to be used when using the `serviceAccount` auth -provider. +provider. You could get the service account token with: + +```sh +kubectl -n get secret $(kubectl -n get sa -o=json \ +| jq -r '.secrets[0].name') -o=json \ +| jq -r '.data["token"]' \ +| base64 --decode \ +| pbcopy +``` ### Role Based Access Control