From f32bfbef167f3c0db52f5a55a6abf7d552fed4fa Mon Sep 17 00:00:00 2001 From: VALKIRIA ACUATICA <56233573+valkiriaaquatica@users.noreply.github.com> Date: Sun, 29 Sep 2024 13:41:55 +0200 Subject: [PATCH] get KUBERNETES_HOST in case multiple contextx exist --- docs/_docs/vault.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/_docs/vault.md b/docs/_docs/vault.md index 59e2c967..b32cb01e 100644 --- a/docs/_docs/vault.md +++ b/docs/_docs/vault.md @@ -663,8 +663,12 @@ Enabling [Vault kubernetes auth method](https://developer.hashicorp.com/vault/do # Get Kubernetes CA kubectl config view --raw --minify --flatten --output='jsonpath={.clusters[].cluster.certificate-authority-data}' | base64 --decode > k3s_ca.crt - # Get Kubernetes Url + # Get Kubernetes Url when using just one context of one cluster KUBERNETES_HOST=$(kubectl config view -o jsonpath='{.clusters[].cluster.server}') + + # Get Kubernetes Url of the actual cluster context using, in case there are multiples + KUBERNETES_HOST=$(kubectl config view --minify --flatten --output='jsonpath={.clusters[0].cluster.server}') + ``` - Step 7. Enable Kubernetes auth method