0

I installed kubernetes according to this manual + containerd, installed the kubernetes dashboard according to this manual and created service account for this manual, but when I try to look at the token, the console does not display it.

enter image description here

KSHMR
  • 3
  • 2
  • looks like you're describing the secret, not getting it. `kubectl get secret -o json | jq '.data | map_values(@base64d)'` ought to decode the values (assuming base64 encoded; also assuming you have `jq`.) You'll need to `-n` the namespace as well. – Roddy of the Frozen Peas Jun 01 '22 at 04:30
  • Does this answer your question? [Decoding Kubernetes secret](https://stackoverflow.com/questions/56909180/decoding-kubernetes-secret) – Roddy of the Frozen Peas Jun 01 '22 at 04:31
  • `kubectl get secret SEC-NAME -o go-template='{{.data | base64decode}}'`, no other tool is needed, plain kubectl using go-template. You may need to update stuff between the curlys. – P.... Jun 01 '22 at 05:15
  • Also, in kubernetes.io 1.24 secret is not created automatically for a service account. Consider checking your kubernetes version. – P.... Jun 01 '22 at 05:21
  • version v1.24.1 – KSHMR Jun 01 '22 at 05:36

1 Answers1

4

kubernetes: 1.24.0

dashboard: 2.6.0

Manually create a service account API token.

https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.md

Ycong
  • 56
  • 1