sandervanvugt

CKAD march24 all days

Mar 6th, 2024
385
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.70 KB | None | 1 0
  1. student@student-virtual-machine:~$ history
  2. 1 cd ckad/
  3. 2 ./countdown 12
  4. 3 ./countdown 2
  5. 4 ./countdown 1
  6. 5 sudo apt install vim git -y
  7. 6 git clone https://github.com/sandervanvugt/ckad
  8. 7 cd ckad/
  9. 8 ls
  10. 9 ls *sh
  11. 10 ./minikube-docker-setup.sh
  12. 11 minikube start --memory=4G
  13. 12 kubectl get all
  14. 13 minikube status
  15. 14 minikube ssh
  16. 15 kubectl get all
  17. 16 kubectl create deployment firstnginx --image=nginx --replicas=3
  18. 17 kubectl get all
  19. 18 history
  20. 19 kubectl -h | less
  21. 20 kubectl completion -h | less
  22. 21 source <(kubectl completion bash)
  23. 22 history
  24. 23 cd ../.kube/
  25. 24 ls
  26. 25 less config
  27. 26 cd
  28. 27 kubectl config view
  29. 28 kubectl get pods
  30. 29 kubectl get pods -n kube-system
  31. 30 kubectl config set-context --current --namespace=kube-system
  32. 31 kubectl get pods
  33. 32 kubectl config set-context --current --namespace=default
  34. 33 kubectl config -h | less
  35. 34 kubectl config set-context -h | less
  36. 35 history
  37. 36 cd ckad/
  38. 37 ls
  39. 38 cd dockerfile/
  40. 39 ls
  41. 40 vim Dockerfile
  42. 41 docker build -t mymap .
  43. 42 docker images
  44. 43 docker build -h
  45. 44 docker save -h | less
  46. 45 docker images
  47. 46 docker save mymap
  48. 47 docker save mymap -o mymap.tar
  49. 48 cd
  50. 49 cd ckad/
  51. 50 history
  52. 51 kubectl get all
  53. 52 kubectl delete pod firstnginx-d8679d567-7zgv8
  54. 53 kubectl get all
  55. 54 kubectl run -h | less
  56. 55 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701
  57. 56 kubectl get pods
  58. 57 kubectl describe pod hazelcast
  59. 58 history get pods
  60. 59 kubectl get pods
  61. 60 kubectl delete pod hazelcast
  62. 61 kubectl get all
  63. 62 kubectl get pods firstnginx-d8679d567-4gnkf -o yaml | less
  64. 63 kubectl describe pods firstnginx-d8679d567-4gnkf
  65. 64 kubectl run mypod --image=busybox
  66. 65 kubectl get pods
  67. 66 kubectl describe pod mypod | less
  68. 67 kubectl get pods mypod -o yaml | less
  69. 68 kubectl run --help | less
  70. 69 kubectl run yamginx --image=nginx --dry-run=client -o yaml
  71. 70 kubectl run yamginx --image=nginx --dry-run=client -o yaml > yamginx.yaml
  72. 71 vim yamginx.yaml
  73. 72 history
  74. 73 kubectl create deploy test --image=nginx --dry-run=client -o yaml
  75. 74 history
  76. 75 #kubectl create deploy mydb --image=mariadb
  77. 76 kubectl create deploy mydb --image=mariadb --dry-run=client -o yaml | less
  78. 77 vim yamginx.yaml
  79. 78 kubectl create -f yamginx.yaml
  80. 79 kubectl delete -f yamginx.yaml
  81. 80 kubectl apply -f yamginx.yaml
  82. 81 vim yamginx.yaml
  83. 82 kubectl apply -f yamginx.yaml
  84. 83 kubectl delete -f yamginx.yaml
  85. 84 kubectl apply -f yamginx.yaml
  86. 85 kubectl get pods
  87. 86 vim yamginx.yaml
  88. 87 kubectl describe pod yamginx
  89. 88 kubectl logs yamginx
  90. 89 history
  91. 90 vim sidecar.yaml
  92. 91 kubectl apply -f sidecar.yaml
  93. 92 kubectl exec -it sidecar-pod -- /bin/bash
  94. 93 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  95. 94 vim sidecar.yaml
  96. 95 vim init-example1.yaml
  97. 96 kubectl apply -f init-example1.yaml
  98. 97 kubectl get pods
  99. 98 kubectl describe pod init-demo1
  100. 99 vim init-example2.yaml
  101. 100 kubectl apply -f init-example2.yaml
  102. 101 kubectl get pods
  103. 102 kubectl describe pod init-demo2
  104. 103 kubectl get ns
  105. 104 kubectl get pods -n default
  106. 105 kubectl get pods -n kube-system
  107. 106 kubectl describe ns default
  108. 107 history
  109. 108 kubectl get all -A
  110. 109 kubectl create ns secret
  111. 110 kubectl get ns
  112. 111 kubectl describe ns secret
  113. 112 vim busybox-ns.yaml
  114. 113 kubectl run pod busybox -- sleep 3600
  115. 114 kubectl run pod sleepyone --image=busybox -- sleep 3600
  116. 115 kubectl get pods
  117. 116 kubectl run secretginx --image=nginx -n secret
  118. 117 kubectl get pods
  119. 118 kubectl get pods -A
  120. 119 kubectl config set-context --current --namespace=secret
  121. 120 kubectl get pods
  122. 121 kubectl config set-context --current --namespace=default
  123. 122 history
  124. 123 kubectl run nginx-lab --image=nginx
  125. 124 kubectl get pods
  126. 125 kubectl describe pod pod
  127. 126 kubectl explain pods.spec | less
  128. 127 kubectl explain pods.spec.volumes | less
  129. 128 kubectl explain deploy.spec | less
  130. 129 kubectl get pods
  131. 130 kubectl exec -it mypod -- sh
  132. 131 kubectl exec -it yamginx -- sh
  133. 132 history
  134. 133 kubectl describe pod sidecar-pod | less
  135. 134 kubectl run faildb --image=mariadb
  136. 135 kubectl get pods
  137. 136 kubectl describe pod faildb | less
  138. 137 kubectl logs faildb
  139. 138 kubectl delete pod faildb
  140. 139 kubectl run --help | less
  141. 140 kubectl run successdb --image=mariadb --env=MARIADB_ROOT_PASSWORD=password
  142. 141 kubectl get pods
  143. 142 history
  144. 143 kubectl get pods
  145. 144 kubectl logs firstnginx-d8679d567-4gnkf
  146. 145 kubectl explain pod.spec | less
  147. 146 kubectl explain pod.spec.securityContext | less
  148. 147 kubectl explain pod.spec.containers.securityContext | less
  149. 148 vim securitycontextdemo2.yaml
  150. 149 kubectl apply -f securitycontextdemo2.yaml
  151. 150 kubectl get pods
  152. 151 kubectl exec -it security-context-demo -- sh
  153. 152 vim securitycontextdemo.yaml
  154. 153 kubectl apply -f securitycontextdemo.yaml
  155. 154 kubectl get pods
  156. 155 kubectl describe pod nginxsecure
  157. 156 history
  158. 157 kubectl delete all --all
  159. 158 sudo poweroff
  160. 159 history
  161. 160 minikube start
  162. 161 kubectl get all
  163. 162 source <(kubectl completion bash)
  164. 163 kubectl get all
  165. 164 kubectl get pods -A
  166. 165 kubectl explain jobs.spec
  167. 166 kubectl explain jobs.spec | less
  168. 167 kubectl create job -h | less
  169. 168 kubectl create job onejob --image=busybox -- date
  170. 169 kubectl get all
  171. 170 kubectl get jobs -o yaml | less
  172. 171 kubectl api-resources | less
  173. 172 kubectl create job another --image=busybox -- sleep 120
  174. 173 kubectl get jobs -o yaml | less
  175. 174 kubectl get jobs onejob -o yaml | grep restartP
  176. 175 kubectl get all
  177. 176 kubectl delete job onejob
  178. 177 kubectl get all
  179. 178 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > mynewjob.yaml
  180. 179 kubectl create job -h | less
  181. 180 vim mynewjob.yaml
  182. 181 kubectl apply -f mynewjob.yaml
  183. 182 kubectl explain --recursive jobs.spec
  184. 183 kubectl explain --recursive jobs.spec | grep -C 5 ttlSecondsA
  185. 184 vim mynewjob.yaml
  186. 185 kubectl apply -f mynewjob.yaml
  187. 186 kubectl get all
  188. 187 kubectl delete job another
  189. 188 kubectl get all
  190. 189 kubectl apply -f mynewjob.yaml
  191. 190 kubectl get all
  192. 191 kubectl create cronjob -h | less
  193. 192 kubectl explain cronjob.spec.schedule
  194. 193 kubectl create cronjob runme --image=busybox --schedule="*/1 * * * *" -- echo greetings from the cluster
  195. 194 kubectl get all
  196. 195 kubectl logs pod/runme-28494093-r2sjw
  197. 196 kubectl delete cronjobs.batch runme
  198. 197 kubectl create cronjob -h | less
  199. 198 kubectl create cronjob hellojob --image=busybox --schedule="*/4 * * * *" -- echo hello world
  200. 199 cd ckad/
  201. 200 ls
  202. 201 cd labs
  203. 202 ls
  204. 203 ./ckad-lab5-grade.sh
  205. 204 kubectl explain pods.spec.containers.resources
  206. 205 kubectl create ns limited
  207. 206 kubectl describe ns limited
  208. 207 kubectl create quota -h | less
  209. 208 #kubectl create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10
  210. 209 kubectl create quota limited-quota --hard=memory=1G,pods=3
  211. 210 kubectl describe ns limited
  212. 211 kubectl create deploy testing --image=nginx --replicas=5
  213. 212 kubectl get all
  214. 213 kubectl describe deploy testing
  215. 214 kubectl get all
  216. 215 kubectl describe replicasets.apps testing-748d4566d5
  217. 216 kubectl describe ns default
  218. 217 kubectl get quota
  219. 218 kubectl delete quota limited-quota
  220. 219 kubectl get all
  221. 220 kubectl scale deployment testing --replicas 4
  222. 221 kubectl get all
  223. 222 history
  224. 223 kubectl create quota limited-quota --hard=memory=1G,pods=3 -n limited
  225. 224 kubectl get ns limited
  226. 225 kubectl describe ns limited
  227. 226 kubectl create deploy another --image=nginx --replicas=5
  228. 227 kubectl delete deploy another
  229. 228 kubectl create deploy another --image=nginx --replicas=5 -n limited
  230. 229 kubectl get all -n limited
  231. 230 kubectl describe -n limited replicaset another-664d446fc6
  232. 231 kubectl set resources -h | less
  233. 232 #kubectl set resources deployment nginx --limits=cpu=200m,memory=512Mi --requests=cpu=100m,memory=256Mi
  234. 233 kubectl get all -n limited
  235. 234 kubectl set -n limited resources deployment another --limits=memory=256Mi
  236. 235 kubectl get all -n limited
  237. 236 kubectl describe ns limited
  238. 237 history
  239. 238 kubectl get all -n limited
  240. 239 kubectl get pods -n limited another-5749bcc7dd-6nqcc
  241. 240 kubectl get pods -n limited another-5749bcc7dd-6nqcc -o yaml
  242. 241 history
  243. 242 kubectl get services
  244. 243 cd ..
  245. 244 vim busybox-ready.yaml
  246. 245 kubectl apply -f busybox-ready.yaml
  247. 246 kubectl get pods
  248. 247 kubectl describe pod busybox-ready
  249. 248 kubectl edit pods busybox-ready
  250. 249 kubectl exec -it busybox-ready -- sh
  251. 250 kubectl get pods
  252. 251 vim nginx-probes.yaml
  253. 252 kubectl apply -f nginx-probes.yaml
  254. 253 kubectl get pods
  255. 254 kubectl create deploy myweb --image=nginx --replicas=3
  256. 255 kubectl get all
  257. 256 kubectl describe deployments.apps myweb
  258. 257 kubectl get all --selector app=myweb
  259. 258 kubectl delete pod myweb-9794cbc77-85rd4
  260. 259 kubectl get all --selector app=myweb
  261. 260 kubectl run mypod --image=nginx
  262. 261 kubectl get all
  263. 262 kubectl delete pod mypod
  264. 263 kubectl get all
  265. 264 kubectl apply -f redis-deploy.yaml
  266. 265 vim redis-deploy.yaml
  267. 266 kubectl api-resources | less
  268. 267 vim redis-deploy.yaml
  269. 268 kubectl apply -f redis-deploy.yaml
  270. 269 history
  271. 270 kubectl get all
  272. 271 kubectl delete cronjobs.batch hellojob
  273. 272 kubectl edit deployments.apps redis
  274. 273 kubectl get all
  275. 274 kubectl delete rs
  276. 275 kubectl delete rs redis-65fbbd8f94
  277. 276 kubectl get all
  278. 277 history
  279. 278 kubectl create deploy nginxup --image=nginx:1.14
  280. 279 kubectl get all --selector app=nginxup
  281. 280 kubectl scale deployment nginxup --replicas=3
  282. 281 kubectl get all --selector app=nginxup
  283. 282 kubectl set image deploy nginxup nginx=nginx:1.17
  284. 283 kubectl get all --selector app=nginxup
  285. 284 kubectl get pods --show-labels
  286. 285 kubectl get pods myweb-9794cbc77-h45br -o yaml | less
  287. 286 kubectl get deploy redis -o yaml | less
  288. 287 kubectl create deploy bluelabel --image=nginx
  289. 288 kubectl label deploy bluelabel state=demo
  290. 289 kubectl get deploy --show-labels
  291. 290 kubectl get all --selector state=demo
  292. 291 kubectl get all --selector app=bluelabel
  293. 292 kubectl get deploy bluelabel -o yaml | less
  294. 293 kubectl describe pod bluelabel-59d6bcf7ff-p9h5p -o yaml | less
  295. 294 kubectl describe pod bluelabel-59d6bcf7ff-p9h5p
  296. 295 kubectl label pod bluelabel-59d6bcf7ff-p9h5p app-
  297. 296 kubectl get pods | grep blue
  298. 297 kubectl get pods --show-labels | grep blue
  299. 298 history
  300. 299 kubectl get deploy -o yaml
  301. 300 kubectl get deploy bluelabel -o yaml
  302. 301 kubectl scale deploy bluelabel --replicas=4
  303. 302 kubectl get all --selector app=bluelabel
  304. 303 kubectl set env deploy bluelabel type=blended
  305. 304 kubectl get all --selector app=bluelabel
  306. 305 vim rolling.yaml
  307. 306 kubectl apply -f rolling.yaml
  308. 307 kubectl rollout history deployment
  309. 308 kubectl edit deployments.apps rolling-nginx
  310. 309 kubectl rollout history deployment
  311. 310 kubectl describe deployments.apps rolling-nginx
  312. 311 kubectl rollout history deployment rolling-nginx --revision=2
  313. 312 kubectl rollout history deployment rolling-nginx --revision=1
  314. 313 kubectl rollout undo deployment rolling-nginx --to-revision=1
  315. 314 kubectl get all
  316. 315 kubectl delete all --all
  317. 316 kubectl create deploy nginxsvc --image=nginx
  318. 317 kubectl get all
  319. 318 kubectl scale deploy nginxsvc --replicas=3
  320. 319 kubectl expose deploy nginxsvc --port=80
  321. 320 kubectl get all
  322. 321 kubectl describe svc nginxsvc
  323. 322 kubectl get pods -o wide
  324. 323 kubectl get endpoints
  325. 324 kubectl get svc
  326. 325 curl 10.101.243.185
  327. 326 minikube ssh
  328. 327 kubectl edit svc nginxsvc
  329. 328 kubectl get svc
  330. 329 minikube ip
  331. 330 curl 192.168.49.2:32519
  332. 331 history
  333. 332 kubectl get svc
  334. 333 kubectl get all -n kube-system
  335. 334 kubectl get pods -o wide -n kube-system
  336. 335 kubectl get endpoints -A
  337. 336 kubectl run testpod --image=busybox -- sleep 3600
  338. 337 kubectl create ns other
  339. 338 kubectl run newginx --image=nginx -n other
  340. 339 kubectl expose pod -n other newginx --port=80
  341. 340 kubectl get svc -A
  342. 341 kubectl get svc,pods -n kube-system
  343. 342 kubectl get svc
  344. 343 kubectl exec -it testpod -- cat /etc/resolv.conf
  345. 344 kubectl exec -it testpod -- nslookup nginxsvc
  346. 345 kubectl exec -it testpod -- nslookup newginx
  347. 346 kubectl get svc -A
  348. 347 kubectl exec -it testpod -- nslookup newginx.other.svc.cluster.local
  349. 348 history
  350. 349 kubectl get svc
  351. 350 kubectl get svc -A
  352. 351 vim nwpolicy-complete-example.yaml
  353. 352 kubectl apply -f nwpolicy-complete-example.yaml
  354. 353 kubectl expose pod nginx --port=80
  355. 354 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  356. 355 kubectl get pods --show-labels
  357. 356 kubectl describe networkpolicies.networking.k8s.io
  358. 357 minikube addons list
  359. 358 kubectl get all -n kube-system
  360. 359 kubectl get ns
  361. 360 kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
  362. 361 kubectl get pods -A
  363. 362 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  364. 363 minikube stop
  365. 364 minikube start
  366. 365 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  367. 366 kubectl get pods
  368. 367 kubectl get networkpolicy
  369. 368 kubectl get pods
  370. 369 kubectl apply -f nwpolicy-complete-example.yaml
  371. 370 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  372. 371 minikube stop
  373. 372 minikube start --cni=calico
  374. 373 kubectl get ns
  375. 374 kubectl get pods -n kube-system
  376. 375 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  377. 376 kubectl delete -f nwpolicy-complete-example.yaml
  378. 377 kubectl all
  379. 378 kubectl get all
  380. 379 kubectl apply -f nwpolicy-complete-example.yaml
  381. 380 kubectl get svc
  382. 381 kubectl describe svc nginx
  383. 382 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  384. 383 kubectl edit svc nginxsvc
  385. 384 history
  386. 385 minikube stop
  387. 386 minikube delete
  388. 387 ls *sh
  389. 388 cat minikube-docker-setup
  390. 389 cat minikube-docker-setup.sh
  391. 390 minikube start --cni-calico
  392. 391 minikube start --cni=calico
  393. 392 kubectl get all
  394. 393 kubectl apply -f nwpolicy-complete-example.yaml
  395. 394 history
  396. 395 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  397. 396 kubectl get all
  398. 397 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  399. 398 history
  400. 399 history | grep expose
  401. 400 kubectl expose pod nginx --port=80
  402. 401 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  403. 402 vim nwpolicy-complete-example.yaml
  404. 403 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  405. 404 kubectl label pod busybox access=true
  406. 405 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  407. 406 kubectl describe svc nginx
  408. 407 kubectl get networkpolicy
  409. 408 kubectl describe networkpolicy
  410. 409 histort
  411. 410 history
  412. 411 minikube addons list
  413. 412 minikube addons enable ingress
  414. 413 kubectl get ns
  415. 414 kubectl get all -n ingress-nginx
  416. 415 kubectl create deploy nginxsvc --image=nginx --replicas=3
  417. 416 kubectl expose deploy nginxsvc --port=80
  418. 417 kubectl edit svc nginxsvc
  419. 418 kubectl get all
  420. 419 kubectl describe svc nginxsvc
  421. 420 kubectl create ing -h | less
  422. 421 kubectl create ing nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080"
  423. 422 sudo vim /etc/hosts
  424. 423 kubectl get ing
  425. 424 curl nginxsvc.info
  426. 425 kubectl describe ing nginxsvc-ingress
  427. 426 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  428. 427 kubectl expose deploy newdep --port=8080
  429. 428 curl nginxsvc.info/hello
  430. 429 kubectl describe ing nginxsvc-ingress
  431. 430 cat /etc/hosts
  432. 431 kubectl edit svc nginxsvc
  433. 432 curl nginxsvc.info
  434. 433 history
  435. 434 kubectl describe ing nginxsvc-ingress
  436. 435 kubectl svc nginxsvc-ingress.yaml
  437. 436 kubectl describe svc nginxsvc
  438. 437 kubectl edit svc nginxsvc
  439. 438 curl nginxsvc.info
  440. 439 history
  441. 440 cat /etc/hosts
  442. 441 history
  443. 442 kubectl explain persistentvolume.spec | less
  444. 443 kubectl explain pods.spec.volumes | less
  445. 444 cat morevolumes.yaml
  446. 445 kubectl apply -f morevolumes.yaml
  447. 446 kubectl api-resources | less
  448. 447 kubectl get pods
  449. 448 kubectl describe pod morevol2
  450. 449 kubectl exec -it morevol2 -c centos1 -- touch /centos/test
  451. 450 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  452. 451 kubectl exec -ti morevol2 -c centos2 -- ls /centos2/
  453. 452 kubectl delete -f morevolumes.yaml
  454. 453 cat pv.yaml
  455. 454 kubectl apply -f pv.yaml
  456. 455 kubectl get pv,pvc
  457. 456 vim pvc.yaml
  458. 457 kubectl apply -f pvc.yaml
  459. 458 kubectl get pv,pvc
  460. 459 kubectl get storageclass
  461. 460 kubectl describe pvc pv-claim
  462. 461 kubectl describe pv pvc-219d52b2-70e3-4899-a5f1-10c636301d6c
  463. 462 vim pvc-pod.yaml
  464. 463 kubectl apply -f pvc-pod.yaml
  465. 464 kubectl get pv,pvc
  466. 465 kubectl describe pv pvc-17170053-33eb-4644-ad62-4ee52726969a
  467. 466 kubectl exec nginx-pvc-pod -- touch /usr/share/nginx/html/testfile
  468. 467 minikube ssh
  469. 468 vim pv-pvc-pod.yaml
  470. 469 kubectl apply -f pv-pvc-pod.yaml
  471. 470 kubectl delete -f pv-pvc-pod.yaml
  472. 471 kubectl create ns myvol
  473. 472 kubectl apply -f pv-pvc-pod.yaml
  474. 473 kubectl get pv
  475. 474 kubectl api-resources | less
  476. 475 history
  477. 476 kubectl create deploy mydb --image=mariadb
  478. 477 kubectl describe pods mydb-7bbb588c85-zq5hm
  479. 478 kubectl logs mydb-7bbb588c85-zq5hm
  480. 479 kubectl set env deploy mydb MARIADB_ROOT_PASSWORD=password
  481. 480 kubectl get deployments.apps mydb -o yaml > mydb.yaml
  482. 481 vim mydb.yaml
  483. 482 kubectl delete deploy mydb
  484. 483 vim varsfile
  485. 484 kubectl create cm mydbvars --from-env-file=varsfile
  486. 485 kubectl describe cm mydbvars
  487. 486 kubectl create deploy mydb --image=mariadb --replicas=3
  488. 487 kubectl set env deploy mydb --from=configmap/mydbvars
  489. 488 kubectl get deploy mydb -o yaml | less
  490. 489 echo hello world > index.html
  491. 490 kubectl create cm myindex --from-file=index.html
  492. 491 kubectl describe cm myindex
  493. 492 kubectl get cm myindex -o yaml
  494. 493 kubectl create deploy myweb --image=nginx --dry-run=client -o yaml > myweb.yaml
  495. 494 vim myweb.yaml
  496. 495 kubectl apply -f myweb.yaml
  497. 496 kubectl exec -it myweb-664b944b49-8j8q5 -- cat /usr/share/nginx/html/index.html
  498. 497 kubectl create secret -h
  499. 498 kubectl create secret generic -h
  500. 499 kubectl create secret generic -h | less
  501. 500 kubectl create secret generic dbpw --from-literal=ROOT_PASSWORD=password
  502. 501 kubectl get secret dbpw
  503. 502 kubectl get secret dbpw -o yaml
  504. 503 echo cGFzc3dvcmQ= | base64 -d
  505. 504 kubectl create deploy mynewdb --image=mariadb
  506. 505 kubectl set env deploy mynewdb --from=secret/dbpwd --prefix=MARIADB_
  507. 506 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MARIADB_
  508. 507 kubectl explain --recursive pod.spec | less
  509. 508 kubectl create secret docker-registry -h | less
  510. 509 history
  511. 510 kubectl api-versions
  512. 511 kubectl api-resources
  513. 512 kubectl api-resources | wc -l
  514. 513 kubectl get pods -n kube-system
  515. 514 kubectl config view
  516. 515 kubectl proxy --port=8001 &
  517. 516 kubectl create deploy curlginx --image=nginx --replicas=3
  518. 517 curl http://localhost:8001/version
  519. 518 curl http://localhost:8001/api/v1/namespaces/default/pods
  520. 519 kubectl get pods
  521. 520 curl http://localhost:8001/api/v1/namespaces/default/pods/busybox
  522. 521 curl --X DELETE http://localhost:8001/api/v1/namespaces/default/pods/busybox
  523. 522 kubectl get pods
  524. 523 history
  525. 524 kubectl auth -h | less
  526. 525 kubectl auth whoami
  527. 526 kubectl auth can-i get pods
  528. 527 kubectl auth can-i get pods --as [email protected]
  529. 528 kubectl get pods
  530. 529 kubectl get pods nginx -o yaml | less
  531. 530 kubectl get sa
  532. 531 kubectl get roles
  533. 532 kubectl get clusterroles
  534. 533 kubectl describe clusterroles view
  535. 534 vim mypod.yaml
  536. 535 kubectl apply -f mypod.yaml
  537. 536 kubectl get pods mypod -o yaml
  538. 537 kubectl exec -it mypod -- sh
  539. 538 vim mysa.yaml
  540. 539 kubectl apply -f mysa.yaml
  541. 540 kubectl get sa
  542. 541 vim list-pods.yaml
  543. 542 kubectl apply -f list-pods.yaml
  544. 543 vim list-pods-mysa-binding.yaml
  545. 544 kubectl apply -f list-pods-mysa-binding.yaml
  546. 545 vim mysapod.yaml
  547. 546 kubectl apply -f mysapod.yaml
  548. 547 kubectl exec -it mysapod
  549. 548 kubectl exec -it mysapod -- bash
  550. 549 kubectl exec -it mysapod -- sh
  551. 550 kubectl get sa
  552. 551 kubectl set sa -h | less
  553. 552 kubectl get pods
  554. 553 kubectl get pods mypod -o yaml mmypod.yaml
  555. 554 kubectl get pods mypod -o yaml > mmypod.yaml
  556. 555 vim mmypod.yaml
  557. 556 kubectl delete pod mypod
  558. 557 kubectl apply -f mmypod.yaml
  559. 558 vim mmypod.yaml
  560. 559 kubectl apply -f mmypod.yaml
  561. 560 kubectl get pods mypod -o yaml
  562. 561 cd ../Downloads/
  563. 562 ls
  564. 563 tar xvf helm-v3.14.2-linux-amd64.tar.gz
  565. 564 sudo mv linux-amd64/helm /usr/local/bin/
  566. 565 helm version
  567. 566 helm repo list
  568. 567 helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard
  569. 568 helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard
  570. 569 kubectl get nbs
  571. 570 kubectl get ns
  572. 571 kubectl get svc
  573. 572 helm repo add bitnami https://charts.bitnami.com/bitnami
  574. 573 helm repo list
  575. 574 helm search repo bitnami
  576. 575 helm search repo file
  577. 576 helm search repo nginx --versions
  578. 577 helm list
  579. 578 helm install bitnami/mysql --generate-name
  580. 579 kubectl get all
  581. 580 helm show chart bitnami/mysql
  582. 581 helm show all bitnami/mysql
  583. 582 helm list
  584. 583 helm status mysql-1709740587
  585. 584 helm show values
  586. 585 helm repo list
  587. 586 helm show values bitnami/nginx
  588. 587 helm show values bitnami/nginx | grep commonLabels
  589. 588 helm show values bitnami/nginx | grep replicaCount
  590. 589 cd ../ckad/
  591. 590 vim values.yaml
  592. 591 helm install bitnami/nginx --generate-name --values values.yaml
  593. 592 helm list
  594. 593 helm get values nginx-1709741010
  595. 594 kubectl get deploy
  596. 595 kubectl get deploy --show-labels
  597. 596 history
  598. 597 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  599. 598 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  600. 599 kubectl get all --selector app=blue-nginx
  601. 600 kubectl get deployments.apps blue-nginx -o yaml > green-nginx.yaml
  602. 601 vim green-nginx.yaml
  603. 602 kubectl apply -f green-nginx.yaml
  604. 603 kubectl get pods
  605. 604 kubectl delete svc bgnginx; kubectl expose deploy green-nginx --port=80 --name=bgnginx
  606. 605 kubectl delete deploy blue-nginx
  607. 606 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > ~/oldnginx.yaml
  608. 607 vim ~/oldnginx.yaml
  609. 608 kubectl apply -f ~/oldnginx.yaml
  610. 609 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  611. 610 kubectl get svc
  612. 611 kubectl edit svc oldnginx
  613. 612 curl 192.168.49.2:
  614. 613 kubectl get svc
  615. 614 curl 192.168.49.2:32686
  616. 615 kubectl cp old-nginx-5d6fc48749-tlr86:/usr/share/nginx/html/index.html ~/index.html
  617. 616 vim ~/index.html
  618. 617 kubectl create configmap canary --from-file=~/index.html
  619. 618 kubectl create configmap canary --from-file=/home/student/index.html
  620. 619 kubectl describe cm canary
  621. 620 vim canary.yaml
  622. 621 kubectl apply -f canary.yaml
  623. 622 curl 192.168.49.2:32686
  624. 623 kubectl get deploy
  625. 624 kubectl scale deploy new-nginx --replicas=3
  626. 625 kubectl scale deploy old-nginx --replicas=0
  627. 626 history
  628. 627 ls
  629. 628 less RESOURCE.TXT
  630. 629 vim crd-object.yaml
  631. 630 kubectl apply -f crd-object.yaml
  632. 631 kubectl api-resources | grep backup
  633. 632 car crd-backup.yaml
  634. 633 cat crd-backup.yaml
  635. 634 kubectl apply -f crd-backup.yaml
  636. 635 kubectl get backups
  637. 636 cd ..
  638. 637 git clone https://github.com/sandervanvugt/microservices
  639. 638 cd microservices/
  640. 639 ls
  641. 640 cd lesson6lab/
  642. 641 ls
  643. 642 vim kustomization.yaml
  644. 643 kubectl -k .
  645. 644 kubectl apply -k .
  646. 645 cd ../
  647. 646 ls
  648. 647 less RESOURCE.TXT
  649. 648 cd ..
  650. 649 history
  651.  
Add Comment
Please, Sign In to add comment