Guest User

Untitled

a guest
Jan 21st, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. ## Docs and config
  2.  
  3. What was that field in the manifest again?
  4.  
  5. ```
  6. $ kubectl explain statefulset.spec.template.spec
  7. ```
  8.  
  9. List contexts:
  10.  
  11. ```
  12. $ kubectl config get-contexts
  13. ```
  14.  
  15. ## Workloads
  16.  
  17. Simple jump pod:
  18.  
  19. ```
  20. $ kubectl run -i -t --rm jump --image=quay.io/mhausenblas/jump:v0.1 -- sh
  21. ```
  22.  
  23. Name of pod(s) labelled with `app=example`:
  24.  
  25. ```
  26. $ kubectl get po -l=app=example -o=custom-columns=:metadata.name --no-headers
  27. ```
  28.  
  29. ## RBAC
  30.  
  31. Can a certain SA list pods?
  32.  
  33. ```
  34. $ kubectl auth can-i list pods --as=system:serviceaccount:sec:myappsa
  35. ```
  36.  
  37. Create rolebinding for an SA in a specified namespace and just do a dry run:
  38.  
  39. ```
  40. $ kubectl create rolebinding podreaderbinding --role=sec:podreader --serviceaccount=sec:myappsa --namespace=sec --dry-run=true -o=yaml -n=sec
  41. ```
Add Comment
Please, Sign In to add comment