sandervanvugt

CKAD jan22 all-3-days

Jan 12th, 2022
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.24 KB | None | 0 0
  1. student@student-virtual-machine:~/ckad$ history
  2. 1 sudo apt install vim git
  3. 2 git clone https://github.com/sandervanvugt/ckad
  4. 3 cd ckad
  5. 4 ls
  6. 5 ./minikube-docker-setup.sh
  7. 6 minikube start --vm-driver=docker
  8. 7 kubectl get all
  9. 8 minikube status
  10. 9 minikube --help
  11. 10 minikube dashboard
  12. 11 bg
  13. 12 history
  14. 13 kubectl get all
  15. 14 ./countdown 12
  16. 15 kubectl --help | less
  17. 16 kubectl create --help | less
  18. 17 kubectl create deployment --help | less
  19. 18 kubectl create deployment my-dep --image=nginx --replicas=3
  20. 19 kubectl get all
  21. 20 kubectl completion -h | less
  22. 21 source <(kubectl completion bash)
  23. 22 kubectl create poddisruptionbudget -h
  24. 23 history
  25. 24 kubectl config view
  26. 25 cd
  27. 26 cd .kube/
  28. 27 ls
  29. 28 vim config
  30. 29 history
  31. 30 cd
  32. 31 kubectl run nakegginx --image=nginx
  33. 32 kubectl get all
  34. 33 kubectl delete pod my-dep-5b7868d854-svmmv
  35. 34 kubectl get all
  36. 35 kubectl delete pod nakegginx
  37. 36 kubectl get all
  38. 37 kubectl get pods
  39. 38 kubectl get pods my-dep-5b7868d854-tsdp9 -o yaml | less
  40. 39 kubectl describe pods my-dep-5b7868d854-tsdp9 | less
  41. 40 kubectl run -h | less
  42. 41 kubectl get pods my-dep-5b7868d854-tsdp9 -o yaml | less
  43. 42 kubectl api-resources
  44. 43 kubectl api-resources | less
  45. 44 kubectl explain pods
  46. 45 kubectl explain pods.spec
  47. 46 kubectl explain pods.spec.containers
  48. 47 history
  49. 48 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  50. 49 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  51. 50 vim mynginx.yaml
  52. 51 kubectl create -f mynginx.yaml
  53. 52 kubectl get all
  54. 53 kubectl delete -f mynginx.yaml
  55. 54 kubectl get all
  56. 55 vim mynginx.yaml
  57. 56 kubectl run sleepybox --image=busybox -- sleep 3600
  58. 57 kubectl get pods
  59. 58 kubectl get pods sleepybox -o yaml > sleepy.yaml
  60. 59 vim sleepy.yaml
  61. 60 kubectl delete pod sleepybox
  62. 61 kubectl apply -f sleepy.yaml
  63. 62 kubectl get all
  64. 63 kubectl run snoringbox --image=busybox -- sleep 3600
  65. 64 kubectl get pods snoringbox -o yaml > snore.yaml
  66. 65 kubectl delete pods snoringbox
  67. 66 kubectl create -f snore.yaml
  68. 67 kubectl get pods
  69. 68 cd ckad/
  70. 69 ./countdown 12
  71. 70 history
  72. 71 vim sidecar.yaml
  73. 72 kubectl create -f sidecar.yaml
  74. 73 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  75. 74 history
  76. 75 vim sidecar.yaml
  77. 76 vim init-example1.yaml
  78. 77 kubectl create init-example1.yaml
  79. 78 kubectl create -f init-example1.yaml
  80. 79 kubectl get pods
  81. 80 kubectl describe pod init-demo1
  82. 81 vim init-example2.yaml
  83. 82 kubectl create -f init-example2.yaml
  84. 83 kubectl get pods
  85. 84 vim init-example1.yaml
  86. 85 kubectl get ns
  87. 86 kubectl get all
  88. 87 kubectl get all -n kube-system
  89. 88 kubectl get all -n kubernetes-dashboard
  90. 89 kubectl create ns mynamespace
  91. 90 kubectl get ns
  92. 91 kubectl get all -n mynamespace
  93. 92 kubectl run mypod --image=busybox -- sleep 3600 -n mynamespace
  94. 93 kubectl get pods
  95. 94 kubectl run mypod --image=busybox -n mynamespace -- sleep 3600
  96. 95 kubectl get all -n mynamespace
  97. 96 history
  98. 97 kubectl get pods
  99. 98 kubectl describe pods mypod
  100. 99 kubectl logs mypod
  101. 100 kubectl delete pods mypod
  102. 101 kubectl get pods -A
  103. 102 kubectl create ns secret
  104. 103 kubectl run secretpod --image=nginx -n secret
  105. 104 kubectl get pods -A
  106. 105 vim busybox-ns.yaml
  107. 106 kubectl get pods -o yaml -n secret secretpod
  108. 107 kubectl get pods -o yaml -n secret secretpod | less
  109. 108 vim busybox-ns.yaml
  110. 109 kubectl create -f busybox-ns.yaml
  111. 110 kubectl get pods -n secret
  112. 111 ./countdown 12
  113. 112 kubectl get pods
  114. 113 kubectl exec -it sleepybox sh
  115. 114 kubectl explain pods.spec
  116. 115 kubectl explain pods.spec.securityContext | less
  117. 116 kubectl explain pods.spec.containers.securityContext | less
  118. 117 vim securitycontextdemo2.yaml
  119. 118 kubectl create -f securitycontextdemo2.yaml
  120. 119 kubectl exec -it security-context-demo -- sh
  121. 120 vim securitycontextdemo.yaml
  122. 121 kubectl create -f securitycontextdemo.yaml
  123. 122 kubectl get pods
  124. 123 kubectl describe pods nginxsecure
  125. 124 kubectl create job -h
  126. 125 kubectl create job onejob --image=busybox -- date
  127. 126 kubectl get all
  128. 127 kubectl get jobs onejob -o yaml | less
  129. 128 kubectl get pods onejob--1-rnm7p -o yaml | grep restart
  130. 129 kubectl get pods onejob--1-rnm7p -o yaml | grep -A 5 -B 5 restart
  131. 130 kubectl delete job onejob
  132. 131 kubectl get all
  133. 132 kubectl create mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > myjob.yaml
  134. 133 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > myjob.yaml
  135. 134 vim myjob.yaml
  136. 135 kubectl create -f myjob.yaml
  137. 136 kubectl get all
  138. 137 kubectl create cronjob -h | less
  139. 138 kubectl create cronjob runme --image=busybox --schedule="*/1 * * * *" -- echo greetings from kubernetes
  140. 139 kubectl get cronjobs,jobs,pods
  141. 140 kubectl logs runme-27364002--1-9rsmn
  142. 141 kubectl get cronjobs,jobs,pods
  143. 142 kubectl delete cronjobs.batch runme
  144. 143 kubectl get cronjobs,jobs,pods
  145. 144 vim frontend-resources.yaml
  146. 145 kubectl create -f frontend-resources.yaml
  147. 146 kubectl get all
  148. 147 kubectl describe pod frontend
  149. 148 kubectl get all
  150. 149 kubectl describe pod frontend
  151. 150 kubectl delete -f frontend-resources.yaml
  152. 151 vim frontend-resources.yaml
  153. 152 kubectl create -f frontend-resources.yaml
  154. 153 history
  155. 154 sudo poweroff
  156. 155 minikube start
  157. 156 source <(kubectl completion bash)
  158. 157 kubectl create deployment myweb --image=nginx --replicas=3
  159. 158 kubectl get all
  160. 159 kubectl get all --selector app=myweb
  161. 160 kubectl get all --selector app=myweb --show-labels
  162. 161 kubectl describe deployments.apps myweb
  163. 162 kubectl get all --selector app=myweb --show-labels
  164. 163 kubectl delete pod myweb-855c667ff6-w7mtn
  165. 164 kubectl get all --selector app=myweb --show-labels
  166. 165 kubectl run mypod --image=nginx
  167. 166 kubectl get pods
  168. 167 kubectl delete pods mypod
  169. 168 kubectl get pods
  170. 169 history
  171. 170 kubectl scale deployment myweb --replicas=5
  172. 171 kubectl get all --selector app=myweb --show-labels
  173. 172 kubectl edit deployments.apps myweb
  174. 173 cd ckad/
  175. 174 vim redis-deploy.yaml
  176. 175 kubectl create -f redis-deploy.yaml
  177. 176 vim redis-deploy.yaml
  178. 177 kubectl api-versions
  179. 178 vim redis-deploy.yaml
  180. 179 kubectl create -f redis-deploy.yaml
  181. 180 kubectl edit deploy redis
  182. 181 kubectl get all
  183. 182 kubectl delete replicasets.apps redis
  184. 183 kubectl delete replicasets.apps redis-6fb5b985bc
  185. 184 kubectl get all
  186. 185 history
  187. 186 kubectl create deployment nginxip --image=nginx:1.14
  188. 187 kubectl get all --selector app=nginxip
  189. 188 kubectl set image deploy nginxip nginx=nginx:1.17
  190. 189 kubectl get all --selector app=nginxip
  191. 190 kubectl create deployment bluelabel --image=nginx
  192. 191 kubectl get all --selector app=bluelabel
  193. 192 kubectl label deployments.apps bluelabel state=demo
  194. 193 kubectl get deployments.apps --show-labels
  195. 194 kubectl get deployments.apps --selector state=demo
  196. 195 kubectl get all --selector state=demo
  197. 196 kubectl describe deployments.apps bluelabel
  198. 197 kubectl get deploy bluelabel -o yaml | less
  199. 198 kubectl label pod bluelabel-765c597dd6-tdgn2 app-
  200. 199 kubectl get pods
  201. 200 kubectl run blacklabel --image=nginx --label=bluelabel
  202. 201 kubectl run --help | less
  203. 202 kubectl run blacklabel --image=nginx --labels=bluelabel
  204. 203 kubectl run blacklabel --image=nginx --labels bluelabel
  205. 204 kubectl run blacklabel --image=nginx --labels=redlabel
  206. 205 kubectl run --help | less
  207. 206 kubectl run blacklabel --image=nginx --labels=app=bluelabel
  208. 207 kubectl get all
  209. 208 kubectl get pods --show-labels
  210. 209 kubectl get pods --show-labels | grep run
  211. 210 kubectl get deploy
  212. 211 kubectl scale deployment webginx --replicas=0
  213. 212 kubectl get all --selector app=webginx
  214. 213 kubectl get all
  215. 214 kubectl get all --show-labels
  216. 215 kubectl get all --selector k8s-app=webginx
  217. 216 kubectl rollout history
  218. 217 kubectl rollout history deployment
  219. 218 kubectl get deployments.apps bluelabel -o yaml
  220. 219 kubectl scale deploy bluelabel --replicas=4
  221. 220 kubectl get all --selector app=bluelabel
  222. 221 kubectl set env deploy bluelabel type=blended
  223. 222 kubectl get all --selector app=s
  224. 223 kubectl set env deploy bluelabel type=singlemalt
  225. 224 kubectl get all --selector app=bluelabel
  226. 225 vim rolling.yaml
  227. 226 kubectl create -f rolling.yaml
  228. 227 kubectl rollout history deployment
  229. 228 kubectl edit deployments.apps rolling-nginx
  230. 229 kubectl rollout history deployment
  231. 230 kubectl describe deployments.apps rolling-nginx
  232. 231 kubectl rollout history deployment rolling-nginx --revision=2
  233. 232 kubectl rollout history deployment rolling-nginx --revision=1
  234. 233 kubectl rollout undo deployment rolling-nginx --to-revision=1
  235. 234 ./countdown 12
  236. 235 kubectl create deploy nginxsvc --image=nginx --replicas=3
  237. 236 kubectl get all --selector app=nginxsvc
  238. 237 kubectl get all --selector app=nginxsvc -o wide
  239. 238 curl 172.17.0.34
  240. 239 kubectl expose deployment nginxsvc --port=80
  241. 240 kubectl get all --selector app=nginxsvc -o wide
  242. 241 kubectl describe svc nginxsvc
  243. 242 kubectl get endpoints
  244. 243 kubectl get svc
  245. 244 curl 10.98.218.40
  246. 245 minikube ssh
  247. 246 kubectl edit svc nginxsvc
  248. 247 kubectl get svc
  249. 248 minikube ip
  250. 249 curl 192.168.49.2:32000
  251. 250 history
  252. 251 kubectl describe svc nginxsvc
  253. 252 kubectl edit svc nginxsvc
  254. 253 kubectl describe svc nginxsvc
  255. 254 kubectl edit svc nginxsvc
  256. 255 kubectl get all -n kube-system
  257. 256 kubectl run testpod --image=busybox
  258. 257 kubectl get pods testpod
  259. 258 kubectl describe pods testpod
  260. 259 kubectl get pods testpod
  261. 260 kubectl delete pod testpod
  262. 261 kubectl run testpod --image=busybox -- sleep 3600
  263. 262 kubectl get svc
  264. 263 kubectl get svc,pods -n kube-system
  265. 264 kubectl get endpoints -n kube-system
  266. 265 kubectl get svc,pods -n kube-system -o wide
  267. 266 kubectl exec -ti testpod -- cat /etc/resolv.conf
  268. 267 kubectl get svc,pods -n kube-system -o wide
  269. 268 kubectl exec -it testpod -- nslookup nginxsvc
  270. 269 history
  271. 270 ./countdown 5
  272. 271 kubectl expose --help
  273. 272 kubectl expose --help | less
  274. 273 kubectl create service --help | less
  275. 274 kubectl create service nodeport --help
  276. 275 ./countdown 12
  277. 276 minikube addons list
  278. 277 minikube addons enable ingress
  279. 278 kubectl get ns
  280. 279 kubectl get all -n ingress-nginx
  281. 280 kubectl get deploy
  282. 281 kubectl get svc nginxsvc
  283. 282 curl http://$(minikube ip):32000
  284. 283 kubectl create ingress --help | less
  285. 284 kubectl create ingress nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080:
  286. 285 kubectl create ingress nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080"
  287. 286 minikube ip
  288. 287 sudo vim /etc/hosts
  289. 288 kubectl get ingress
  290. 289 curl nginxsvc.info
  291. 290 kubectl describe ingress nginxsvc-ingress
  292. 291 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  293. 292 kubectl expose deployment newdep --port=8080
  294. 293 curl nginxsvc.info/hello
  295. 294 kubectl describe ingress nginxsvc-ingress
  296. 295 history
  297. 296 kubectl explain pod.spec.volumes | less
  298. 297 vim morevolumes.yaml
  299. 298 kubectl create -f morevolumes.yaml
  300. 299 kubectl get pods morevol
  301. 300 kubectl get pods morevol2
  302. 301 kubectl describe pods morevol2 | less
  303. 302 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test1
  304. 303 kubectl exec -it morevol2 -c centos2 -- ls -l /centos2
  305. 304 ./countdown 13
  306. 305 kubectl describe pod morevol2
  307. 306 vim morevolumes.yaml
  308. 307 vim pv.yaml
  309. 308 kubectl create -f pv.yaml
  310. 309 kubectl get pv
  311. 310 vim pvc.yaml
  312. 311 kubectl create -f pvc.yaml
  313. 312 kubectl get pv,pvc
  314. 313 kubectl get storageclass
  315. 314 kubectl describe pv pvc-8328b15a-3404-4339-8b91-42838713ad16
  316. 315 vim pv-pvc-pod.yaml
  317. 316 vim pv-pod.yaml
  318. 317 kubectl create -f pv-pod.yaml
  319. 318 kubectl describe pod pv-pod
  320. 319 kubectl exec -it pv-pod -- echo hello > /usr/share/nginx/html/myfile
  321. 320 kubectl exec -it pv-pod -- 'echo hello > /usr/share/nginx/html/myfile'
  322. 321 kubectl exec -it pv-pod -- touch /usr/share/nginx/html
  323. 322 kubectl exec -it pv-pod -- touch /usr/share/nginx/html/mynewfile
  324. 323 kubectl get pvc
  325. 324 kubectl describe pv pvc-8328b15a-3404-4339-8b91-42838713ad16
  326. 325 minikube ssh
  327. 326 history
  328. 327 kubectl get pv
  329. 328 kubectl explain pv.spec.fc
  330. 329 kubectl explain pv.spec.iscsi
  331. 330 kubectl explain pv.spec.glusterfs
  332. 331 kubectl describe pod pv-pod
  333. 332 history
  334. 333 sudo poweroff
  335. 334 minikube start
  336. 335 kubectl get pods -n kube-system
  337. 336 minikube stop
  338. 337 minikube delete
  339. 338 minikube start --cni=calico
  340. 339 kubectl get all
  341. 340 kubectl get pods -n kube-system
  342. 341 cd ckad/
  343. 342 ls
  344. 343 vim nwpolicy-complete-example.yaml
  345. 344 kubectl apply -f nwpolicy-complete-example.yaml
  346. 345 kubectl get networkpolicy,pods
  347. 346 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  348. 347 kubectl exec -it busybox -- bash
  349. 348 kubectl exec -it busybox -- sh
  350. 349 kubectl expose --help | less
  351. 350 kubectl expose pod nginx --port=80
  352. 351 kubectl get svc nginx
  353. 352 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  354. 353 kubectl get pods --show-labels
  355. 354 kubectl describe networkpolicy
  356. 355 kubectl label pod busybox access=true
  357. 356 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  358. 357 history
  359. 358 kubectl create deploy mydb --image=mariadb
  360. 359 kubectl get all
  361. 360 source <(kubectl completion bash)
  362. 361 kubectl describe pods mydb-6875fcdfbd-v9p6q
  363. 362 kubectl logs mydb-6875fcdfbd-v9p6q
  364. 363 kubectl set env deploy mydb MYSQL_ROOT_PASSWORD=password; kubectl get all
  365. 364 kubectl get all
  366. 365 kubectl get deployments.apps mydb -o yaml > mydb.yaml
  367. 366 vim mydb.yaml
  368. 367 kubectl delete deploy mydb
  369. 368 vim varsfile
  370. 369 kubectl create cm mydbvars --from-env-file=varsfile
  371. 370 rm varsfile
  372. 371 kubectl describe cm mydbvars
  373. 372 kubectl create cm morevars --from-literal=MYSQL_DB=book
  374. 373 kubectl describe cm morevars
  375. 374 kubectl create deployment mydb --image=mariadb --replicas=3
  376. 375 kubectl get all
  377. 376 kubectl set env deploy mydb --from=configmap/mydbvars
  378. 377 kubectl get all
  379. 378 kubectl get deploy mydb -o yaml > mynewdb.yaml
  380. 379 vim mynewdb.yaml
  381. 380 history
  382. 381 echo "hello world" > index.html
  383. 382 kubectl create cm myindex --from-file=index.html
  384. 383 kubectl describe cm myindex
  385. 384 kubectl create deploy myweb --image=nginx --dry-run=client -o yaml > myweb.yaml
  386. 385 vim myweb.yaml
  387. 386 kubectl create -f myweb.yaml
  388. 387 kubectl exec -it myweb -- cat /usr/share/nginx/html/index.html
  389. 388 kubectl get pods
  390. 389 kubectl exec -it myweb-54bd6bcb94-b7btg -- cat /usr/share/nginx/html/index.html
  391. 390 ls -lrt
  392. 391 vim mynewdb.yaml
  393. 392 kubectl get pods
  394. 393 history
  395. 394 kubectl create cm mycm --from-literal=MYSQL_ROOT_PASSWORD=password
  396. 395 kubectl create deploy mysqlserver --image=mysql
  397. 396 kubectl set env --from=configmap/mycm deploy/mysqlserver
  398. 397 kubectl get all
  399. 398 kubectl create secret -h | less
  400. 399 kubectl create secret generic -h | less
  401. 400 kubectl create secret generic dbpw --from-literal=ROOT_PASSWORD=password
  402. 401 kubectl describe secrets dbpw
  403. 402 kubectl get secret dbpw -o yaml
  404. 403 echo cGFzc3dvcmQ= | base64 -d
  405. 404 kubectl get deploy
  406. 405 kubectl delete deploy mydb,mysqlserver
  407. 406 kubectl delete deploy mydb
  408. 407 kubectl delete deploy mysqlserver
  409. 408 kubectl create deploy mynewdb --image=mariadb
  410. 409 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MYSQL_
  411. 410 kubectl api-resources | less
  412. 411 kubectl get pods -n kube-system
  413. 412 kubectl config view
  414. 413 kubectl --v=10 get pods
  415. 414 kubectl proxy --port=8001 &
  416. 415 curl http://localhost:8001
  417. 416 kubectl get deploy
  418. 417 curl http://localhost:8001/version
  419. 418 curl http://localhost:8001/api/v1/namespaces/default/pods
  420. 419 kubectl get pods
  421. 420 curl http://localhost:8001/api/v1/namespaces/default/pods/nginx
  422. 421 curl http://localhost:8001/api/v1/namespaces/default/pods/nginx/
  423. 422 kubectl get pods
  424. 423 curl -XDELETE http://localhost:8001/api/v1/namespaces/default/pods/nginx
  425. 424 kubectl get pods
  426. 425 cat ~/.kube/config
  427. 426 kubectl auth can-i get pods
  428. 427 kubectl auth can-i get pods --as [email protected]
  429. 428 kubectl get pods
  430. 429 kubectl get pods busybox -o yaml
  431. 430 kubectl get serviceaccount
  432. 431 kubectl get serviceaccount -A
  433. 432 vim mypod.yaml
  434. 433 kubectl create -f mypod.yaml
  435. 434 kubectl get pods mypod -o yaml | less
  436. 435 kubectl exec -it mypod -- sh
  437. 436 vim mysa.yaml
  438. 437 kubectl create -f mysa.yaml
  439. 438 vim list-pods.yaml
  440. 439 kubectl apply -f list-pods.yaml
  441. 440 vim list-pods-mysa-binding.yaml
  442. 441 kubectl create -f list-pods-mysa-binding.yaml
  443. 442 vim mysapod.yaml
  444. 443 kubectl create -f mysapod.yaml
  445. 444 kubectl exec -it mysapod -- sh
  446. 445 kubectl create role --help
  447. 446 kubectl create rolebinding --help
  448. 447 ./countdown 12
  449. 448 cd
  450. 449 git clone https://github.com/helm/helm/releases
  451. 450 wget https://get.helm.sh/helm-v3.7.2-linux-arm64.tar.gz
  452. 451 ls
  453. 452 tar xvf helm-v3.7.2-linux-arm64.tar.gz
  454. 453 wget https://get.helm.sh/helm-v3.7.2-linux-amd64.tar.gz
  455. 454 tar xvf helm-v3.7.2-linux-amd64.tar.gz
  456. 455 cd linux-amd64/
  457. 456 ls
  458. 457 sudo mv helm /usr/local/bin
  459. 458 helm version
  460. 459 helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
  461. 460 helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard
  462. 461 helm repo add bitnami https://charts.bitnami.com/bitnami
  463. 462 helm repo list
  464. 463 helm search repo bitnami
  465. 464 helm repo update
  466. 465 helm install bitnami/mysql --generate-name
  467. 466 kubectl get all
  468. 467 helm show chart bitnami/mysql
  469. 468 helm show all bitnami/mysql
  470. 469 helm list
  471. 470 helm status mysql-1642009227
  472. 471 history
  473. 472 helm show values bitnami/nginx
  474. 473 helm pull bitnami/nginx
  475. 474 tar xvf nginx-9.7.1.tgz
  476. 475 vim nginx/values.yaml
  477. 476 helm template --debug nginx
  478. 477 helm install -f nginx/values.yaml mynginx nginx/
  479. 478 helm list
  480. 479 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  481. 480 kubectl expose blue-nginx --port=80 --name=ngnginx
  482. 481 kubectl expose deploy blue-nginx --port=80 --name=ngnginx
  483. 482 kubectl get deploy,pods,svc --show-labels
  484. 483 kubectl get deploy,pods,svc --show-labels --selector app=blue-nginx
  485. 484 kubectl describe svc ngnginx
  486. 485 kubectl get deploy blue-nginx -o yaml > green-nginx.yaml
  487. 486 vim green-nginx.yaml
  488. 487 kubectl create -f green-nginx.yaml
  489. 488 kubectl get deploy,pods,svc --show-labels --selector app=blue-nginx
  490. 489 kubectl get deploy,pods,svc --show-labels --selector app=green-nginx
  491. 490 kubectl delete svc ngnginx; kubectl expose deploy green-nginx --port=80 --name=ngnginx
  492. 491 kubectl get pods -o wide
  493. 492 kubectl describe svc ngnginx
  494. 493 kubectl get all --selector app=blue-nginx
  495. 494 kubectl scale deploy blue-nginx --replicas=0
  496. 495 kubectl get all --selector app=blue-nginx
  497. 496 history
  498. 497 cd ../ckad/
  499. 498 ./countdown 12
  500. 499 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > oldnginx.yaml
  501. 500 vim oldnginx.yaml
  502. 501 kubectl create -f oldnginx.yaml
  503. 502 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  504. 503 kubectl get svc
  505. 504 kubectl get endpoints
  506. 505 minikube ssh
  507. 506 kubectl cp old-nginx-5b4869b6fd-2v95q:/usr/share/nginx/html/index.html index.html
  508. 507 vim index.html
  509. 508 kubectl create cm canary --from-file=index.html
  510. 509 kubectl describe cm canary
  511. 510 vim canary.yaml
  512. 511 kubectl create -f canary.yaml
  513. 512 kubectl get svc
  514. 513 kubectl get endpoints
  515. 514 minikube ssh
  516. 515 kubectl get deploy
  517. 516 kubectl scale new-nginx --replicas=3
  518. 517 kubectl scale deploy new-nginx --replicas=3
  519. 518 kubectl get deploy
  520. 519 kubectl scale deployment old-nginx --replicas=0
  521. 520 history
  522. 521 vim crd-object.yaml
  523. 522 kubectl create -f crd-object.yaml
  524. 523 kubectl api-resources | grep backup
  525. 524 vim crd-backup.yaml
  526. 525 kubectl create -f crd-backup.yaml
  527. 526 kubectl get backups
  528. 527 vim busybox-ready.yaml
  529. 528 kubectl create -f busybox-ready.yaml
  530. 529 kubectl get pods
  531. 530 kubectl describe pods busybox-ready
  532. 531 kubectl edit pods busybox-read
  533. 532 kubectl edit pods busybox-ready
  534. 533 kubectl exec -it busybox-ready -- sh
  535. 534 kubectl get pods
  536. 535 vim nginx-probes.yaml
  537. 536 kubectl create -f nginx-probes.yaml
  538. 537 kubectl get pods
  539. 538 history
Add Comment
Please, Sign In to add comment