sandervanvugt

CKAD all days june23

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