May 2018
Intermediate to advanced
554 pages
13h 51m
English
We've created a service account in the previous section; now, let's see how to use a service account token to do the authentication. We'll have to retrieve the token first:
// check the details of the secret# kubectl get secret chapter8-serviceaccount-token-nxh47 -o yamlapiVersion: v1data: ca.crt: <base64 encoded> namespace: ZGVmYXVsdA== token: <bearer token, base64 encoded>kind: Secretmetadata: annotations: kubernetes.io/service-account.name: chapter8-serviceaccount name: chapter8-serviceaccount-token-nxh47 namespace: default ...type: kubernetes.io/service-account-token
We can see that the three items under the data are all base64-encoded. We can decode them easily with the echo "encoded content" | base64 ...