Create ServiceAccount token

Generate a short-lived bound service account token

kubectl create token <sa-name> -n <ns> --duration=1h

tool
kubectl73 commands
tags
rbacconfig

More kubectl commands

  • kubectl auth can-i --list -n <ns>

    Show all permissions the current user has in a namespace

  • kubectl delete pods --all -n <ns>

    Force recreation of all pods — useful after ConfigMap changes

  • kubectl get ingress -A

    All Ingress resources with hosts and addresses

  • kubectl get pods -n <ns> -o yaml > pods-dump.yaml

    Backup/inspect entire pod state in a namespace

  • kubectl get pods -A -o jsonpath='{range .items[*]}{.metadata.namespace}{"\t"}{.metadata.name}{"\t"}{range .spec.containers[*]}{.image}{"\n"}{end}{end}'

    Enumerate every container image running in the cluster

all 73 kubectl commands