Skip to Content
Kubernetes Cookbook - Second Edition
book

Kubernetes Cookbook - Second Edition

by Hideto Saito, Hui-Chuan Chloe Lee, Ke-Jou Carol Hsu
May 2018
Intermediate to advanced
554 pages
13h 51m
English
Packt Publishing
Content preview from Kubernetes Cookbook - Second Edition

Service account token authentication

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 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Kubernetes Cookbook

Kubernetes Cookbook

Sébastien Goasguen, Michael Hausenblas
DevOps with Kubernetes - Second Edition

DevOps with Kubernetes - Second Edition

Hideto Saito, Hui-Chuan Chloe Lee, Cheng-Yang Wu

Publisher Resources

ISBN: 9781788837606Supplemental Content