Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## Docs and config
- What was that field in the manifest again?
- ```
- $ kubectl explain statefulset.spec.template.spec
- ```
- List contexts:
- ```
- $ kubectl config get-contexts
- ```
- ## Workloads
- 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
- ```
- ## RBAC
- 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
- ```
Add Comment
Please, Sign In to add comment