sandervanvugt

Kube3weeks day2 feb22

Feb 11th, 2022
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.37 KB | None | 0 0
  1. student@student-virtual-machine:~/kube3weeks$ history
  2. 1 minikube start --vm-driver=docker
  3. 2 ./countdown 15
  4. 3 minikube status
  5. 4 kubectl get all
  6. 5 kubectl -h | less
  7. 6 kubectl completion -h | less
  8. 7 source <(kubectl completion bash)
  9. 8 kubectl create -h | less
  10. 9 kubectl create deploy -h | less
  11. 10 kubectl create deployment myfirstapp --image=quay.io/bitnami/nginx --replicas=3
  12. 11 kubectl get all
  13. 12 ./countdown 12
  14. 13 history
  15. 14 kubectl get all
  16. 15 kubectl describe pod myfirstapp-868c68b945-2zd45
  17. 16 kubectl describe pod myfirstapp-868c68b945-2zd45 | less
  18. 17 kubectl get all
  19. 18 kubectl delete pod myfirstapp-868c68b945-2zd45
  20. 19 kubectl get all
  21. 20 kubectl run lonelypod --image=nginx
  22. 21 kubectl get all
  23. 22 kubectl delete pod lonelypod
  24. 23 kubectl get all
  25. 24 kubectl -h | less
  26. 25 kubectl delete -h | less
  27. 26 kubectl get all
  28. 27 kubectl delete deploy myfirstapp
  29. 28 kubectl get all
  30. 29 kubectl api-resources | less
  31. 30 kubectl explain deployment
  32. 31 kubectl explain deployment.spec
  33. 32 kubectl explain deployment.spec.template
  34. 33 kubectl explain deployment.spec.template.spec | less
  35. 34 cd
  36. 35 cd kube3weeks/
  37. 36 ls
  38. 37 vim multicontainer.yaml
  39. 38 kubectl explain pod
  40. 39 vim multicontainer.yaml
  41. 40 kubectl explain deployment.spec.template.spec.containers | less
  42. 41 kubectl create deployment myfirstapp --image=quay.io/bitnami/nginx --replicas=3 --dry-run=client -o yaml
  43. 42 kubectl create deployment myfirstapp --image=quay.io/bitnami/nginx --replicas=3 --dry-run=client -o yaml > myfirstapp.yaml
  44. 43 vim myfirstapp.yaml
  45. 44 kubectl create -f myfirstapp.yaml
  46. 45 kubectl get all
  47. 46 history
  48. 47 exit
  49. 48 ls
  50. 49 sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
  51. 50 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  52. 51 sudo apt-key fingerprint 0EBFCD88
  53. 52 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  54. 53 sudo apt-get update
  55. 54 sudo apt-get docker-ce docker-ce-cli containerd.io
  56. 55 sudo apt-get install docker-ce docker-ce-cli containerd.io
  57. 56 history
  58. 57 sudo docker run hello-world
  59. 58 git clone https://github.com/sandervanvugt/kube3weeks
  60. 59 cd kube3weeks/
  61. 60 ls
  62. 61 ./countdown 15
  63. 62 docker run nginx
  64. 63 sudo usermod -aG docker student
  65. 64 newgrp docker
  66. 65 docker run nginx
  67. 66 docker run -d nginx
  68. 67 docker run nginx -d
  69. 68 docker run busybox
  70. 69 docker ps
  71. 70 docker ps -a
  72. 71 docker run -it busybox
  73. 72 docker ps
  74. 73 docker ps -a
  75. 74 docker run -it nginx sh
  76. 75 docker ps
  77. 76 docker stop adoring_banzai
  78. 77 docker ps
  79. 78 docker images
  80. 79 docker run ubi8/ubi
  81. 80 docker run fedora
  82. 81 docker images
  83. 82 docker rmi hello-world:latest
  84. 83 docker ps -a
  85. 84 docker rm hungry_gauss
  86. 85 docker rmi hello-world:latest
  87. 86 ls
  88. 87 cd dockerfile/
  89. 88 vim Dockerfile
  90. 89 sudo apt install vim
  91. 90 vim Dockerfile
  92. 91 docker build -t mymap .
  93. 92 vim Dockerfile
  94. 93 docker build -t mymap .
  95. 94 docker images
  96. 95 docker run mymap
  97. 96 docker run -it map bash
  98. 97 vim Dockerfile
  99. 98 docker build -t yourmap .
  100. 99 docker images
  101. 100 docker inspect yourmap | less
  102. 101 docker inspect mymap | less
  103. 102 docker run yourmap
  104. 103 docker run -it yourmap bash
  105. 104 cd ..
  106. 105 ls
  107. 106 ./minikube-docker-setup.sh
  108. 107 history
  109. 108 minikube staus
  110. 109 minikube status
  111. 110 kubectl create deploy busybox --dry-run=client -o yaml -- sleep 3600
  112. 111 kubectl create deploy busybox --image=busybox --dry-run=client -o yaml -- sleep 3600
  113. 112 sudo poweroff
  114. 113 history
  115. 114 kubectl api-resources | less
  116. 115 minikube start
  117. 116 kubectl api-resources | less
  118. 117 kubectl explain ippools
  119. 118 kubectl explain ippools.spec
  120. 119 kubectl explain pods.spec
  121. 120 kubectl explain pods.spec | less
  122. 121 kubectl explain pods.spec.containers
  123. 122 kubectl explain pods.spec.containers.volumeDevices
  124. 123 kubectl explain pods.spec.containers.volumeDevices.devicePath
  125. 124 kubectl explain -h | less
  126. 125 kubectl explain --recursive pods
  127. 126 kubectl explain --recursive pods | less
  128. 127 history | grep dry-run
  129. 128 ls
  130. 129 cd kube3weeks/
  131. 130 vim myfirstapp.yaml
  132. 131 kubectl api-resources
  133. 132 source <(kubectl completion bash)
  134. 133 vim multicontainer.yaml
  135. 134 kubectl create -f multicontainer.yaml
  136. 135 kubectl get pods
  137. 136 ls
  138. 137 vim initcontainer.yaml
  139. 138 kubectl create -f initcontainer.yaml
  140. 139 kubectl get pods
  141. 140 kubectl describe pod init-demo
  142. 141 kubectl get pods
  143. 142 vim initcontainer.yaml
  144. 143 kubectl create -f initcontainer.yaml
  145. 144 vim initcontainer.yaml
  146. 145 kubectl create -f initcontainer.yaml
  147. 146 kubectl get pods
  148. 147 kubectl describe pod init-demo2
  149. 148 vim initcontainer.yaml
  150. 149 kubectl create -f initcontainer.yaml
  151. 150 kubectl get pods
  152. 151 kubectl delete pod init-demo2
  153. 152 kubectl delete pod init-demo3
  154. 153 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginxx.yaml
  155. 154 vim mynginxx.yaml
  156. 155 kubectl explain pods.spec
  157. 156 vim mynginxx.yaml
  158. 157 kubectl create -f mynginxx.yaml
  159. 158 vim mynginxx.yaml
  160. 159 kubectl apply -f mynginxx.yaml
  161. 160 kubectl get pods
  162. 161 kubectl delete -f mynginxx.yaml
  163. 162 kubectl get ns
  164. 163 kubectl get pods -n kube-system
  165. 164 minikube addons --list
  166. 165 minikube addons --help
  167. 166 minikube addons list
  168. 167 minikube dashboard
  169. 168 kubectl get ns
  170. 169 kubectl get all -n kubernetes-dashboard
  171. 170 kubectl create ns mynamespace
  172. 171 kubectl get ns
  173. 172 kubectl run mywhatever --image=nginx -n mynamespace
  174. 173 kubectl get pods
  175. 174 kubectl get pods -A
  176. 175 minikube ssh
  177. 176 ./countdown 12
  178. 177 kubectl api-resources | less
  179. 178 kubectl create deploy friginx --image=nginx --replicas=3
  180. 179 kubectl get all
  181. 180 kubectl get deployments.apps friginx -o yaml | less
  182. 181 kubectl get replicasets.apps friginx-f76f68bfc -o yaml | less
  183. 182 kubectl delete rs friginx-f76f68bfc
  184. 183 kubectl get all
  185. 184 kubectl delete pod friginx-f76f68bfc-6wl8w
  186. 185 kubectl get all
  187. 186 kubectl scale deployment friginx --replicas=0
  188. 187 kubectl get all
  189. 188 kubectl scale deployment friginx --replicas=3
  190. 189 kubectl get all
  191. 190 vim ds.yaml
  192. 191 kubectl create -h | less
  193. 192 vim ds.yaml
  194. 193 kubectl create -f ds.yaml
  195. 194 kubectl get all
  196. 195 kubectl get ds
  197. 196 vim ds.yaml
  198. 197 kubectl get all -n kube-system
  199. 198 cd ..
  200. 199 git clone https://github.com/sandervanvugt/cka
  201. 200 ls
  202. 201 cd cka
  203. 202 ls
  204. 203 kubectl get all -n kube-system
  205. 204 kubectl explain deployment.spec
  206. 205 kubectl explain deployment.spec.strategy
  207. 206 kubectl explain deployment.spec.strategy.type
  208. 207 kubectl explain deployment.spec.strategy.rollingUpdate
  209. 208 kubectl set -h | less
  210. 209 kubectl set env -h
  211. 210 kubectl create deploy oldnginx --image=nginx:1.7 --replicas=3
  212. 211 kubectl get all
  213. 212 kubectl get all --selector app=oldnginx
  214. 213 kubectl set image deploy nginx=nginx:latest; kubectl get all --selector app=oldnginx
  215. 214 kubectl set image deploy oldnginx nginx:latest; kubectl get all --selector app=oldnginx
  216. 215 kubectl set image --help | less
  217. 216 kubectl set image deploy oldnginx nginx=nginx:latest; kubectl get all --selector app=oldnginx
  218. 217 kubectl get all --selector app=oldnginx
  219. 218 kubectl edit deploy oldnginx
  220. 219 kubectl get pods
  221. 220 kubectl get pods oldnginx-696c559d96-92r4p -o yaml
  222. 221 kubectl create deploy astest --image=nginx --replicas=3 --dry-run=client -o yaml > astest.yaml
  223. 222 vim astest.yaml
  224. 223 kubectl apply -f astest.yaml
  225. 224 kubectl get all
  226. 225 vim astest.yaml
  227. 226 kubectl set image -h | less
  228. 227 kubectl delete -f astest.yaml
  229. 228 vim astest.yaml
  230. 229 kubectl set image -h | less
  231. 230 #kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
  232. 231 kubectl set image deployment/astest sleepy=busybox webby=nginx:1.9.1
  233. 232 kubectl apply -f astest.yaml
  234. 233 kubectl set image deployment/astest sleepy=busybox webby=nginx:1.9.1
  235. 234 kubectl rollout -h
  236. 235 kubectl rollout history deployment astest
  237. 236 kubectl rollout status deployment astest 2
  238. 237 kubectl rollout status deployment astest
  239. 238 kubectl rollout undo deployment astest
  240. 239 kubectl rollout status -h
  241. 240 kubectl rollout status deployment astest --revision=2
  242. 241 kubectl rollout status deployment astest --revision=3
  243. 242 kubectl get pods
  244. 243 kubectl set env -h | less
  245. 244 kubectl set env pod multicontainer cow=yes
  246. 245 kubectl set env -h | less
  247. 246 kubectl get deploy
  248. 247 kubectl rollout status deploy astest
  249. 248 kubectl rollout history deployment astest
  250. 249 kubectl rollout history deployment astest --revision=3
  251. 250 kubectl rollout history deployment astest --revision=2
  252. 251 kubectl rollout undo deployment astest --to-revision=2
  253. 252 history
  254. 253 kubectl get deploy
  255. 254 kubectl get deployments.apps friginx -o yaml | less
  256. 255 kubectl get all --show-labels
  257. 256 kubectl get all --show-labels --selector app=frigninx
  258. 257 kubectl get all --show-labels --selector app=frignix
  259. 258 kubectl get all --show-labels
  260. 259 kubectl get all --show-labels --selector app=friginx
  261. 260 kubectl label pod friginx-f76f68bfc-ff4cf app-
  262. 261 kubectl get all
  263. 262 kubectl get all --show-labels
  264. 263 ./counter.sh 13
  265. 264 kubectl get deploy
  266. 265 kubectl get pods -o wide
  267. 266 kubectl expose deployment friginx --port=80
  268. 267 kubectl describe deployments.apps friginx
  269. 268 kubectl describe service friginx
  270. 269 kubectl get endpoints
  271. 270 curl 10.102.28.29
  272. 271 minikube ssh
  273. 272 kubectl edit svc friginx
  274. 273 kubectl get svc
  275. 274 minikube ip
  276. 275 curl http://192.168.49.2:32175
  277. 276 kubectl describe svc friginx
  278. 277 minikube addon list
  279. 278 minikube addons list
  280. 279 minikube addons enable ingress
  281. 280 kubectl get ns
  282. 281 kubectl get all -n ingress-nginx
  283. 282 kubectl get svc fringinx
  284. 283 kubectl get svc friginx
  285. 284 kubectl create ingress friginx-ingress --rule="/=friginx:80" --rule="/hello=newdep:8080"
  286. 285 kubectl get ingress
  287. 286 sudo vim /etc/hosts
  288. 287 kubectl get ingress
  289. 288 curl friginx.info
  290. 289 ip a
  291. 290 minikube ip
  292. 291 sudo vim /etc/hosts
  293. 292 curl friginx.info
  294. 293 kubectl describe ingress friginx-ingress
  295. 294 kubectl create deploy newdep --image=gcr.io/google-sampels/hello-app:2.0
  296. 295 kubectl expose deploy newdep --port=8080
  297. 296 kubectl describe ingress friginx-ingress
  298. 297 kubectl delete deploy newdep
  299. 298 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  300. 299 kubectl describe ingress friginx-ingress
  301. 300 curl nginxsvc.info/hello
  302. 301 kubectl get svc
  303. 302 curl friginx.info/hello
  304. 303 minikube ip
  305. 304 curl 10.107.229.254:8080
  306. 305 minikube ssh
  307. 306 ./counter.sh 13
  308. 307 kubectl describe ingress friginx-ingress
  309. 308 ssh 192.168.29.2
  310. 309 kubectl port-forward -h | less
  311. 310 kubectl explain pod.spec.volumes | less
  312. 311 kubectl explain pvc.spec
  313. 312 kubectl explain pvc.spec | less
  314. 313 cd ../kube3weeks/
  315. 314 ls
  316. 315 vim pv.yaml
  317. 316 kubectl create -f pv.yaml
  318. 317 kubectl get pv
  319. 318 vim pvc.yaml
  320. 319 kubectl create -f pvc.yaml
  321. 320 kubectl get pv,pvc
  322. 321 kubectl get storageclass
  323. 322 kubectl describe pv pvc-de9bd38c-38ac-407d-9338-caadc591650b
  324. 323 vim pv-pod.yaml
  325. 324 kubectl create -f pv-pod.yaml
  326. 325 vim pv-pod.yaml
  327. 326 kubectl get pods
  328. 327 kubectl exec -it pv-pod -- touch /usr/share/nginx/html/FRIDAY
  329. 328 minikube ssh
  330. 329 vim pv-pvc-pod.yaml
  331. 330 kubectl create -f pv-pvc-pod.yaml
  332. 331 kubectl create ns myvol
  333. 332 kubectl delete -f pv-pvc-pod.yaml
  334. 333 kubectl create -f pv-pvc-pod.yaml
  335. 334 kubectl get pvc,pv -n myvol
  336. 335 vim pv-pvc-pod.yaml
  337. 336 minikube node add
  338. 337 minikube node list
  339. 338 kubectl get all -n kube-system
  340. 339 kubectl get all -n kube-system -o wide
  341. 340 history
  342.  
Advertisement
Add Comment
Please, Sign In to add comment