sandervanvugt

CKAD march23 all days

Mar 9th, 2023
422
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.83 KB | None | 0 0
  1. student@student-virtual-machine:~/ckad$ history
  2. 1 history
  3. 2 minikube start --vm-driver=docker --cni=calico
  4. 3 kubectl get all
  5. 4 history
  6. 5 minikube status
  7. 6 minikube ssh
  8. 7 kubectl get all
  9. 8 minikube --help | less
  10. 9 minikube dashboard
  11. 10 kubectl get all
  12. 11 kubectl create deploy firstnginx --image=nginx --replicas=3
  13. 12 kubectl get all
  14. 13 history
  15. 14 kubectl -h | less
  16. 15 kubectl completion -h | less
  17. 16 source <(kubectl completion bash)
  18. 17 vim ~/.kube/config
  19. 18 kubectl get pods
  20. 19 kubectl get ns
  21. 20 kubectl config view
  22. 21 kubectl config set-context minikube --namespace=kube-system
  23. 22 kubectl get pods
  24. 23 kubectl config set-context --current --namespace=default
  25. 24 ls *file
  26. 25 cd dockerfile/
  27. 26 vim Dockerfile
  28. 27 docker build -t centmap .
  29. 28 docker images
  30. 29 docker save --help
  31. 30 docker save centmap
  32. 31 docker save centmap -o centmap.tar
  33. 32 ls -l centmap.tar
  34. 33 history
  35. 34 kubectl get pods
  36. 35 kubectl delete pod dontuseme-5dc7b7f996-dph5m
  37. 36 kubectl get pods
  38. 37 kubectl run -h | less
  39. 38 kubectl run nginxxxx --image=nginx
  40. 39 kubectl get pods
  41. 40 history
  42. 41 kubectl get pods
  43. 42 kubectl delete pod nginxxxx
  44. 43 kubectl get pods
  45. 44 kubectl explain pods
  46. 45 kubectl explain pods.spec | less
  47. 46 history
  48. 47 kubectl get pods
  49. 48 kubectl get pods firstnginx-5444786b89-m48zg -o yaml | less
  50. 49 kubectl describe pod firstnginx-5444786b89-wh24c | less
  51. 50 vim ex1.txt
  52. 51 history
  53. 52 kubectl describe pod firstnginx-5444786b89-wh24c | less
  54. 53 kubectl get pods -o wide
  55. 54 cd
  56. 55 kubectl run nginxxxx --image=nginx --dry-run=client -o yaml
  57. 56 kubectl run nginxxxx --image=nginx --dry-run=client -o yaml > nginxxxx.yaml
  58. 57 vim nginxxxx.yaml
  59. 58 kubectl apply -f nginxxxx.yaml
  60. 59 vim nginxxxx.yaml
  61. 60 kubectl apply -f nginxxxx.yaml
  62. 61 vim nginxxxx.yaml
  63. 62 kubectl apply -f nginxxxx.yaml
  64. 63 history
  65. 64 vim nginxxxx.yaml
  66. 65 kubectl delete -f nginxxxx.yaml
  67. 66 kubectl apply -f nginxxxx.yaml
  68. 67 vim nginxxxx.yaml
  69. 68 kubectl apply -f nginxxxx.yaml
  70. 69 cd ckad/
  71. 70 vim sidecar.yaml
  72. 71 kubectl apply -f sidecar.yaml
  73. 72 kubectl get pods
  74. 73 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  75. 74 kubectl apply -f sidecar.yaml
  76. 75 vim sidecar.yaml
  77. 76 vim morevolumes.yaml
  78. 77 vim init-example1.yaml
  79. 78 kubectl create -f init-example1.yaml
  80. 79 kubectl get pods
  81. 80 vim init-example2.yaml
  82. 81 kubectl apply -f init-example2.yaml
  83. 82 kubectl get pods
  84. 83 kubectl get ns
  85. 84 kubectl get pods -n kube-system
  86. 85 kubectl get pods -n kubernetes-dashboard
  87. 86 kubectl describe ns default
  88. 87 kubectl get pods
  89. 88 kubectl get pods -A
  90. 89 kubectl create ns secret
  91. 90 kubectl config set-context --current --namespace=secret
  92. 91 kubectl get pods
  93. 92 kubectl run busybox --image=busybox -n secret
  94. 93 kubectl get pods
  95. 94 vim busybox-ns.yaml
  96. 95 kubectl create -f busybox-ns.yaml
  97. 96 kubectl get pods
  98. 97 kubectl describe pod busybox
  99. 98 kubectl delete pod busybox
  100. 99 kubectl run busybox --image=busybox -n secret -- sleep 3600
  101. 100 kubectl get pods
  102. 101 kubectl config set-context --current --namespace=default
  103. 102 kubectl run nginx-lab --image=nginx
  104. 103 kubectl get pods
  105. 104 k get pods
  106. 105 ./countdown 12
  107. 106 kubectl run faildb --image=mariadb
  108. 107 kubectl get pods
  109. 108 kubectl describe pod init-demo2
  110. 109 kubectl describe pod faildb
  111. 110 kubectl logs faildb
  112. 111 kubectl delete pod faildb
  113. 112 kubectl run -h | less
  114. 113 kubectl run mydb --image=mariadb --env=MARIADB_ROOT_PASSWORD=password
  115. 114 kubectl get pods
  116. 115 kubectl exec mydb -- set
  117. 116 kubectl exec mydb -- env
  118. 117 kubectl run busybox
  119. 118 kubectl run busybox --image=busbox
  120. 119 kubectl get pods
  121. 120 kubectl describe pod busybox
  122. 121 kubectl get pods
  123. 122 kubectl delete pod busybox
  124. 123 kubectl run busybox --image=busybox
  125. 124 kubectl get pods
  126. 125 kubectl describe pod busybox
  127. 126 minikube ssh
  128. 127 kubectl get pods
  129. 128 kubectl delete pod busybox
  130. 129 history
  131. 130 kubectl explain pod.spec | less
  132. 131 kubectl explain pod.spec.securityContext | less
  133. 132 vim securitycontextdemo2.yaml
  134. 133 kubectl apply -f securitycontextdemo2.yaml
  135. 134 kubectl exec -it security-context-demo -- sh
  136. 135 vim securitycontextdemo.yaml
  137. 136 kubectl create -f securitycontextdemo.yaml
  138. 137 kubectl get pods
  139. 138 kubectl describe pod nginxsecure
  140. 139 kubectl delete -f securitycontextdemo.yaml
  141. 140 kubectl create job -h | less
  142. 141 kubectl create job onejob --image=busybox -- date
  143. 142 kubectl get pods,jobs
  144. 143 kubectl get jobs onejob -o yaml | less
  145. 144 kubectl get pods,jobs
  146. 145 kubectl delete job onejob
  147. 146 kubectl get pods,jobs
  148. 147 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > mynewjob.yaml
  149. 148 vim mynewjob.yaml
  150. 149 kubectl create -f mynewjob.yaml
  151. 150 vim mynewjob.yaml
  152. 151 kubectl create -f mynewjob.yaml
  153. 152 kubectl get pods,jobs
  154. 153 history
  155. 154 kubectl create cronjob
  156. 155 kubectl create cronjob -h | less
  157. 156 kubectl create cronjob runme --image=busybox --schedule="* * * * *" -- echo greetings from the cluster
  158. 157 kubectl get cronjobs,jobs,pods
  159. 158 kubectl logs runme-27971466-wnnj8
  160. 159 kubectl get cronjobs,jobs,pods
  161. 160 kubectl create job --from=cronjob runme
  162. 161 kubectl create job myjob --from=cronjob runme
  163. 162 kubectl create job -h
  164. 163 kubectl create job myjob --from=cronjob/runme
  165. 164 kubectl get cronjobs,jobs,pods
  166. 165 kubectl create cronjob -h | less
  167. 166 create create quota -h | less
  168. 167 kubectl create quota -h | less
  169. 168 kubectl create deploy myapp --image=nginx
  170. 169 kubectl set resources -h | less
  171. 170 kubectl set resources deploy myapp --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
  172. 171 kubectl get deploy myapp -o yaml
  173. 172 vim frontend-resources.yaml
  174. 173 kubectl apply -f frontend-resources.yaml
  175. 174 kubectl get pods
  176. 175 kubectl describe pod frontend
  177. 176 sudo reboot
  178. 177 cd ckad/
  179. 178 ./countdown 2
  180. 179 ./countdown 12
  181. 180 cat dockerfile/ex1.txt
  182. 181 ./countdown 15
  183. 182 sudo apt install vim git -y
  184. 183 free -m
  185. 184 lscpu | less
  186. 185 df -h
  187. 186 git clone https://github.com/sandervanvugt/ckad
  188. 187 cd ckad
  189. 188 ls
  190. 189 ./minikube-docker-setup.sh
  191. 190 cd ckad/
  192. 191 ./countdown 3
  193. 192 kubectl explain pod.spec | less
  194. 193 cd dockerfile/
  195. 194 vim ex2.txt
  196. 195 kubectl explain pod.spec | less
  197. 196 minikube start
  198. 197 df -h
  199. 198 sudo lsblk
  200. 199 sudo poweroff
  201. 200 df -h
  202. 201 sudo gdisk /dev/sda
  203. 202 sudo reboot
  204. 203 cd ckad
  205. 204 ./countdown 12
  206. 205 source <(kubectl completion bash)
  207. 206 df -h
  208. 207 mount | grep sda3
  209. 208 sudo resize2fs /dev/sda3
  210. 209 df -h
  211. 210 history
  212. 211 minikube start
  213. 212 kubectl get pods
  214. 213 minikube ssh
  215. 214 kubectl get pods
  216. 215 kubectl describe pods frontend
  217. 216 kubectl get pods
  218. 217 kubectl describe pod frontend | less
  219. 218 cd ckad
  220. 219 kubectl delete -f frontend.yaml
  221. 220 kubectl delete -f frontend-resources.yaml
  222. 221 vim frontend-resources.yaml
  223. 222 kubectl apply -f frontend-resources.yaml
  224. 223 kubectl get pods
  225. 224 source <(kubectl completion bash)
  226. 225 kubectl describe pod frontend
  227. 226 vim frontend-resources.yaml
  228. 227 kubectl delete pod frontend
  229. 228 kubectl apply -f frontend-resources.yaml
  230. 229 kubectl get pods
  231. 230 kubectl delete pods frontend
  232. 231 history
  233. 232 minikube ssh
  234. 233 vim zs.yaml
  235. 234 kubectl apply -f zs.yaml
  236. 235 kubectl get pods
  237. 236 kubectl describe pod my-webserver-pod
  238. 237 minikube ssh
  239. 238 kubectl get pods
  240. 239 minikube ssh
  241. 240 kubectl run sanderdb --image=mariadb
  242. 241 minikube ssh
  243. 242 kubectl get pods
  244. 243 minikube ssh
  245. 244 kubectl delete pod sanderdb
  246. 245 sudo -i
  247. 246 minikube ssh
  248. 247 ./countdown 7
  249. 248 kubectl get pods
  250. 249 kubectl run sanderpod --image=mariadb
  251. 250 kubectl logs sanderpod
  252. 251 minikube ssh
  253. 252 kubectl delete pod sanderpod
  254. 253 minikube ssh
  255. 254 vim busybox-ready.yaml
  256. 255 kubectl create -f busybox-ready.yaml
  257. 256 kubectl get pods
  258. 257 kubectl describe pod busybox-ready
  259. 258 kubectl edit pod busybox-ready
  260. 259 kubectl exec -it busybox-ready -- sh
  261. 260 kubectl get pods
  262. 261 kubectl get deploy,jobs,pods
  263. 262 for i in $(kubectl get deploy,jobs,pods); do kubectl delete $i; done
  264. 263 for i in $(kubectl get deploy,jobs,pods | awk '{ print $1 }'); do kubectl delete $i; done
  265. 264 kubectl get pods
  266. 265 vim nginx-probes.yaml
  267. 266 kubectl create -f nginx-probes.yaml
  268. 267 kubectl get pods
  269. 268 kubectl create deploy myweb --image=nginx --replicas=3
  270. 269 kubectl describe deployments.apps myweb | less
  271. 270 kubectl get all
  272. 271 kubectl delete cronjob runme
  273. 272 kubectl get all
  274. 273 kubectl get all --selector app=myweb
  275. 274 kubectl delete pod myweb-5b7f574f7f-vs788
  276. 275 kubectl get all --selector app=myweb
  277. 276 vim redis-deploy.yaml
  278. 277 kubectl apply -f redis-deploy.yaml
  279. 278 vim redis-deploy.yaml
  280. 279 kubectl api-versions | less
  281. 280 kubectl api-resources
  282. 281 kubectl api-resources | less
  283. 282 kubectl api-versions
  284. 283 vim redis-deploy.yaml
  285. 284 kubectl apply -f redis-deploy.yaml
  286. 285 kubectl edit deployments.apps redis
  287. 286 kubectl get all
  288. 287 kubectl edit replicasets.apps redis-6dc855767d
  289. 288 kubectl get all
  290. 289 kubectl delete rs redis-6dc855767d
  291. 290 kubectl get all
  292. 291 kubectl scale deployment redis --replicas=0
  293. 292 kubectl get all
  294. 293 kubectl create deploy nginx-lab7 --replicas=3 --image=nginx
  295. 294 kubectl get all
  296. 295 kubectl api-resources | less
  297. 296 kubectl create deploy nginxup --image=nginx:1.14
  298. 297 kubectl scale deployment nginxup --replicas=4
  299. 298 kubectl get all --selector app=nginxup
  300. 299 kubectl set image deploy nginxup nginx=nginx:1.17
  301. 300 kubectl get all --selector app=nginxup
  302. 301 kubectl get deployments.apps nginxup -o yaml | less
  303. 302 kubectl create deploy example -h | less
  304. 303 kubectl create deploy example --image=nginx -o yaml --dry-run=client > example.yaml
  305. 304 vim example.yaml
  306. 305 kubectl apply -f example.yaml
  307. 306 kubectl get all --selector app=example
  308. 307 kubectl set image deploy example bob=nginx:1.17
  309. 308 kubectl get all --selector app=example
  310. 309 history
  311. 310 kubectl get all
  312. 311 kubectl get deployments.apps redis -o yaml | less
  313. 312 kubectl create deploy bluelabel --image=nginx
  314. 313 kubectl label deploy bluelabel state=demo
  315. 314 kubectl get deploy --show-labels
  316. 315 kubectl get all --selector state=demo
  317. 316 kubectl get all --selector app=bluelabel
  318. 317 kubectl describe deploy bluelabel | less
  319. 318 kubectl get all | grep b lue
  320. 319 kubectl get all | grep blue
  321. 320 kubectl get all
  322. 321 kubectl delete deploy example nginxup nginx-lab7 redis myweb
  323. 322 kubectl get all
  324. 323 kubectl scale deployment bluelabel --replicas 3
  325. 324 kubectl get all
  326. 325 kubectl label pod bluelabel-5cdb7645b5-pjvf8 app-
  327. 326 kubectl get all
  328. 327 kubectl get pods --show-labels
  329. 328 kubectl run testpod --image=busybox -- sleep infinity
  330. 329 kubectl get pods --show-labels
  331. 330 kubectl get pods --show-labels | grep run
  332. 331 kubectl get deploy bluelabel -o yaml
  333. 332 kubectl get all
  334. 333 kubectl scale deployment bluelabel --replicas 4
  335. 334 kubectl get all
  336. 335 kubectl set env deploy bluelabel type=blended
  337. 336 kubectl get all
  338. 337 kubectl delete pod bluelabel-5cdb7645b5-pjvf8
  339. 338 kubectl get all
  340. 339 kubectl get deployments.apps bluelabel -o yaml | less
  341. 340 vim rolling.yaml
  342. 341 kubectl apply -f rolling.yaml
  343. 342 kubectl rollout history deployment
  344. 343 kubectl edit deployments.apps rolling-nginx
  345. 344 kubectl rollout history deployment
  346. 345 kubectl rollout history deployment rolling-nginx --revision=2
  347. 346 kubectl rollout history deployment rolling-nginx --revision=1
  348. 347 kubectl rollout undo deployment rolling-nginx --to-revision=1
  349. 348 kubectl rollout history deployment
  350. 349 kubectl get all
  351. 350 ./countdown 12
  352. 351 kubectl create deployment nginxsvc --image=nginx --replicas=3
  353. 352 kubectl get all --selector app=nginxsvc
  354. 353 kubectl get all --selector app=nginxsvc -o wide
  355. 354 kubectl expose deployment nginxsvc --port=80
  356. 355 kubectl get all --selector app=nginxsvc -o wide
  357. 356 kubectl describe svc nginxsvc
  358. 357 kubectl get endpoints
  359. 358 kubectl get svc
  360. 359 curl 10.106.84.96
  361. 360 minikube ssh
  362. 361 kubectl edit svc nginxsvc
  363. 362 kubectl get svc
  364. 363 minikube ip
  365. 364 curl 192.168.49.2:30089
  366. 365 kubectl describe svc nginxsvc
  367. 366 kubectl edit svc nginxsvc
  368. 367 kubectl get svc
  369. 368 kubectl get endpoints
  370. 369 kubectl edit svc nginxsvc
  371. 370 kubectl get endpoints
  372. 371 kubectl get all
  373. 372 kubectl run testpod --image=busybox -- sleep infinity
  374. 373 kubectl get testpod
  375. 374 kubectl get pods
  376. 375 kubectl get svc
  377. 376 kubectl exec -it testpod -- cat /etc/resolv.conf
  378. 377 kubectl exec -it testpod -- nslookup nginxsvc
  379. 378 kubectl get ns
  380. 379 kubectl get pods -n secret
  381. 380 kubectl run secretweb --image=nginx -n secret
  382. 381 kubectl expose -n secret pod secretweb
  383. 382 kubectl expose -n secret pod secretweb --port=80
  384. 383 kubectl exec -it testpod -- nslookup secretweb
  385. 384 kubectl exec -it testpod -- nslookup secretweb.secret.svc.cluster.local
  386. 385 kubectl exec -it testpod -- cat /etc/resolv.conf
  387. 386 vim nwpolicy-complete-example.yaml
  388. 387 kubectl apply -f nwpolicy-complete-example.yaml
  389. 388 kubectl expose pod nginx --port=80
  390. 389 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  391. 390 kubectl label pod busybox access=true
  392. 391 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  393. 392 vim nwpolicy-complete-example.yaml
  394. 393 kubectl describe networkpolicy access-nginx
  395. 394 kubectl get pods --show-label
  396. 395 kubectl get pods --show-labels
  397. 396 kubectl create -h | less
  398. 397 kubectl autoscale -h | less
  399. 398 minikube addons lists
  400. 399 minikube addons list
  401. 400 minikube addons enable metrics-server
  402. 401 kubectl top pods
  403. 402 history
  404. 403 sudo poweroff
  405. 404 cd ckad
  406. 405 ./countdown 1
  407. 406 ./countdown 5
  408. 407 ./countdown 1
  409. 408 cd ../Downloads/
  410. 409 ls
  411. 410 tar xvf helm-v3.11.2-linux-amd64.tar.gz
  412. 411 sudo mv linux-amd64/helm /usr/local/bin/
  413. 412 helm version
  414. 413 exit
  415. 414 minikube start
  416. 415 kubectl get all
  417. 416 kubectl top pods
  418. 417 minikube addons list
  419. 418 minikube addons enable ingress
  420. 419 kubectl get ns
  421. 420 source <(kubectl completion bash)
  422. 421 kubectl get all -n ingress-nginx
  423. 422 kubectl get svc
  424. 423 curl 192.168.49.2:30089
  425. 424 kubectl create ingress -h | less
  426. 425 kubectl create ingress nginxsvc-ingress --rule="/=nginsvc:80" --rule=/hello=newdep:8080"
  427. 426 kubectl create ingress nginxsvc-ingress --rule="/=nginsvc:80" --rule="/hello=newdep:8080"
  428. 427 sudo vim /etc/hosts
  429. 428 kubectl get ingress
  430. 429 curl nginxsvc.indo
  431. 430 cat /etc/hosts
  432. 431 curl nginxsvc.info
  433. 432 kubectl describe ingress nginxsvc-ingress
  434. 433 kubectl edit ing nginxsvc-ingress
  435. 434 kubectl describe ingress nginxsvc-ingress
  436. 435 curl nginxsvc.info
  437. 436 curl nginxsvc.info/hello
  438. 437 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  439. 438 kubectl expose deploy newdep --port=8080
  440. 439 curl nginxsvc.info/hello
  441. 440 kubectl explain pod.spec.volumes | less
  442. 441 cd ckad
  443. 442 cat morevolumes.yaml
  444. 443 kubectl apply -f morevolumes.yaml
  445. 444 kubectl get pods
  446. 445 kubectl describe pods morevol2 | less
  447. 446 kubectl -it morevol2 -c centos1 -- touch /centos1/test
  448. 447 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  449. 448 kubectl exec -it morevol2 -c centos2 -- ls /centos2/
  450. 449 vim pv.yaml
  451. 450 kubectl apply -f pv.yaml
  452. 451 kubectl describe pv pv-volume
  453. 452 vim pvc.yaml
  454. 453 kubectl apply -f pvc.yaml
  455. 454 kubectl get pvc,pv
  456. 455 kubectl get storageclass
  457. 456 kubectl describe pvc pv-claim
  458. 457 kubectl describe pv pvc-43d5aaf1-0a7c-419a-8624-ae8edabcd20c
  459. 458 vim pvc-pod.yaml
  460. 459 kubectl apply -f pvc-pod.yaml
  461. 460 kubectl get pvc,pv
  462. 461 kubectl describe pv pvc-3961ac15-1dd6-4393-9fe3-979a8faeac97
  463. 462 kubectl exec nginx-pvc-pod -- touch /usr/share/nginx/html/testfile
  464. 463 minikube ssh
  465. 464 kubectl get pvc
  466. 465 kubect delete pvc pv-claim
  467. 466 kubectl delete pvc pv-claim
  468. 467 kubectl explain pvc.spec | less
  469. 468 vim pvc.yaml
  470. 469 kubectl delete -f pv.yaml
  471. 470 vim pv.yaml
  472. 471 kubectl apply -f pv.yaml
  473. 472 kubectl apply -f pvc.yaml
  474. 473 kubectl get pvc,pv
  475. 474 history
  476. 475 kubectl get deploy
  477. 476 kubectl create deploy mydb --image=mariadb
  478. 477 kubectl describe pods mydb-7978c6b495-fc8k9
  479. 478 kubectl log mydb-7978c6b495-fc8k9
  480. 479 kubectl logs mydb-7978c6b495-fc8k9
  481. 480 kubectl set env deploy mydb MARIADB_ROOT_PASSWORD=password
  482. 481 kubectl get all --selector app=mydb
  483. 482 kubectl get deployments.apps mydb -o yaml > mydb.yaml
  484. 483 vim mydb.yaml
  485. 484 ./countdown 12
  486. 485 vim varsfile
  487. 486 kubectl create cm mydbvars --from-env-file=varsfile
  488. 487 rm -f varsfile
  489. 488 kubectl describe cm mydbvars
  490. 489 kubectl delete deploy mydb
  491. 490 kubectl create deploy mydb --image=mariadb --replicas=3
  492. 491 kubectl get all --selector app=mydb
  493. 492 kubectl set env deploy mydb --from=configmap/mydbvars
  494. 493 kubectl get all --selector app=mydb
  495. 494 kubectl get deploy mydb -o yaml
  496. 495 kubectl set env -h | less
  497. 496 echo hello world > index.html
  498. 497 kubectl create cm myindex --from-file=index.html
  499. 498 kubectl describe cm myindex
  500. 499 kubectl create cm mypasswd --from-file=/etc/passwd
  501. 500 kubectl describe cm mypasswd
  502. 501 kubectl create deployment myweb --image=nginx --dry-run=client -o yaml >myweb.yaml
  503. 502 vim myweb.yaml
  504. 503 kubectl apply -f myweb.yaml
  505. 504 kubectl expose deployment myweb --type=NodePort --port=80
  506. 505 kubectl get svc
  507. 506 curl 192.168.49.2:32111
  508. 507 history
  509. 508 kubectl create secret -h | less
  510. 509 kubectl create secret docker-registry -h | less
  511. 510 kubectl create secret generic dbpw --from-literal=ROOT_PASSWORD=password
  512. 511 kubectl describe secret dbpw
  513. 512 kubectl get secret dbpw -o yaml
  514. 513 echo cGFzc3dvcmQ= | base64 -d
  515. 514 kubectl create deployment mynewdb --image=mariadb
  516. 515 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MARIADB_
  517. 516 kubectl get all
  518. 517 ./countdown 12
  519. 518 kubectl api-resources | less
  520. 519 kubectl proxy --port=8001 &
  521. 520 kubectl create deploy curlginx --image=nginx --replicas=3
  522. 521 curl http://localhost:8001/version
  523. 522 curl http:/localhost:8001/api/v1/namespaces/default/pods
  524. 523 kubectl get pods
  525. 524 curl http:/localhost:8001/api/v1/namespaces/default/pods/nginx/
  526. 525 curl -XDELETE http:/localhost:8001/api/v1/namespaces/default/pods/nginx/
  527. 526 kubectl get pods
  528. 527 history
  529. 528 kubectl auth can-i get pods
  530. 529 kubectl auth can-i get pods --as bob@example.com
  531. 530 kubectl get pods nginx-probes -o yaml | less
  532. 531 kubectl get sa
  533. 532 kubectl get pods -n kube-system
  534. 533 kubectl get pods -n kube-system storage-provisioner -o yaml | grep -i serviceacc
  535. 534 kubectl get roles
  536. 535 kubectl get roles -A
  537. 536 kubectl get clusterroles
  538. 537 kubectl get clusterroles | less
  539. 538 kubectl get clusterrolebindings.rbac.authorization.k8s.io
  540. 539 kubectl get clusterrolebindings.rbac.authorization.k8s.io | less
  541. 540 vim mypod.yaml
  542. 541 kubectl apply -f mypod.yaml
  543. 542 kubectl get pods mypod -o yaml | less
  544. 543 kubectl exec -it mypod --sh
  545. 544 kubectl exec -it mypod -- sh
  546. 545 cat mysa.yaml
  547. 546 kubectl apply -f mysa.yaml
  548. 547 vim list-pods.yaml
  549. 548 kubectl apply -f list-pods.yaml
  550. 549 vim list-pods-mysa-binding.yaml
  551. 550 kubectl apply -f list-pods-mysa-binding.yaml
  552. 551 vim mysapod.yaml
  553. 552 kubectl apply -f mysapod.yaml
  554. 553 apk add --update curl
  555. 554 kubectl exec -it mysapod -- sh
  556. 555 exit
  557. 556 helm version
  558. 557 helm repo add bitnami https://charts.bitnami.com/bitnami
  559. 558 helm repo list
  560. 559 helm search repo bitnami
  561. 560 helm repo update
  562. 561 helm install bitnami/mysql --generate-name
  563. 562 kubectl get all
  564. 563 helm show chart bitnami/mysql
  565. 564 helm show all bitnami/mysql
  566. 565 helm list
  567. 566 helm status mysql-1678384898
  568. 567 helm show values bitnami/nginx
  569. 568 helm pull bitnami/nginx
  570. 569 tar xvf nginx-13.2.29.tgz
  571. 570 vim nginx/values.yaml
  572. 571 helm template --debug nginx
  573. 572 helm install -f nginx/values.yaml mynginx nginx/
  574. 573 helm list
  575. 574 cd ckad
  576. 575 ./countdown 12
  577. 576 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  578. 577 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  579. 578 kubectl get all --selector app=blue-nginx
  580. 579 source <(kubectl completion bash)
  581. 580 kubectl get deployments.apps blue-nginx -o yaml > green-nginx.yaml
  582. 581 vim green-nginx.yaml
  583. 582 kubectl create -f green-nginx.yaml
  584. 583 kubectl get all --selector app=blue-nginx --selector app=green-nginx
  585. 584 kubectl get all --selector app=blue-nginx,app=green-nginx
  586. 585 kubectl get deploy
  587. 586 kubectl describe svc bgnginx
  588. 587 kubectl edit svc bgnginx
  589. 588 kubectl describe svc bgnginx
  590. 589 kubectl get pods -o wide
  591. 590 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > ~/oldnginx.yaml
  592. 591 vim ~/oldnginx.yaml
  593. 592 kubectl create -f ~/oldnginx.yaml
  594. 593 kubectl expose deploy old-nginx --name=oldnginx --port=80 --type=NodePort --selector type=canary
  595. 594 kubectl get svc
  596. 595 kubectl get endpoints
  597. 596 curl 192.168.49.2:32462
  598. 597 kubectl cp old-nginx-654f595c5-vlsnm:/usr/share/nginx/html/index.html ./index.html
  599. 598 vim index.html
  600. 599 kubectl create cm canary --from-file=index.html
  601. 600 vim canary.yaml
  602. 601 kubectl create -f canary.yaml
  603. 602 kubectl describe svc oldnginx
  604. 603 curl 192.168.49.2:32462
  605. 604 kubectl scale deployment new-nginx --replicas 3
  606. 605 kubectl scale deployment old-nginx --replicas 0
  607. 606 history
  608. 607 kubectl api-resources | less
  609. 608 vim crd-object.yaml
  610. 609 kubectl apply -f crd-object.yaml
  611. 610 kubectl api-resources | grep backup
  612. 611 vim crd-backup.yaml
  613. 612 kubectl apply -f crd-backup.yaml
  614. 613 kubectl get backups
  615. 614 history
  616.  
Add Comment
Please, Sign In to add comment