kubectl describe secret default-token

1 개요[ | ]

kubectl describe secret default-token
master:~$ kubectl describe secret default-token
Name:         default-token-l582t
Namespace:    default
Labels:       <none>
Annotations:  kubernetes.io/service-account.name: default
              kubernetes.io/service-account.uid: 7e3e2566-8110-11e9-894e-000c29cb3aad

Type:  kubernetes.io/service-account-token

Data
====
ca.crt:     1025 bytes
namespace:  7 bytes
token:      eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tbDU4MnQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjdlM2UyNTY2LTgxMTAtMTFlOS04OTRlLTAwMGMyOWNiM2FhZCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.eJY81Jt2xR-oZC0_PrlpDMu6cIgQgELohNRo_K6EQvdqbWsLuNhqj7a-lvD515gGE0Qh3w2alboeTrku69W7y9ZHW6ST1OxIbzWRkUd20gcvzx-vwOWegKqTIzz2hlRz9i7Ai_qTrXy8aLWprkqw9ZTuyQPuXuGzKyOKw-ZYzXHFteDxM1Jv7IRL96avqpTofE174K8M5saeCDWy5G5_mYI4UQ-q3qsjz9b2sOxl8gpap61g3VrCOFjN1lBhz3gcNX51ee3MlFszc3mCawz74o10-nKu1ZBNJpsaVEKzPmb7wKYAxJn6oQ9tsxR9X80v4hHW8yiu7SYOA0lvZBLREA
master:~$ token=$(kubectl describe secret default-token | grep ^token | cut -f7 -d' ')
master:~$ echo $token
eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImRlZmF1bHQtdG9rZW4tbDU4MnQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoiZGVmYXVsdCIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50LnVpZCI6IjdlM2UyNTY2LTgxMTAtMTFlOS04OTRlLTAwMGMyOWNiM2FhZCIsInN1YiI6InN5c3RlbTpzZXJ2aWNlYWNjb3VudDpkZWZhdWx0OmRlZmF1bHQifQ.eJY81Jt2xR-oZC0_PrlpDMu6cIgQgELohNRo_K6EQvdqbWsLuNhqj7a-lvD515gGE0Qh3w2alboeTrku69W7y9ZHW6ST1OxIbzWRkUd20gcvzx-vwOWegKqTIzz2hlRz9i7Ai_qTrXy8aLWprkqw9ZTuyQPuXuGzKyOKw-ZYzXHFteDxM1Jv7IRL96avqpTofE174K8M5saeCDWy5G5_mYI4UQ-q3qsjz9b2sOxl8gpap61g3VrCOFjN1lBhz3gcNX51ee3MlFszc3mCawz74o10-nKu1ZBNJpsaVEKzPmb7wKYAxJn6oQ9tsxR9X80v4hHW8yiu7SYOA0lvZBLREA
master:~$ kubectl config view | grep server:
    server: https://172.20.0.150:6443
master:~$ curl https://172.20.0.150:6443/apis -s -k --header "Authorization: Bearer $token"
{
  "kind": "APIGroupList",
  "apiVersion": "v1",
  "groups": [
    {
      "name": "apiregistration.k8s.io",
      "versions": [
        {
          "groupVersion": "apiregistration.k8s.io/v1",
          "version": "v1"
...
          "version": "v1"
        }
      ],
      "preferredVersion": {
        "groupVersion": "crd.projectcalico.org/v1",
        "version": "v1"
      }
    }
  ]
}

2 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}