sandervanvugt

CKAD dec22 all days

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