sandervanvugt

cka day2 nov20

Nov 6th, 2020
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. 1 mkdir -p $HOME/.kube
  2. 2 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  3. 3 ls -l .kube/config
  4. 4 sudo chmod student:student .kube/config
  5. 5 sudo chown student:student .kube/config
  6. 6 exit
  7. 7 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  8. 8 kubectl get pods -A
  9. 9 kubectl get nodes
  10. 10 exit
  11. 11 kubectl get nodes
  12. 12 kubectl get all -n kube-system -o wide
  13. 13 ip a
  14. 14 exit
  15. 15 kubectl get nodes -o wide
  16. 16 ssh root@192.168.4.105
  17. 17 cka/counter.sh 12
  18. 18 sudo useradd anna && sudo cd /home/anna
  19. 19 pwd
  20. 20 su -
  21. 21 cd /home/anna
  22. 22 sudo chmod 777 /home/anna
  23. 23 kubectl config set-credentials anna --client-certificate=/home/anna/.certs/anna.crt --client-key=/home/anna/.certs/anna.key
  24. 24 ls
  25. 25 pwd
  26. 26 cd /home/anna
  27. 27 kubectl config set-credentials anna --client-certificate=/home/anna/.certs/anna.crt --client-key=/home/anna/.certs/anna.key
  28. 28 mkdir .kube
  29. 29 sudo cp /etc/kubernetes/admin.conf /home/anna/.kube/config
  30. 30 vim .kube/config
  31. 31 sudo vim .kube/config
  32. 32 sudo chown -R anna /home/anna
  33. 33 ls -al
  34. 34 sudo chown -R anna:anna /home/anna
  35. 35 ls -al
  36. 36 cd .kube/
  37. 37 ls
  38. 38 ls -a
  39. 39 ls -al
  40. 40 cd
  41. 41 pwd
  42. 42 cd cka/
  43. 43 ls
  44. 44 vim podacessrole.yaml
  45. 45 kubectl create -f podacessrole.yaml
  46. 46 kubectl get role
  47. 47 kubectl get role -A
  48. 48 vim rolebinding.yaml
  49. 49 kubectl create -f rolebinding.yaml
  50. 50 kubectl run rolepod --image=nginx
  51. 51 kubectl get pdos
  52. 52 kubectl get pods
  53. 53 kubectl can-i get pods
  54. 54 kubectl can -h
  55. 55 su - anna
  56. 56 kubectl auth -h
  57. 57 kubectl auth can-i -h
  58. 58 kubectl auth can-i get pods
  59. 59 kubectl auth can-i get pods --as anna
  60. 60 sudo passwd anna
  61. 61 su - anna
  62. 62 ls
  63. 63 cat podacessrole.yaml
  64. 64 cat rolebind
  65. 65 cat rolebinding.yaml
  66. 66 kubectl get nodes --show-labels
  67. 67 kubectl lab nodes worker2.example.com disktype=ssd
  68. 68 kubectl label nodes worker2.example.com disktype=ssd
  69. 69 vim selector-pod.yaml
  70. 70 kubectl apply -f selector-pod.yaml
  71. 71 kubectl get pods -o wide
  72. 72 kubectl taint nodes worker1.example.com example-key=value1:NoSchedule
  73. 73 kubectl describe nodes worker1.example.com
  74. 74 kubectl describe nodes worker1.example.com | less
  75. 75 kubectl create deployment nginx-taint --image=nginx
  76. 76 kubectl scale deployment nginx-taint --replicas=3
  77. 77 kubectl get pods -o wide
  78. 78 vim taint-toleration.yaml
  79. 79 kubectl create -f taint-toleration.yaml
  80. 80 kubectl get pods -o wide
  81. 81 kubectl describe nodes control1.example.com
  82. 82 kubectl describe nodes control1.example.com | less
  83. 83 history
Add Comment
Please, Sign In to add comment