sandervanvugt

aka day 1 march21

Mar 18th, 2021
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.58 KB | None | 0 0
  1. [student@control cka]$ history
  2. 1 mkdir -p $HOME/.kube
  3. 2 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  4. 3 sudo chown $(id -u):$(id -g) $HOME/.kube/config
  5. 4 ls -l .kube/config
  6. 5 kubectl get all
  7. 6 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  8. 7 kubectl get pods -A
  9. 8 exit
  10. 9 mkdir -p $HOME/.kube
  11. 10 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  12. 11 sudo chown $(id -u):$(id -g) $HOME/.kube/config
  13. 12 kubectl get pods -A
  14. 13 kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
  15. 14 kubectl get pods -A
  16. 15 ssh root@192.168.29.51
  17. 16 kubectl get nodes
  18. 17 ssh root@192.168.29.52
  19. 18 kubectl get nodes
  20. 19 kubectl get pods -A
  21. 20 kubectl get pods -A -o wide
  22. 21 ps aux | grep apiserver
  23. 22 history
  24. 23 exit
  25. 24 kubectl get all
  26. 25 cd .kube/
  27. 26 ls
  28. 27 vim config
  29. 28 sudo useradd anna
  30. 29 sudo passwd anna
  31. 30 exit
  32. 31 kubectl get daemonset -A
  33. 32 git clone https://github.com/sandervanvugt/cka
  34. 33 cd cka/
  35. 34 ls
  36. 35 ./counter.sh 3
  37. 36 kubectl create ns mynamespace
  38. 37 kubectl run alpine --image=alpine -n mynamespace -- sleep 3600
  39. 38 kubectl get pods -n mynamespace -o yaml
  40. 39 kubectl -h
  41. 40 kubectl completion -h
  42. 41 source <(kubectl completion bash)
  43. 42 ./counter.sh 5
  44. 43 vim mcp.yaml
  45. 44 kubectl create -f mcp.yaml
  46. 45 vim mcp.yaml
  47. 46 kubectl create -f mcp.yaml
  48. 47 kubectl get pods
  49. 48 kubectl run mypod --image=redis --image=nginx --image=busybox --dry-run=client -o yaml
  50. 49 vim abc.yaml
  51. 50 kubectl run -h | less
  52. 51 kubectl run buysbox --image=busybox --command -- sleep 3600 --dry-run=client -o yaml
  53. 52 kubectl delete po buysbox
  54. 53 kubectl run buysbox --image=busybox --dry-run=client -o yaml -- sleep 36000
  55. 54 ./counter.sh 18
  56. 55 vim exercise4.yaml
  57. 56 kubectl create -f exercise4.yaml
  58. 57 kubectl get pods
  59. 58 kubectl describe pod init-demo
  60. 59 vim bonus-exo.txt
  61. 60 vim npabc.yaml
  62. 61 #kubectl taint nodes worker-2 key1=value1:NoSchedule
  63. 62 kubectl explain pod.spec.toleration
  64. 63 kubectl explain pod.spec
  65. 64 kubectl explain pod.spec.tolerations
  66. 65 kubectl explain pod.spec.tolerations.value
  67. 66 kubectl explain pod.spec.tolerations.effect
  68. 67 history
  69. 68 #kubectl taint nodes worker-2 key1=value1:NoSchedule
  70. 69 kubectl taint nodes worker2 key1=value1:NoSchedule
  71. 70 kubectl get nodes
  72. 71 kubectl taint nodes worker2.example.com key1=value1:NoSchedule
  73. 72 kubectl get pods -o wide
  74. 73 vim npabc.yaml
  75. 74 kubectl create -f npabc.yaml
  76. 75 kubectl get pods -o wide
  77. 76 kubectl create deployment anothernginx --image=nginx --replicas=4
  78. 77 kubectl get pods -o wide
  79. 78 kubectl taint nodes worker2.example.com key1=value1:NoSchedule-
  80. 79 kubectl get pods -o wide
  81. 80 kubectl delete pod anothernginx-5556746bdc-lj4d4
  82. 81 kubectl get pods -o wide
  83. 82 kubectl explain pod.spec.nodename
  84. 83 kubectl explain pod.spec | less
  85. 84 kubectl explain pod.spec.nodeName
  86. 85 ./counter.sh 15
  87. 86 kubectl top pods
  88. 87 cd ..
  89. 88 git clone https://github.com/kubernetes-sigs/metrics-server
  90. 89 ls
  91. 90 cd metrics-server/
  92. 91 ls
  93. 92 cd manifests/
  94. 93 less ../README.md
  95. 94 ls
  96. 95 cd base/
  97. 96 ls
  98. 97 cd
  99. 98 kubectl create -f metrics-server/manifests/base/
  100. 99 kubectl delete -f metrics-server/manifests/base/
  101. 100 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
  102. 101 kubectl -n kube-system edit deployments.apps metrics-server
  103. 102 kubectl -n kube-system logs metrics-server-5b78d5f9c6-kwx27
  104. 103 kubectl get deploy -n kube-system
  105. 104 kubectl get pods -n kube-system
  106. 105 kubectl get pods
  107. 106 kubectl top -h
  108. 107 kubectl top pod
  109. 108 history
  110. 109 kubectl top pod -h
  111. 110 kubectl top pod --sort-by=cpu
  112. 111 kubectl top pod --sort-by=cpu | head -2 | tail -1
  113. 112 kubectl top pod --sort-by=cpu | head -2 | tail -1 > /tmp/highload.txt
  114. 113 cd cka/
  115. 114 ./counter.sh 6
  116. 115 ssh root@worker2
  117. 116 ssh root@worker2.example.com
  118. 117 kubectl run mynginx --image=nginx --dry-run=client -o yaml > nginxb.ymal
  119. 118 scp nginxb.ymal root@worker2.example.com/var/lib/kubelet/
  120. 119 scp nginxb.ymal root@worker2.example.com:/var/lib/kubelet/nginxb.yaml
  121. 120 ssh root@worker2.example.com
  122. 121 kubectl get pods
  123. 122 history
Add Comment
Please, Sign In to add comment