sandervanvugt

CKAD sept23 all days

Sep 7th, 2023
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.10 KB | None | 0 0
  1. 1 sudo apt install git vim -y
  2. 2 git clone https://github.com/sandervanvugt/ckad
  3. 3 cd ckad
  4. 4 ls
  5. 5 ./minikube-docker-setup.sh
  6. 6 minikube start --vm-driver=docker --cni-calico --memory=4G
  7. 7 sudo ./minikube-docker-setup.sh
  8. 8 minikube start --vm-driver=docker --cni-calico --memory=4G
  9. 9 kill -9 3647
  10. 10 sudo kill -9 3647
  11. 11 sudo ./minikube-docker-setup.sh
  12. 12 sudo reboot
  13. 13 minikube start --vm-driver=docker --cni-calico --memory=4G
  14. 14 minikube start --vm-driver=docker --cni=calico --memory=4G
  15. 15 kubectl get all
  16. 16 history
  17. 17 ls
  18. 18 history
  19. 19 kubectl get all
  20. 20 minikube dashboard
  21. 21 minikube status
  22. 22 kubectl create deploy firstnginx --image=nginx
  23. 23 kubectl get all
  24. 24 history
  25. 25 kubectl get all
  26. 26 kubectl describe pod firstnginx-5bd69574fc-jwnw7
  27. 27 docker login
  28. 28 kubectl create deploy secondnginx --image=nginx
  29. 29 kubectl get all
  30. 30 kubectl create deploy thirdnginx --image=ghcr.io/nginx-proxy/nginx-proxy:latest
  31. 31 kubectl get all
  32. 32 kubectl create deploy fourthnginx --image=quay.io/bedrock/nginx
  33. 33 kubectl get all
  34. 34 kubectl create deploy fithnginx --image=ghcr.io/nginx
  35. 35 kubectl get all
  36. 36 kubectl create deploy fithnginx --image=ghcr.io/nginx/nginx
  37. 37 kubectl create deploy sixthnginx --image=ghcr.io/nginx/nginx
  38. 38 kubectl get all
  39. 39 kubectl create deploy 7nginx --image=hg.nginx.org/nginx
  40. 40 kubectl get pods
  41. 41 kubectl delete deploy --all
  42. 42 kubectl create deploy test1 --image=quay.io/centos7/httpd-24-centos7
  43. 43 kubectl get all
  44. 44 kubectl delete deploy --all
  45. 45 kubectl -h
  46. 46 kubectl completion -h | less
  47. 47 source <(kubectl completion bash)
  48. 48 kubectl create deployment -h | less
  49. 49 kubectl create deployment newginx --image=nginx --replicas=3
  50. 50 kubectl get all
  51. 51 history | less
  52. 52 less ~/.kube/config
  53. 53 kubectl config view
  54. 54 kubectl get pods
  55. 55 kubectl get pods -A
  56. 56 kubectl get pods
  57. 57 kubectl config set-context --current --namespace=kube-system
  58. 58 kubectl get pods
  59. 59 kubectl config set-context --current --namespace=default
  60. 60 kubectl get pods
  61. 61 kubectl config set-context -h | less
  62. 62 kubectl config -h
  63. 63 ls
  64. 64 cd dockerfile/
  65. 65 ls
  66. 66 vim Dockerfile
  67. 67 docker build -t centmap .
  68. 68 docker images
  69. 69 kubectl run -h | less
  70. 70 kubectl run bedrockginx --image=quay.io/bedrock/nginx
  71. 71 kubectl get pods
  72. 72 kubectl describe pod bedrockginx
  73. 73 cd ..
  74. 74 vim pullpatch.sh
  75. 75 kubectl get pods
  76. 76 kubectl describe pod bedrockginx | less
  77. 77 kubectl get pods -n kube-system
  78. 78 kubectl describe pod etcd-minikube
  79. 79 kubectl describe pod etcd-minikube -n kube-system
  80. 80 kubectl describe pod etcd-minikube -n kube-system | less
  81. 81 kubectl api-resources | less
  82. 82 kubectl explain pods
  83. 83 kubectl explain pods.spec | less
  84. 84 kubectl explain deploy.spec | less
  85. 85 kubectl get all -n kube-system
  86. 86 kubectl delete pod -n kube-system kube-proxy-7dpnk
  87. 87 kubectl get all -n kube-system
  88. 88 kubectl get all
  89. 89 kubectl delete pod newginx-567496999-dzq7k
  90. 90 kubectl get all
  91. 91 kubectl delete pod bedrockginx
  92. 92 kubectl get all
  93. 93 kubectl scale deployment newginx --replicas=2
  94. 94 kubectl get all
  95. 95 kubectl run mynginx --image=nginx
  96. 96 kubectl get all
  97. 97 kubectl get pods mynginx -o yaml | less
  98. 98 kubectl describe pod mynginx
  99. 99 history
  100. 100 ls
  101. 101 vim httpd.yaml
  102. 102 kubectl api-resources | less
  103. 103 vim httpd.yaml
  104. 104 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  105. 105 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  106. 106 vim mynginx.yaml
  107. 107 vim two-container-pod.yaml
  108. 108 kubectl create -f mynginx.yaml
  109. 109 kubectl delete -f mynginx.yaml
  110. 110 kubectl apply -f mynginx.yaml
  111. 111 kubectl diff -h | less
  112. 112 kubectl diff -f mynginx.yaml
  113. 113 vim mynginx.yaml
  114. 114 kubectl diff -f mynginx.yaml
  115. 115 vim mynginx.yaml
  116. 116 kubectl diff -f mynginx.yaml
  117. 117 vim mynginx.yaml
  118. 118 kubectl diff -f mynginx.yaml
  119. 119 vim mynginx.yaml
  120. 120 kubectl diff -f mynginx.yaml
  121. 121 kubectl get all
  122. 122 minikube ssh
  123. 123 kubectl get pods
  124. 124 kubectl get pods -n kube-system
  125. 125 kubectl create deploy troublenginx --image=nginx --replicas=3
  126. 126 kubectl get all
  127. 127 kubectl get pods -n kube-system
  128. 128 history | less
  129. 129 kubectl describe -n kube-system pod calico-kube-controllers-85578c44bf-zvdzb
  130. 130 kubectl get pods -n kube-system
  131. 131 kubectl get all -n kube-system
  132. 132 kubectl delete pods -n kube-system calico-kube-controllers-85578c44bf-zvdzb calico-node-d62jc
  133. 133 kubectl get all -n kube-system
  134. 134 kubectl describe -n kube-system pod calico-kube-controllers-85578c44bf-sdn9l
  135. 135 vim varsfile
  136. 136 kubectl create cm mydbvars --from-env-file=varsfile
  137. 137 kubectl get cm
  138. 138 kubectl describe cm mydbvars
  139. 139 kubectl create secret -h | less
  140. 140 kubectl create secret generic -h | less
  141. 141 kubectl create secret generic my-secret --from-literal=key1=supersecret --from-literal=key2=topsecret
  142. 142 kubectl describe secret my-secret
  143. 143 kubectl get secret my-secret -o yaml
  144. 144 echo c3VwZXJzZWNyZXQ= | base64 -d
  145. 145 kubectl create secret docker-registry -h
  146. 146 kubectl create secret docker-registry -h | less
  147. 147 #kubectl create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json
  148. 148 cd ..
  149. 149 find . -name "config.json"
  150. 150 cat .docker/config.json
  151. 151 history
  152. 152 history -d 151
  153. 153 kubectl create secret docker-registry -h | less
  154. 154 #kubectl create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json
  155. 155 kubectl create secret docker-registry dockercreds --from-file=.dockerconfigjson=./.docker/config.json
  156. 156 kubectl explain -r daemonset.spec | less
  157. 157 kubectl explain --recursive daemonset.spec | less
  158. 158 kubectl get all -n kube-system
  159. 159 kubectl edit -n kube-system daemonset calico-node
  160. 160 kubectl get all -n kube-system
  161. 161 kubectl edit -n kube-system daemonset calico-node
  162. 162 kubectl explain daemonset.spec.template.spec | less
  163. 163 history
  164. 164 sudo -i
  165. 165 minikube ssh
  166. 166 kubectl edit -n kube-system daemonset calico-node
  167. 167 history
  168. 168 kubectl get -n kube-system daemonset calico-node -o yaml > calico-node.yaml
  169. 169 vim calico-node.yaml
  170. 170 kubectl replace -f calico-node.yaml
  171. 171 kubectl get pods -n kube-system
  172. 172 kubectl get pods
  173. 173 cd ckad
  174. 174 ls
  175. 175 ls -lrt
  176. 176 vim pullpatch.sh
  177. 177 chmod +x pullpatch.sh
  178. 178 ./pullpatch.sh
  179. 179 man read
  180. 180 help read
  181. 181 vim pullpatch.sh \
  182. 182 vim pullpatch.sh
  183. 183 kubectl get sa default -o yaml
  184. 184 cat pullpatch.sh
  185. 185 kubectl run pascalbox --image=quay.io/pamvdam/busybox-curl:latest -- sleep 60
  186. 186 kubectl get pods
  187. 187 kubectl run pascalcontainer --image=quay.io/pamvdam/containers:1.5
  188. 188 kubectl run pascalginx --image=quay.io/pamvdam/nginxc:v6.2
  189. 189 kubectl get pods
  190. 190 kubectl expose pod pascalcontainer
  191. 191 kubectl expose pod pascalcontainer --port 8080
  192. 192 kubectl get svc
  193. 193 minikube ssh
  194. 194 kubectl run versionginx --image=nginx
  195. 195 minikube ssh
  196. 196 kubectl run 25ginx --image=nginx:1.25
  197. 197 docker images
  198. 198 kubectl get pods
  199. 199 kubectl run --help | less
  200. 200 kubectl create deploy -h | less
  201. 201 kubectl explain serviceaccount.spec
  202. 202 kubectl explain serviceaccount
  203. 203 kubectl create secret -h
  204. 204 kubectl create secret docker-registry -h | less
  205. 205 docker login -h
  206. 206 kubectl create secret docker-registry -h | less
  207. 207 kubectl run -h | less
  208. 208 kubectl edit daemonset -n kube-system calico-node
  209. 209 kubectl api-resources | less
  210. 210 kubectl get sa
  211. 211 kubectl get pods
  212. 212 kubectl get pods pascalginx -o yaml | less
  213. 213 ls -lrt
  214. 214 vim pullpatch.sh
  215. 215 kubectl explain serviceaccount
  216. 216 vim pullpatch.sh
  217. 217 kubect get sa default -o yaml
  218. 218 kubectl get sa default -o yaml
  219. 219 echo START OF DAY 2
  220. 220 cd ..
  221. 221 mv ckad.old
  222. 222 mv ckad ckad.old
  223. 223 git clone https://github.com/sandervanvugt/ckad
  224. 224 cd ckad
  225. 225 ls
  226. 226 ls *sh
  227. 227 ls *pdf
  228. 228 kubectl get pods
  229. 229 kubectl get pods -n kube-system
  230. 230 kubectl get daemonset
  231. 231 kubectl get daemonset -n kube-system
  232. 232 kubectl edit -n kube-system calico-node
  233. 233 kubectl edit -n kube-system daemonset calico-node
  234. 234 history | less
  235. 235 kubectl get daemonset -n kube-system calico-node -o yaml > calico-node.yaml
  236. 236 vim calico-node.yaml
  237. 237 ls *sh
  238. 238 vim pullratelimitpatch.sh
  239. 239 kubectl get pods mynginx -o yaml
  240. 240 kubectl get sa
  241. 241 kubectl get sa -A
  242. 242 kubectl get sa default -o yaml
  243. 243 ls *pdf
  244. 244 ./countdown 1
  245. 245 kubectl get secrets
  246. 246 vim sidecar.yaml
  247. 247 kubectl apply -f sidecar.yaml
  248. 248 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  249. 249 vim init-example1.yaml
  250. 250 kubectl apply -f init-example1.yaml
  251. 251 kubectl get pods
  252. 252 kubectl apply -f init-example2.yaml
  253. 253 kubectl delete -f init-example2.yaml
  254. 254 vim init-example2.yaml
  255. 255 kubectl apply -f init-example2.yaml
  256. 256 kubectl get pods
  257. 257 kubectl create ns mynamespace
  258. 258 kubectl get ns
  259. 259 kubectl get sa -n mynamespace
  260. 260 kubectl config set-context --current --namespace=mynamespace
  261. 261 kubectl get all
  262. 262 kubectl get all,sa
  263. 263 kubectl get all -A
  264. 264 kubectl create ns secret
  265. 265 kubectl describe ns secret
  266. 266 vim busybox-ns.yaml
  267. 267 kubectl apply -f busybox-ns.yaml
  268. 268 kubectl get pods
  269. 269 kubectl config set-context --current --namespace=default
  270. 270 kubectl get pods -n secret
  271. 271 kubectl run secretginx --image=nginx -n secret
  272. 272 kubectl get pods -n secret
  273. 273 history
  274. 274 ./countdown 3
  275. 275 kubectl run -h | less
  276. 276 kubectl run nginx-lab --image=nginx
  277. 277 kubectl run faildb --image=mariadb
  278. 278 kubectl get pods
  279. 279 kubectl describe pod faildb
  280. 280 kubectl logs faildb
  281. 281 kubectl delete pod faildb
  282. 282 kubectl run -h | less
  283. 283 kubectl run successdb --image=mariadb --env=MARIADB_ROOT_PASSWORD=password
  284. 284 kubectl get pods
  285. 285 kubectl describe pod pascalbox
  286. 286 kubectl get pods pascalbox -o yaml > pascalbox.yaml
  287. 287 vim pascalbox.yaml
  288. 288 kubectl explain pod.spec | less
  289. 289 kubectl explain --recursive pod.spec | less
  290. 290 kubectl explain pod.spec.containers.imagePullPolicy
  291. 291 history
  292. 292 vim securitycontextdemo2.yaml
  293. 293 kubectl apply -f securitycontextdemo2.yaml
  294. 294 kubectl get pods
  295. 295 kubectl exec -ti security-context-demo -- sh
  296. 296 cat securitycontextdemo2.yaml
  297. 297 vim securitycontextdemo.yaml
  298. 298 kubectl apply -f securitycontextdemo.yaml
  299. 299 kubectl get pods
  300. 300 kubectl describe pod nginxsecure
  301. 301 kubectl create -h
  302. 302 kubectl create job onejob --image=busybox -- date
  303. 303 kubectl get jobs,pods
  304. 304 kubectl get jobs onejob -o yaml | less
  305. 305 kubectl delete job onejob
  306. 306 kubectl delete pod 25ginx mynginx nginx-lab nginxsecure pascalbox pascalcontainer pascalginx security-context-demo sidecar-pod successdb versionginx
  307. 307 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > mynewjob.yaml
  308. 308 vim mynewjob.yaml
  309. 309 kubectl apply -f mynewjob.yaml
  310. 310 kubectl get all
  311. 311 kubectl create cronjob -h | less
  312. 312 kubectl create cronjob runme --image=busybox --schedule="*/1 * * * *" -- echo greetings from the cluster
  313. 313 kubectl get cronjobs,jobs,pods
  314. 314 kubectl logs runme-28233464-rcw8p
  315. 315 kubectl delete cronjob runme
  316. 316 kubectl get cronjobs,jobs,pods
  317. 317 ./countdown 3
  318. 318 kubectl explain pod.spec.containers.resources
  319. 319 kubectl explain pod.spec.containers.resources.limits
  320. 320 kubectl explain pod.spec.containers.resources.limits | less
  321. 321 vim frontend-resources.yaml
  322. 322 kubectl apply -f frontend-resources.yaml
  323. 323 kubectl get pods
  324. 324 kubectl describe pods frontend
  325. 325 kubectl get pods
  326. 326 kubectl delete -f frontend-resources.yaml
  327. 327 vim frontend-resources.yaml
  328. 328 kubectl apply -f frontend-resources.yaml
  329. 329 kubectl get pods
  330. 330 kubectl describe pod frontend
  331. 331 kubectl delete -f frontend-resources.yaml
  332. 332 vim frontend-resources.yaml
  333. 333 kubectl apply -f frontend-resources.yaml
  334. 334 kubectl get pods
  335. 335 kubectl describe pod frontend
  336. 336 history
  337. 337 vim kd.yaml
  338. 338 vim busybox-ready.yaml
  339. 339 kubectl apply -f busybox-ready.yaml
  340. 340 kubectl get pods
  341. 341 kubectl describe pod busybox-ready
  342. 342 kubectl edit pods busybox-ready
  343. 343 kubectl exec -it busybox-ready -- /bin/sh
  344. 344 kubectl get pods
  345. 345 vim nginx-probes.yaml
  346. 346 kubectl apply -f nginx-probes.yaml
  347. 347 kubectl get pods
  348. 348 kubectl get deploy
  349. 349 kubectl get all --selector app=troubleginx
  350. 350 kubectl get all --selector app=troublenginx
  351. 351 kubectl delete pod troublenginx-cb9c54584-8k7t6
  352. 352 kubectl get all --selector app=troublenginx
  353. 353 kubectl create deploy myweb --image=nginx --replicas=3
  354. 354 kubectl get deploy --show-labels
  355. 355 kubectl get all --selector app=myweb
  356. 356 kubectl delete pod myweb-5df8f7d5bc-4c6tq
  357. 357 kubectl get all --selector app=myweb
  358. 358 kubectl run pod mypod --image=nginx
  359. 359 kubectl get pods
  360. 360 kubectl delete pod pod
  361. 361 kubectl run mypod --image=nginx
  362. 362 kubectl get pods
  363. 363 kubectl delete pod mypod
  364. 364 kubectl get pods
  365. 365 vim redis-deploy.yaml
  366. 366 kubectl apply -f redis-deploy.yaml
  367. 367 vim redis-deploy.yaml
  368. 368 kubectl api-versions | less
  369. 369 kubectl api-versions
  370. 370 vim redis-deploy.yaml
  371. 371 kubectl apply -f redis-deploy.yaml
  372. 372 kubectl edit deployments.apps redis
  373. 373 kubectl get all
  374. 374 kubectl delete -f redis-deploy.yaml
  375. 375 kubectl delete all --all
  376. 376 kubectl create deploy nginxup --image=nginx:1.14
  377. 377 kubectl get all --selector app=nginxup
  378. 378 kubectl set image deploy nginxup nginx=nginx:1.17
  379. 379 kubectl get all --selector app=nginxup
  380. 380 kubectl get all --show-labels
  381. 381 kubectl get deployments.apps nginxup -o yaml | less
  382. 382 kubectl apply -f redis-deploy.yaml
  383. 383 kubectl get deploy redis -o yaml | less
  384. 384 kubectl create deploy bluelabel --image=nginx
  385. 385 kubectl label deploy bluelabel state=demo
  386. 386 kubectl get all --selector app=bluelabel --show-labels
  387. 387 kubectl label pod bluelabel-867c87c657-7kw7g app-
  388. 388 kubectl get pods
  389. 389 kubectl get deployments.apps bluelabel -o yaml
  390. 390 kubectl scale deployment bluelabel --replicas=4
  391. 391 kubectl get all --selector app=bluelabel
  392. 392 kubectl set env deploy bluelabel type=blended
  393. 393 kubectl get all --selector app=bluelabel
  394. 394 kubectl get deployments.apps bluelabel -o yaml
  395. 395 kubectl get deployments.apps bluelabel -o yaml | less
  396. 396 kubectl apply -f rolling.yaml
  397. 397 kubectl rollout history deploy
  398. 398 kubectl edit deploy rolling-nginx
  399. 399 kubectl rollout history deploy
  400. 400 kubectl describe deployments.apps rolling-nginx
  401. 401 kubectl rollout history deployment rolling-nginx --revision=2
  402. 402 kubectl rollout history deployment rolling-nginx --revision=1
  403. 403 kubectl rollout undo deployment rolling-nginx --to-revision=1
  404. 404 kubectl get all
  405. 405 history
  406. 406 kubectl create deploy nginxsvc --image=nginx
  407. 407 kubectl get all --selector app=nginxsvc
  408. 408 kubectl scale deploy nginxsvc --replicas=3
  409. 409 kubectl get all --selector app=nginxsvc
  410. 410 kubectl expose deploy nginxsvc --port=80
  411. 411 kubectl get all --selector app=nginxsvc
  412. 412 kubectl describe svc nginxsvc
  413. 413 kubectl get pods -o wide
  414. 414 kubectl get endpoints
  415. 415 kubectl get svc nginxsvc -o yaml
  416. 416 kubectl get svc
  417. 417 curl 10.107.192.87
  418. 418 minikube ssh
  419. 419 kubectl edit svc nginxsvc
  420. 420 kubectl get svc
  421. 421 curl $(minikube ip):30343
  422. 422 history
  423. 423 minikube ip
  424. 424 kubectl get svc
  425. 425 kubectl run testpod --image=busybox -- sleep 3600
  426. 426 kubectl create ns other
  427. 427 kubectl run newnginx --image=nginx -n other
  428. 428 kubectl get pods -n other
  429. 429 kubectl expose -n other newnginx --port=80
  430. 430 kubectl expose -n other pod newnginx --port=80
  431. 431 kubectl get svc -A
  432. 432 kubectl get svc,pods -n newnginx
  433. 433 kubectl get svc,pods -n other
  434. 434 kubectl exec -it testpod -- cat /etc/resolv.conf
  435. 435 kubectl get pods,services -n kube-system
  436. 436 kubectl exec -it testpod -- nslookupo nginxsvc
  437. 437 kubectl exec -it testpod -- nslookup nginxsvc
  438. 438 kubectl exec -it testpod -- nslookup newnginx
  439. 439 kubectl exec -it testpod -- nslookup newnginx.other.svc.cluster.local
  440. 440 vim nwpolicy-complete-example.yaml
  441. 441 kubectl apply -f nwpolicy-complete-example.yaml
  442. 442 kubectl expose pod nginx --port=80
  443. 443 kubectl get svc
  444. 444 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  445. 445 kubectl label pod busybox access=true
  446. 446 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  447. 447 minikube addons list
  448. 448 minikube addons enable ingress
  449. 449 kubectl get ns
  450. 450 kubectl get all -n ingress-nginx
  451. 451 kubectl get all --selector app=nginxsvc
  452. 452 kubectl describe svc nginxsvc
  453. 453 curl $(minikube ip):30343
  454. 454 kubectl create ingress -h | less
  455. 455 kubectl create ingress nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080"
  456. 456 kubectl get svc
  457. 457 sudo vim /etc/hosts
  458. 458 kubectl get ing
  459. 459 kubectl describe ing
  460. 460 curl nginxsvc.info
  461. 461 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  462. 462 kubectl expose deploy newdep --port=8080
  463. 463 curl nginxsvc.info/hello
  464. 464 kubectl edit svc nginxsvc
  465. 465 curl nginxsvc.info
  466. 466 kubectl describe ingress
  467. 467 kubectl get endpoints
  468. 468 kubectl edit svc nginxsvc
  469. 469 curl nginxsvc.info
  470. 470 kubectl explain pod.spec.volumes | less
  471. 471 vim morevolumes.yaml
  472. 472 kubectl apply -f morevolumes.yaml
  473. 473 kubectl get pods morevol2
  474. 474 kubectl describe pod morevol2 | less
  475. 475 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  476. 476 kubectl exec -it morevol2 -c centos2 -- ls -l /centos2
  477. 477 kubectl explain deploy.spec.template
  478. 478 kubectl explain deploy.spec.template.spec
  479. 479 vim redis.yaml
  480. 480 vim pv.yaml
  481. 481 kubectl apply -f pv.yaml
  482. 482 kubectl get pv
  483. 483 vim pvc.yaml
  484. 484 kubectl apply -f pvc.yaml
  485. 485 kubectl get pvc,pv
  486. 486 kubectl get storageclass
  487. 487 vim pvc-pod.yaml
  488. 488 kubectl apply -f pvc-pod.yaml
  489. 489 kubectl get pvc,pv
  490. 490 kubectl describe pv pvc-f057cd0e-d103-44d1-91bc-9a514f0c7daf
  491. 491 kubectl exec nginx-pvc-pod -- touch /usr/share/nginx/html/testfile
  492. 492 minikube ssh
  493. 493 ls *pv*
  494. 494 vim pv-pvc-pod.yaml
  495. 495 kubectl apply -f pv-pvc-pod.yaml
  496. 496 kubectl get pvc,pv
  497. 497 vim pv-pvc-pod.yaml
  498. 498 history
  499. 499 kubectl create deploy mydb --image=mariadb
  500. 500 kubectl set env deploy mydb MARIADB_ROOT_PASSWORD=password
  501. 501 kubectl get deploy mydb -o yaml | less
  502. 502 vim varsfile
  503. 503 kubectl create cm mydbvars --from-env-file=varsfile
  504. 504 kubectl create cm mynewdbvars --from-env-file=varsfile
  505. 505 kubectl get cm mydbvars -o yaml
  506. 506 kubectl create deploy mynewdb --image=mariadb --replicas=3
  507. 507 kubectl get all --selector app=mynewdb
  508. 508 kubectl set env -h | less
  509. 509 kubectl set env deploy mynewdb --from=configmap/mynewdbvars
  510. 510 kubectl get all --selector app=mynewdb
  511. 511 kubectl get deploy mynewdb -o yaml | less
  512. 512 echo hello world > index.html
  513. 513 kubectl create cm myindex --from-file=index.html
  514. 514 kubectl describe cm myindex
  515. 515 kubectl create deploy myweb --image=nginx
  516. 516 kubectl edit deploy myweb
  517. 517 history
  518. 518 kubectl create secret -h
  519. 519 kubectl create secret generic -h
  520. 520 kubectl get deploy
  521. 521 kubectl delete deploy --all
  522. 522 kubectl create secret generic dbpw --from-literal=ROOT_PASSWORD=password
  523. 523 kubectl describe secret dbpw
  524. 524 kubectl get secret dbpw -o yaml
  525. 525 echo cGFzc3dvcmQ= | base64 -d
  526. 526 kubectl create deploy mynewdb --image=mariadb
  527. 527 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MYSQL_
  528. 528 kubectl get deploy mynewdb -o yaml | less
  529. 529 kubectl exec -it mynewdb-5b5d4b75b-hjntq -- echo $MYSQL_ROOT_PASSWORD
  530. 530 kubectl exec -it mynewdb-5b5d4b75b-hjntq -- /bin/bash
  531. 531 kubectl create secret generic -h | less
  532. 532 cd ~/Downloads/
  533. 533 ls
  534. 534 tar xvf helm-v3.12.3-linux-amd64.tar.gz
  535. 535 sudo mv linux-amd64/helm /usr/local/bin/
  536. 536 helm version
  537. 537 helm repo add bitnami https://charts.bitnami.com/bitnami
  538. 538 helm repo list
  539. 539 helm search repo bitnami
  540. 540 helm search repo file
  541. 541 helm search repo nginx --versions
  542. 542 helm install bitnami/mysql --generate-name
  543. 543 kubectl get all
  544. 544 helm show chart bitnami/mysql
  545. 545 helm show all bitnami/mysql
  546. 546 helm list
  547. 547 helm status mysql-1694095585
  548. 548 history
  549. 549 helm repo list
  550. 550 helm show values bitnami/nginx
  551. 551 helm show values bitnami/nginx | grep commonLabels
  552. 552 helm show values bitnami/nginx | grep replicaCount
  553. 553 vim values.yaml
  554. 554 helm install bitnaminginx --generate-name --values values.yaml
  555. 555 helm install bitnami/nginx --generate-name --values values.yaml
  556. 556 helm list
  557. 557 kubectl get all --show-labels
  558. 558 kubectl get ns
  559. 559 minikube dashboard -h
  560. 560 kubectl delete all --all -n kubernetes-dashboard
  561. 561 helm repo add k8s-dashboard https://kubernetes.github.io/dashboard
  562. 562 helm install my-kubernetes-dashboard k8s-dashboard/kubernetes-dashboard --version 7.0.0-alpha1
  563. 563 kubectl get deploy
  564. 564 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  565. 565 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  566. 566 kubectl get deploy blue-nginx -o yaml > green-nginx.yaml
  567. 567 vim green-nginx.yaml
  568. 568 kubectl apply -f green-nginx.yaml
  569. 569 kubectl get pods
  570. 570 kubectl delete svc bgnginx; kubectl expose deploy green-nginx --port=80 --name=bgnginx
  571. 571 kubectl scale deployment blue-nginx --replicas=0
  572. 572 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > oldnginx.yaml
  573. 573 vim oldnginx.yaml
  574. 574 kubectl apply -f oldnginx.yaml
  575. 575 kubectl get all --show-labels
  576. 576 kubectl delete deploy --all
  577. 577 kubectl apply -f oldnginx.yaml
  578. 578 kubectl get all --show-labels
  579. 579 kubectl delete svc --all
  580. 580 kubectl get all
  581. 581 kubectl apply -f oldnginx.yaml
  582. 582 kubectl get all --show-labels
  583. 583 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  584. 584 kubectl get all --selector type=canary
  585. 585 minikube ssh
  586. 586 kubectl cp old-nginx-9c486b8c5-snf7f:/usr/share/nginx/html/index.html index.html
  587. 587 vim index.html
  588. 588 kubectl create cm canary --from-file=index.html
  589. 589 cd ../ckad
  590. 590 vim canary.yaml
  591. 591 kubectl get endpoints
  592. 592 kubectl apply -f canary.yaml
  593. 593 kubectl get endpoints
  594. 594 minikube ssh
  595. 595 kubectl get deploy
  596. 596 kubectl scale deployment new-nginx --replicas 3
  597. 597 kubectl scale deployment old-nginx --replicas 0
  598. 598 history
  599. 599 kubectl api-resources | less
  600. 600 vim crd-object.yaml
  601. 601 kubectl apply -f crd-object.yaml
  602. 602 kubectl api-resources
  603. 603 kubectl api-resources | less
  604. 604 vim crd-backup.yaml
  605. 605 kubectl apply -f crd-backup.yaml
  606. 606 kubectl get all
  607. 607 kubectl get backup
  608. 608 kubectl api-resources | less
  609. 609 kubectl get pods -n kube-system
  610. 610 kubectl get pods -n kube-system calico-node-mbts8 -o yaml | less
  611. 611 kubectl get sa -n kube-system calico-node -o yaml
  612. 612 kubectl get sa -n kube-system calico-kube-controllers
  613. 613 kubectl get sa -n kube-system calico-kube-controllers -o yaml
  614. 614 kubectl get clusterroles
  615. 615 kubectl get clusterrole view -o yaml | less
  616. 616 kubectl get clusterrolebindings.rbac.authorization.k8s.io
  617. 617 kubectl get clusterrolebindings.rbac.authorization.k8s.io | wc
  618. 618 kubectl get clusterrolebindings.rbac.authorization.k8s.io | grep calico
  619. 619 kubectl get clusterrolebindings.rbac.authorization.k8s.io calico-node -o yaml | less
  620. 620 kubectl edit -n kube-system daemonsets.apps calico-node
  621. 621 kubectl get all -n kube-system
  622. 622 kubectl get -n kube-system pod calico-node-qhwsx -o yaml | less
  623. 623 kubectl describe -n kube-system pod calico-node-qhwsx
  624. 624 kubectl describe -n kube-system pod calico-node-qhwsx | grep serviceA
  625. 625 kubectl get -n kube-system pod calico-node-qhwsx -o yaml | less
  626. 626 kubectl get sa -n kube-system
  627. 627 kubectl edit -n kube-system daemonset calico-node
  628. 628 history
  629.  
Add Comment
Please, Sign In to add comment