From f0e287684875f1f0805a05fa7e5938d7b9b91ce3 Mon Sep 17 00:00:00 2001 From: craigbox Date: Wed, 18 Jul 2018 23:22:56 +0100 Subject: [PATCH] Fixes to example for connecting with curl (#9337) * Fixes to example for connecting with curl Example for getting cluster token - does not work with multiple entries in kubeconfig - does not work with Istio installed Fix both * also need to change the tr from tabs to spaces --- .../docs/tasks/access-application-cluster/access-cluster.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/en/docs/tasks/access-application-cluster/access-cluster.md b/content/en/docs/tasks/access-application-cluster/access-cluster.md index 661d66eea9..ab66dc7ec4 100644 --- a/content/en/docs/tasks/access-application-cluster/access-cluster.md +++ b/content/en/docs/tasks/access-application-cluster/access-cluster.md @@ -77,11 +77,11 @@ $ curl http://localhost:8080/api/ ### Without kubectl proxy -In Kubernetes version 1.3 or later, `kubectl config view` no longer displays the token. Use `kubectl describe secret...` to get the token for the default service account, like this: +Use `kubectl describe secret...` to get the token for the default service account: ```shell -$ APISERVER=$(kubectl config view | grep server | cut -f 2- -d ":" | tr -d " ") -$ TOKEN=$(kubectl describe secret $(kubectl get secrets | grep default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d '\t') +$ APISERVER=$(kubectl config view --minify | grep server | cut -f 2- -d ":" | tr -d " ") +$ TOKEN=$(kubectl describe secret $(kubectl get secrets | grep ^default | cut -f1 -d ' ') | grep -E '^token' | cut -f2 -d':' | tr -d " ") $ curl $APISERVER/api --header "Authorization: Bearer $TOKEN" --insecure { "kind": "APIVersions",