How to view full details (like a token) of context

7/1/2018

I created a context in Kubernetes with:

kubectl config set-context --token="<JWY_token>" myservice-context

When I run:

kubectl config get-contexts 

I see all the contexts:

CURRENT   NAME                                                      CLUSTER                                     AUTHINFO                                           NAMESPACE
*         minikube                                                  minikube                                    minikube                                           
          myservice-context       

I want to see more details about myservice-context. For example, I want to see the token I just pass it while creating it.
I tried to run get-context with the name of my service but it doesn't provide the full details:

$ kubectl config get-contexts myservice-context
CURRENT   NAME                 CLUSTER   AUTHINFO   NAMESPACE
          myservice-context                        

How can I see the full details of the context (such as the token) ?

-- E235
kubernetes

1 Answer

7/1/2018

kubectl config view will show you, though it hides some fields (like the very long embedded TLS certificates).

If that's not enough information, by default the data is stored in a single YAML file, on Linux/MacOS in ~/.kube/config, and you can open that up in a text editor.

-- David Maze
Source: StackOverflow