Advertisement
sandervanvugt

CKAD day2 may21

May 11th, 2021
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.95 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. student@student-virtual-machine:~/ckad$ history
  6. 1 sudo apt install git vim
  7. 2 git clone https://github.com/sandervanvugt/ckad
  8. 3 cd ckad/
  9. 4 vim kube-setup.sh
  10. 5 sudo ls -l /root
  11. 6 ./kube-setup.sh
  12. 7 sudo reboot
  13. 8 history
  14. 9 df -h
  15. 10 free -m
  16. 11 history
  17. 12 cd ckad
  18. 13 ls
  19. 14 tail kube-setup.sh
  20. 15 minikube start --memory 4096 --vm-driver=kvm2
  21. 16 minikube status
  22. 17 kubectl get all
  23. 18 minikube -h | less
  24. 19 minikube dashboard
  25. 20 ./countdown 12
  26. 21 kubectl -h | less
  27. 22 kubectl completion -h
  28. 23 source <(kubectl completion bash)
  29. 24 kubectl get all
  30. 25 kubectl api-resources | less
  31. 26 kubectl explain pods
  32. 27 kubectl explain pods.spec
  33. 28 kubectl explain pods.spec | less
  34. 29 kubectl get all
  35. 30 kubectl delete pod dashginx-9577c55bf-6qr7h
  36. 31 kubectl get all
  37. 32 kubectl api-resources | grep repli
  38. 33 kubectl api-resources | grep apps
  39. 34 kubectl proxy --port=8001 &
  40. 35 curl http://localhost:8001/version
  41. 36 curl http://localhost:8001/api/v1/namespaces/default/pods
  42. 37 curl http://localhost:8001/api/v1/namespaces/default/pods | less
  43. 38 kubectl get pods
  44. 39 curl http://localhost:8001/api/v1/namespaces/default/pods/dashginx-9577c55bf-dvgh6
  45. 40 curl -XDELETE http://localhost:8001/api/v1/namespaces/default/pods/dashginx-9577c55bf-dvgh6
  46. 41 kubectl get all
  47. 42 history
  48. 43 ./countdown 12
  49. 44 netstat -tulpen | grep proxy
  50. 45 cd ..
  51. 46 cd .kube/
  52. 47 ls
  53. 48 less config
  54. 49 kubectl config view
  55. 50 cd
  56. 51 kubectl run -h | less
  57. 52 kubectl run mynginx --image=nginx
  58. 53 kubectl get all
  59. 54 kubectl get pods
  60. 55 kubectl describe pods mynginx
  61. 56 kubectl get pods
  62. 57 kubectl describe pod mydb
  63. 58 kubectl logs mydb
  64. 59 history
  65. 60 cd ckad/
  66. 61 ls
  67. 62 vim busybox.yaml
  68. 63 kubectl api-resources | less
  69. 64 vim busybox.yaml
  70. 65 kubectl create -f busybox.yaml
  71. 66 kubectl get pods
  72. 67 kubectl run dry --image=nginx --dry-run=client -o yaml
  73. 68 kubectl run dry --image=nginx --dry-run=client -o yaml > dry.yaml
  74. 69 vim dry.yaml
  75. 70 kubectl get pods
  76. 71 kubectl apply -f dry.yaml
  77. 72 kubectl get pods
  78. 73 kubectl delete pods dry
  79. 74 kubectl run -h | less
  80. 75 kubectl explain pods.spec
  81. 76 kubectl explain pods.spec.containers
  82. 77 kubectl explain pods.spec.containers.env
  83. 78 vim dry.yaml
  84. 79 kubectl create -f dry.yaml
  85. 80 vim dry.yaml
  86. 81 kubectl create -f dry.yaml
  87. 82 kubectl run -h | less
  88. 83 #kubectl run hazelcast --image=hazelcast/hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
  89. 84 kubectl run dry --image=nginx --env=whatever=no --dry-run=client -o yaml > dry.yaml
  90. 85 vim dry.yaml
  91. 86 ./countdown 11
  92. 87 kubectl get pods
  93. 88 kubectl get pods mydb -o yaml
  94. 89 kubectl get pods mydb -o yaml > failingdb.yaml
  95. 90 vim failingdb.yaml
  96. 91 kubectl get deploy
  97. 92 kubectl get deploy dashginx -o yaml > dashginx.yaml
  98. 93 vim dashginx.yaml
  99. 94 vim morevolumes.yaml
  100. 95 vim sidecar.yaml
  101. 96 kubectl create -f sidecar.yaml
  102. 97 kubectl exec -it sidecar-pod -c sidecar /bin/bash
  103. 98 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  104. 99 kubectl explain pods.spec.restartpolicy
  105. 100 kubectl explain pods.spec.restartPolicy
  106. 101 vim initpod.yaml
  107. 102 kubectl explain pod.spec
  108. 103 vim initpod.yaml
  109. 104 pastebin
  110. 105 history
  111. 106 minikube status
  112. 107 minikube start --memory 4096 --vm-driver=kvm2
  113. 108 grep vmx /proc/cpuinfo
  114. 109 sudo poweroff
  115. 110 minikube start --memory 4096 --vm-driver=kvm2
  116. 111 kubectl get pods
  117. 112 kubectl get all
  118. 113 kubectl get events
  119. 114 kubectl get pods
  120. 115 kubectl run sleepybox --image=busybox
  121. 116 kubectl get pods
  122. 117 kubectl describe sleepybox
  123. 118 kubectl describe pods sleepybox
  124. 119 kubectl completion -h | less
  125. 120 source <(kubectl completion bash)
  126. 121 kubectl describe pods mydb
  127. 122 kubectl logs mydb
  128. 123 kubectl describe pod mydb | less
  129. 124 kubectl get pods mydb -o yaml | less
  130. 125 kubectl exec -it mydb -- sh
  131. 126 kubectl exec -it mynginx -- sh
  132. 127 kubectl get pods
  133. 128 kubectl logs sidecar-pod
  134. 129 kubectl logs sidecar-pod -c app
  135. 130 kubectl logs sidecar-pod app
  136. 131 minikube ssh
  137. 132 kubectl api-resources | less
  138. 133 kubectl describe pod mydb | less
  139. 134 kubectl explain pod.spec.securityContext | less
  140. 135 kubectl explain pod.spec.containers.securityContext | less
  141. 136 kubectl explain --recursive pod.spec | less
  142. 137 cd ckad/
  143. 138 ls
  144. 139 vim securitycontextdemo2.yaml
  145. 140 kubectl create -f securitycontextdemo2.yaml
  146. 141 kubectl exec -it security-context-demo -- bash
  147. 142 kubectl exec -it security-context-demo -- sh
  148. 143 vim securitycontextdemo.yaml
  149. 144 kubectl create -f securitycontextdemo.yaml
  150. 145 kubectl get pods
  151. 146 kubectl describe nginxsvc-ingress.yaml
  152. 147 kubectl describe pods nginxsecure
  153. 148 kubectl get nodes -o wide
  154. 149 kubectl get pods -o wide
  155. 150 kubectl explain jobs.spec
  156. 151 vim simplejob.yaml
  157. 152 kubectl simplejob.yaml
  158. 153 kubectl create -f simplejob.yaml
  159. 154 kubectl get jobs
  160. 155 kubectl get all
  161. 156 kubectl get jobs -o yaml | less
  162. 157 kubectl delete jobs simple-job
  163. 158 vim simplejob.yaml
  164. 159 kubectl create -f simplejob.yaml
  165. 160 kubectl get all
  166. 161 ./countdown 12
  167. 162 kubectl explain cronjob.spec
  168. 163 vim cron-example.yaml
  169. 164 kubectl create -f cron-example.yaml
  170. 165 kubectl get all
  171. 166 date
  172. 167 kubectl get all
  173. 168 kubectl describe cronjobs.batch hello
  174. 169 kubectl get all
  175. 170 kubectl logs hello-1620739560-8rtfk
  176. 171 kubectl get ns
  177. 172 kubectl get pods
  178. 173 kubectl get pods -n kube-system
  179. 174 kubectl get pods -A
  180. 175 kubectl config view
  181. 176 kubectl config set-context --current --namespace=kube-system
  182. 177 kubect get all
  183. 178 kubectl get all
  184. 179 kubectl config set-context --current --namespace=default
  185. 180 oc get pods
  186. 181 kubectl get pods
  187. 182 kubectl create ns secret
  188. 183 kubectl get all -A
  189. 184 kubectl get pod -A
  190. 185 vim busybox-ns.yaml
  191. 186 kubectl create -f busybox-ns.yaml
  192. 187 kubectl get pods
  193. 188 vim busybox-ns.yaml
  194. 189 kubectl create -f busybox-ns.yaml
  195. 190 kubectl get pods -A
  196. 191 vim frontend-resources.yaml
  197. 192 kubectl create -f frontend-resources.yaml
  198. 193 kubectl get pods
  199. 194 kubectl describe pod frontend
  200. 195 kubectl delete -f frontend-resources.yaml
  201. 196 vim frontend-resources.yaml
  202. 197 kubectl create -f frontend-resources.yaml
  203. 198 kubectl describe pod frontend
  204. 199 kubectl get pods
  205. 200 kubectl delete -f frontend-resources.yaml
  206. 201 vim frontend-resources.yaml
  207. 202 kubectl create -f frontend-resources.yaml
  208. 203 kubectl get pods
  209. 204 kubectl delete all --all
  210. 205 kubectl get all -A
  211. 206 kubectl delete -h | less
  212. 207 kubectl explain deployment.spec
  213. 208 kubectl create -h | less
  214. 209 kubectl create deploy -h | less
  215. 210 kubectl create deployment sleepybox --image=busybox -- sleep 3600 --replicas=3
  216. 211 kubectl get all
  217. 212 kubectl describe pod sleepybox-67d699ffcc-fbsbh
  218. 213 kubectl logs sleepybox-67d699ffcc-fbsbh
  219. 214 kubectl delete deployments.apps sleepybox
  220. 215 kubectl create deployment sleepybox --image=busybox --replicas=3 -- sleep 3600
  221. 216 kubectl get all
  222. 217 kubectl get deployments.apps sleepybox -o yaml | less
  223. 218 ./countdown 12
  224. 219 vim redis-deploy.yaml
  225. 220 kubectl create -f redis-deploy.yaml
  226. 221 vim redis-deploy.yaml
  227. 222 kubectl explain deploy
  228. 223 vim redis-deploy.yaml
  229. 224 kubectl create -f redis-deploy.yaml
  230. 225 kubectl scale deployment redis --replicas=2
  231. 226 kubectl edit deployments.apps redis
  232. 227 kubectk get all
  233. 228 kubectl get all
  234. 229 kubectl delete pod redis-6fb5b985bc-vgpn9
  235. 230 kubectl get all
  236. 231 kubectl rollout -h
  237. 232 ls
  238. 233 vim rolling.yaml
  239. 234 kubectl create -f rolling.yaml
  240. 235 kubectl rollout history deployment
  241. 236 kubectl edit deployments.apps rolling-nginx
  242. 237 kubectl get all
  243. 238 kubectl rollout history deployment
  244. 239 kubectl rollout history deployment rolling-nginx --revision=2
  245. 240 kubectl rollout history deployment rolling-nginx --revision=1
  246. 241 kubectl rollout undo deployment rolling-nginx --to-revision=1
  247. 242 kubectl get all
  248. 243 kubectl rollout history deployment
  249. 244 kubectl get all
  250. 245 kubectl get all --show-labels
  251. 246 kubectl get all --selector app=sleepybox
  252. 247 kubectl create deployment ghost --image=ghost
  253. 248 kubectl label deployments.apps ghost state=demo
  254. 249 kubectl get all --show-labels
  255. 250 kubectl get all --selector state=demo
  256. 251 kubectl create deploy nginx --image=nginx
  257. 252 kubectl describe deployments.apps nginx
  258. 253 kubectl describe pod nginx-6799fc88d8-w4g2h
  259. 254 kubectl get all | grep nginx
  260. 255 kubectl label pod nginx-6799fc88d8-w4g2h app-
  261. 256 kubectl get all | grep nginx
  262. 257 kubectl run blah --image=nginx
  263. 258 kubectl get all --show-labels
  264. 259 kubectl get pods --selector=run
  265. 260 ./countdown 15
  266. 261 vim al.yaml
  267. 262 kubectl create -f al.yaml
  268. 263 kubectl get all
  269. 264 kubectl create -f al.yaml
  270. 265 vim al.yaml
  271. 266 kubectl create deploy nginxsvc --image=nginx
  272. 267 kubectl get all --selector app=nginxsvc
  273. 268 kubectl scale deployment nginxsvc --replicas=3
  274. 269 kubectl get all --selector app=nginxsvc
  275. 270 kubectl expose deployment nginxsvc --port=80
  276. 271 kubectl get all --selector app=nginxsvc
  277. 272 kubectl describe svc nginxsvc
  278. 273 kubectl get endpoints
  279. 274 curl 10.101.7.61
  280. 275 minikube ssh
  281. 276 kubectl edit svc nginxsvc
  282. 277 kubectl get svc
  283. 278 minikube ip
  284. 279 curl http://$(minikube ip):32000
  285. 280 minikube ssh
  286. 281 history
  287.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement