What was that field in the manifest again?
$ kubectl explain statefulset.spec.template.spec
List contexts:
$ kubectl config get-contexts
Simple jump pod:
$ kubectl run -i -t --rm jump --image=quay.io/mhausenblas/jump:v0.1 -- sh
Name of pod(s) labelled with app=example
:
$ kubectl get po -l=app=example -o=custom-columns=:metadata.name --no-headers
Can a certain SA list pods?
$ kubectl auth can-i list pods --as=system:serviceaccount:sec:myappsa
Create rolebinding for an SA in a specified namespace and just do a dry run:
$ kubectl create rolebinding podreaderbinding --role=sec:podreader --serviceaccount=sec:myappsa --namespace=sec --dry-run=true -o=yaml -n=sec