sandervanvugt

CKAD june22 all3days

Jun 2nd, 2022
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.08 KB | None | 0 0
  1. student@student-virtual-machine:~/ckad$ history
  2. 1 minikube start --vm-driver=docker
  3. 2 kubectl get all
  4. 3 free -m
  5. 4 df -h
  6. 5 lscpu
  7. 6 history
  8. 7 ls
  9. 8 minikube ssh
  10. 9 kubectl get all
  11. 10 minikube dashboard
  12. 11 kubectl get all
  13. 12 kubectl create deploy firstginx --image=nginx --replicas=3
  14. 13 kubectl create deploy cmdginx --image=nginx --replicas=3
  15. 14 kubectl get all
  16. 15 kubectl delete deploy cmdginx
  17. 16 kubectl get all
  18. 17 history
  19. 18 minikube --help | less
  20. 19 ./countdown 13
  21. 20 kubectl explain pod
  22. 21 kubectl explain pod.spec | less
  23. 22 kubectl explain pod.spec.container | less
  24. 23 kubectl explain pod.spec.containers | less
  25. 24 kubectl --help | less
  26. 25 kubectl completion --help | less
  27. 26 source <(kubectl completion bash)
  28. 27 kubectl completion --help | less
  29. 28 less ~/.kube/config
  30. 29 kubectl config view
  31. 30 kubectl get all
  32. 31 kubectl delete pod firstginx-58f758f4d9-9hnd4
  33. 32 kubectl get all
  34. 33 kubectl run --help | less
  35. 34 kubectl run hazelcast --image=hazelcast/hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
  36. 35 kubectl get all
  37. 36 kubectl run --help
  38. 37 kubectl run --help | less
  39. 38 kubectl get all
  40. 39 kubectl delete pod hazelcast
  41. 40 kubectl get all
  42. 41 kubectl get pods
  43. 42 kubectl get pods firstginx-58f758f4d9-6zm4d -o yaml
  44. 43 kubectl describe pods firstginx-58f758f4d9-6zm4d
  45. 44 kubectl describe pods firstginx-58f758f4d9-6zm4d | less
  46. 45 history
  47. 46 kubectl get all
  48. 47 ./countdown 12
  49. 48 history
  50. 49 ls
  51. 50 vim mypod.yaml
  52. 51 sudo apt install vim
  53. 52 vim mypod.yaml
  54. 53 kubectl api-resources | less
  55. 54 vim mypod.yaml
  56. 55 kubectl api-resources | less
  57. 56 vim mypod.yaml
  58. 57 kubectl explain pod.spec | less
  59. 58 vim mypod.yaml
  60. 59 kubectl get pods firstginx-58f758f4d9-6zm4d -o yaml | less
  61. 60 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  62. 61 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  63. 62 vim mynginx.yaml
  64. 63 kubectl create -f mynginx.yaml
  65. 64 kubectl get pods
  66. 65 kubectl delete -f mynginx.yaml
  67. 66 kubectl apply -f mynginx.yaml
  68. 67 kubectl get pods mynginx -o yaml
  69. 68 kubectl get pods mynginx -o yaml | less
  70. 69 vim mynginx.yaml
  71. 70 kubectl apply -f mynginx.yaml
  72. 71 kubectl get pods
  73. 72 vim sidecar.yaml
  74. 73 kubectl create -f sidecar.yaml
  75. 74 kubectl get pods
  76. 75 kubectl describe pod sidecar-pod | less
  77. 76 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  78. 77 vim sidecar.yaml
  79. 78 ls
  80. 79 history
  81. 80 vim init-example1.yaml
  82. 81 kubectl create -f init-example1.yaml ; kubectl get pods
  83. 82 kubectl get pods
  84. 83 vim init-example2.yaml
  85. 84 kubectl create -f init-example2.yaml
  86. 85 kubectl get pods
  87. 86 cp init-example2.yaml multicontainer.yaml
  88. 87 vim multicontainer.yaml
  89. 88 ./countdown 12
  90. 89 history
  91. 90 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  92. 91 kubectl exec -it sidecar-pod -c sidecar /bin/bash
  93. 92 kubectl get pods
  94. 93 kubectl get pods -A
  95. 94 kubectl get ns
  96. 95 kubectl get pods -A
  97. 96 kubectl get all -A
  98. 97 kubectl create ns secret
  99. 98 kubectl get ns
  100. 99 vim busybox-ns.yaml
  101. 100 kubectl create -f busybox-ns.yaml
  102. 101 kubectl get pods
  103. 102 vim busybox-ns.yaml
  104. 103 kubectl explain pod.metadata
  105. 104 kubectl create -f busybox-ns.yaml
  106. 105 kubectl get pods
  107. 106 kubectl get pods -A
  108. 107 kubectl get pods -n secret
  109. 108 kubectl run secretginx --image=nginx -n secret
  110. 109 kubectl run nginxlab --image=nginx
  111. 110 k
  112. 111 kubectl run mydb --image=mariadb
  113. 112 kubectl get pods
  114. 113 kubectl describe pod mydb | less
  115. 114 kubectl logs mydb
  116. 115 kubectl run mydb --image=mariadb --env MARIADB_ROOT_PASSWORD
  117. 116 kubectl run --help | less
  118. 117 kubectl run mydb --image=mariadb --env="MARIADB_ROOT_PASSWORD=password"
  119. 118 kubectl delete pod mydb
  120. 119 kubectl run mydb --image=mariadb --env="MARIADB_ROOT_PASSWORD=password"
  121. 120 kubectl get pods
  122. 121 history
  123. 122 kubectl get all
  124. 123 kubectl exec -it firstginx-58f758f4d9-6zm4d -- /bin/bash
  125. 124 kubectl exec -it busybox3 -- sh
  126. 125 kubectl describe pod nginxlab | less
  127. 126 history
  128. 127 kubectl apply --filename https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml
  129. 128 vim hello-world.yaml
  130. 129 kubectl apply -f hello-world.yaml
  131. 130 vim hello-world-run.yaml
  132. 131 kubectl apply -f hello-world-run.yaml
  133. 132 kubectl get taskrun
  134. 133 kubectl get pods
  135. 134 kubectl explain --recursive pod.spec
  136. 135 kubectl explain --recursive pod.spec | wc
  137. 136 kubectl explain --recursive pod.spec | grep -i -A 10 securitycontext | less
  138. 137 kubectl explain --recursive pod.spec.securityContext
  139. 138 kubectl explain --recursive pod.spec.securityContext.runAsUser
  140. 139 vim securitycontextdemo2.yaml
  141. 140 kubectl apply -f securitycontextdemo2.yaml
  142. 141 kubectl get pods
  143. 142 kubectl delete sidecar-pod
  144. 143 kubectl delete pod sidecar-pod
  145. 144 kubectl get pods
  146. 145 kubectl exec -it security-context-demo -- sh
  147. 146 vim securitycontextdemo2.yaml
  148. 147 vim securitycontextdemo.yaml
  149. 148 kubectl create -f securitycontextdemo.yaml
  150. 149 kubectl get pods
  151. 150 kubectl get pods nginxsecure -o yaml | less
  152. 151 kubectl describe pods nginxsecure
  153. 152 kubectl get pods
  154. 153 for i in busybox3 mydb mynginx mynginx2 nginxlab nginxsecure; do kubectl delete pod $i; done
  155. 154 kubectl create -h
  156. 155 kubectl create -h | less
  157. 156 kubectl create job -h | less
  158. 157 kubectl create job onejob --image=busybox -- date
  159. 158 kubectl get jobs,pod
  160. 159 kubectl create job falsejob --image=busybox -- false
  161. 160 kubectl get jobs,pod
  162. 161 kubectl get jobs onejob -o yaml | grep restartPolicy
  163. 162 kubectl get jobs,pod
  164. 163 kubectl delete job falsejob
  165. 164 kubectl create job falsejob --image=busybox -- false
  166. 165 kubectl logs falsejob-55qhh
  167. 166 kubectl get jobs
  168. 167 kubectl delete job falsejob
  169. 168 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > mynewjob.yaml
  170. 169 kubectl create job --help | less
  171. 170 vim mynewjob.yaml
  172. 171 kubectl explain job.spec | less
  173. 172 vim mynewjob.yaml
  174. 173 kubectl create -f mynewjob.yaml
  175. 174 kubectl get jobs,pod
  176. 175 kubectl create cronjob --schedule="*/3 * * * 1-5" --image=busybox -- echo greetings from your cluster
  177. 176 kubectl create cronjob runme --schedule="*/3 * * * 1-5" --image=busybox -- echo greetings from your cluster
  178. 177 kubectl get cronjob,job,pod
  179. 178 date
  180. 179 kubectl get cronjob,job,pod
  181. 180 kubectl logs onejob-ddxfb
  182. 181 kubectl delete cronjobs.batch runme
  183. 182 vim frontend-resources.yaml
  184. 183 kubectl create -f frontend-resources.yaml
  185. 184 vim frontend-resources.yaml
  186. 185 kubectl create -f frontend-resources.yaml
  187. 186 kubectl get pods
  188. 187 kubectl delete pod security-context-demo
  189. 188 kubectl get pods
  190. 189 kubectl describe pod frontend
  191. 190 kubectl get pods
  192. 191 minikube ssh
  193. 192 kubectl delete pod frontend
  194. 193 vim frontend-resources.yaml
  195. 194 kubectl create -f frontend-resources.yaml
  196. 195 kubectl get pods
  197. 196 kubectl describe pod frontend
  198. 197 kubectl delete pod frontend
  199. 198 vim frontend-resources.yaml
  200. 199 kubectl create -f frontend-resources.yaml
  201. 200 kubectl get all
  202. 201 kubectl describe pod frontend
  203. 202 kubectl delete -f frontend-resources.yaml
  204. 203 vim frontend-resources.yaml
  205. 204 kubectl explain pod.spec | less
  206. 205 ./countdown 13
  207. 206 kubectl create deploy -h | less
  208. 207 kubectl create deployment myweb --image=nginx --replicas=3
  209. 208 kubectl get all
  210. 209 kubectl describe deployments.apps myweb | less
  211. 210 kubectl get all --selector app=myweb
  212. 211 kubectl delete pod myweb-8764bf4c8-jn4xf
  213. 212 kubectl get pods
  214. 213 vim redis-deploy.yaml
  215. 214 kubectl create -f redis-deploy.yaml
  216. 215 kubectl api-versions
  217. 216 kubectl api-resources | less
  218. 217 vim redis-deploy.yaml
  219. 218 kubectl create -f redis-deploy.yaml
  220. 219 kubectl get all
  221. 220 kubectl edit deployments.apps redis
  222. 221 kubectl get all
  223. 222 kubectl delete rs redis-696dfdfbfc
  224. 223 kubectl get all
  225. 224 kubectl create deploy nginx-lab7 --image=nginx --replicsa=3
  226. 225 kubectl create deploy nginx-lab7 --image=nginx --replicas=3
  227. 226 kubectl get all --selector app=nginx-lab7
  228. 227 kubectl delete deploy nginx-lab7
  229. 228 kubectl delete deployments.apps redis
  230. 229 history | grep source
  231. 230 kubectl create deploy nginxup --image=nginx:1.14
  232. 231 kubectl get deploy -o yaml | less
  233. 232 kubectl get deploy nginxup -o yaml | less
  234. 233 kubectl scale deployment nginxup --replicas=5
  235. 234 kubectl get all --selector app=nginxup
  236. 235 kubectl set image deploy nginxup nginx=nginx:1.17
  237. 236 kubectl get all --selector app=nginxup
  238. 237 kubectl set -h | less
  239. 238 kubectl create deploy bluelabel --image=nginx
  240. 239 kubectl get all --show-labels --selector app=bluelabel
  241. 240 kubectl label deployments.apps bluelabel state=demo
  242. 241 kubectl get all --show-labels --selector app=bluelabel
  243. 242 kubectl get all --show-labels --selector state=demo
  244. 243 kubectl describe deployments.apps bluelabel
  245. 244 kubectl describe pod bluelabel-5996d849cb-5mjgc
  246. 245 kubectl get all --show-labels --selector app=bluelabel
  247. 246 kubectl scale deployment bluelabel --replicas=3
  248. 247 kubectl label pod bluelabel-5996d849cb-l5dgc app-
  249. 248 kubectl get pods --show-label | grep blue
  250. 249 kubectl get pods --show-labels | grep blue
  251. 250 kubectl delete deploy bluelabel
  252. 251 kubectl get pods --show-labels | grep blue
  253. 252 ./countdown 13
  254. 253 vim sleepy.yaml
  255. 254 kubectl create job --help
  256. 255 kubectl create job --help | less
  257. 256 kubectl create job my-job --image=busybox -- sleep 30 --dry-run=client -o yaml > lab9.yaml
  258. 257 vim lab9.yaml
  259. 258 kubectl create job my-job --image=busybox --dry-run=client -o yaml -- sleep 30 > lab9.yaml
  260. 259 vim lab9.yaml
  261. 260 kubectl explain job.spec | less
  262. 261 vim lab9.yaml
  263. 262 kubectl create -f lab9.yaml
  264. 263 kubectl delete job my-job
  265. 264 kubectl create -f lab9.yaml
  266. 265 kubectl get jobs,pod
  267. 266 vim lab9.yaml
  268. 267 history | grep bluela
  269. 268 kubectl create deploy bluelabel --image=nginx
  270. 269 kubectl get deploy bluelabel -o yaml
  271. 270 kubectl scale deployment bluelabel --replicas=4
  272. 271 kubectl get all --selector app=bluelabel
  273. 272 kubectl set env deploy bluelabel type=blended
  274. 273 kubectl get all --selector app=bluelabel
  275. 274 vim rolling.yaml
  276. 275 kubectl create -f rolling.yaml
  277. 276 kubectl rollout history deployment
  278. 277 kubectl edit deployments.apps rolling-nginx
  279. 278 kubectl rollout history deployment
  280. 279 kubectl describe deployments.apps rolling-nginx
  281. 280 kubectl rollout history deployment rolling-nginx --revision=2
  282. 281 kubectl rollout history deployment rolling-nginx --revision=1
  283. 282 kubectl rollout undo deployment rolling-nginx --to-revision=1
  284. 283 kubectl get all --selector app=rolling-nginx
  285. 284 kubectl get all
  286. 285 kubectl get deployments.apps rolling-nginx -o yaml | less
  287. 286 ./countdown 14
  288. 287 kubectl create deployment nginxsvc --image=nginx
  289. 288 kubectl scale deployment nginxsvc --replicas=3
  290. 289 kubectl expose deployment nginxsvc
  291. 290 kubectl expose deployment nginxsvc --port=80
  292. 291 kubectl get svc
  293. 292 kubectl describe svc nginxsvc
  294. 293 kubectl edit svc nginxsvc
  295. 294 kubectl get pods -o wide --selector app=nginxsvc
  296. 295 kubectl get endpoints
  297. 296 kubectl get svc
  298. 297 curl 10.102.80.104
  299. 298 minikube ssh
  300. 299 kubectl edit svc nginxsvc
  301. 300 kubectl get svc
  302. 301 minikube ip
  303. 302 curl 192.168.49.2
  304. 303 curl 192.168.49.2:32131
  305. 304 kubectl edit svc nginxsvc
  306. 305 kubectl get svc
  307. 306 curl 192.168.49.2:32000
  308. 307 kubectl run testpod --image=busybox -- sleep 3600
  309. 308 kubectl get svc
  310. 309 kubectl get svc,pods -n kube-system
  311. 310 kubectl exec -it testpod -- cat /etc/resolv.conf
  312. 311 kubectl exec -it testpod -- nslookup nginxsvc
  313. 312 history
  314. 313 vim goodbye-world.yaml
  315. 314 kubectl apply --filename goodbye-world.yaml~
  316. 315 kubectl apply --filename goodbye-world.yaml
  317. 316 vim hello-goodbye-pipeline.yaml
  318. 317 kubectl apply --filename hello-goodbye-pipeline.yaml
  319. 318 vim hello-goodbye-pipeline-run.yaml
  320. 319 kubectl apply --filename hello-goodbye-pipeline-run.yaml
  321. 320 tkn pipelinerun logs hello-goodbye-run -f -n default
  322. 321 sudo apt update;sudo apt install -y gnupg
  323. 322 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3EFE0E0A2F2F60AA
  324. 323 echo "deb http://ppa.launchpad.net/tektoncd/cli/ubuntu eoan main"|sudo tee /etc/apt/sources.list.d/tektoncd-ubuntu-cli.list
  325. 324 sudo apt update && sudo apt install -y tektoncd-cli
  326. 325 tkn pipelinerun logs hello-goodbye-run -f -n default
  327. 326 kubectl get ns
  328. 327 minikube --help
  329. 328 minikube addons list
  330. 329 minikube addons enable ingress
  331. 330 kubectl get ns
  332. 331 kubectl get all -n ingress-nginx
  333. 332 kubectl get deploy
  334. 333 kubectl get svc nginxsvc
  335. 334 curl http://$(minikube ip):32000
  336. 335 kubectl create ingress --help | less
  337. 336 kubectl create ingress nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080"
  338. 337 kubectl describe ingress nginxsvc-ingress
  339. 338 sudo vim /etc/hosts
  340. 339 kubectl get ingress
  341. 340 curl nginxsvc.info
  342. 341 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  343. 342 kubectl expose deploy newdep --port=8080
  344. 343 kubectl describe ingress nginxsvc-ingress
  345. 344 curl nginxsvc.info/hello
  346. 345 kubectl get svc
  347. 346 kubectl explain pod.spec.volumes | less
  348. 347 cat morevolumes.yaml
  349. 348 kubectl create -f morevolumes.yaml
  350. 349 kubectl get pods morevol2
  351. 350 kubectl describe pods morevol2 | less
  352. 351 kubectl exec -it morevol2 -c centos1 -- touch /centos/test
  353. 352 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  354. 353 kubectl exec -it morevol2 -c centos2 -- ls -l /centos2
  355. 354 cat pv.yaml
  356. 355 kubectl create -f pv.yaml
  357. 356 kubectl get pv
  358. 357 cat pvc.yaml
  359. 358 kubectl create -f pvc.yaml
  360. 359 kubectl get pvc,pv
  361. 360 kubectl get storageclass
  362. 361 kubectl describe pvc pv-claim
  363. 362 kubectl describe pv pvc-4a0bbd75-4f01-4b95-909c-0a6a61e0e568
  364. 363 cat pvc-pod.yaml
  365. 364 kubectl create -f pvc-pod.yaml
  366. 365 cat pvc-pod.yaml
  367. 366 kubectl get pv,pvc
  368. 367 kubectl describe pv pvc-1cfb388b-460f-4036-b2b0-cbdd93f187ac
  369. 368 kubectl exec nginx-pvc-pod -- touch /usr/share/nginx/html/testfile
  370. 369 minikube ssh
  371. 370 kubectl get pv,storageclass
  372. 371 history
  373. 372 sleep 60; ./countdown 12
  374. 373 kubectl create deploy mydb --image=mariadb
  375. 374 kubectl get pods
  376. 375 kubectl describe pod mydb-fb7ff4d78-2lqdp
  377. 376 kubectl logs mydb-fb7ff4d78-2lqdp
  378. 377 kubectl set env deploy mydb MYSQL_ROOT_PASSWORD=password; kubectl get all --selector app=mydb
  379. 378 kubectl get all --selector app=mydb
  380. 379 kubectl get deploy mydb -o yaml > mydb.yaml
  381. 380 vim mydb.yaml
  382. 381 vim varsfile
  383. 382 kubectl create cm mydbvars --from-env-file=varsfile
  384. 383 kubectl describe cm mydbvars
  385. 384 kubectl create deploy mydb2 --image=mariadb --replicas=3
  386. 385 kubectl get all --selector app=mydb2
  387. 386 kubectl set env deploy mydb2 --from=configmap/mydbvars
  388. 387 kubectl get all --selector app=mydb2
  389. 388 kubectl get deployments.apps mydb -o yaml
  390. 389 kubectl get deployments.apps mydb2 -o yaml
  391. 390 history
  392. 391 echo hello world > index.html
  393. 392 kubectl create cm myindex --from-file=index.html
  394. 393 kubect get cm
  395. 394 kubectl get cm
  396. 395 kubectl get cm myindex -o yaml
  397. 396 kubectl create deploy myweb --image=nginx
  398. 397 kubectl get deploy
  399. 398 for i in rolling-nginx nginxup newdep myweb mydb mydb2; do kubectl delete deploy $i; done
  400. 399 kubectl create deploy myweb --image=nginx
  401. 400 kubectl edit deployments.apps myweb
  402. 401 kubectl get deploy --selector app=,yweb
  403. 402 kubectl get deploy --selector app=myweb
  404. 403 kubectl get all --selector app=myweb
  405. 404 kubectl exec -it myweb-6f46676d95-l2lv6 -- cat /usr/share/nginx/html/index.html
  406. 405 kubectl exec -it myweb-6f46676d95-l2lv6 -- ls -l /usr/share/nginx/html/
  407. 406 history
  408. 407 kubectl edit deployments.apps myweb
  409. 408 kubectl exec -it myweb-6f46676d95-l2lv6 -- ls -l /usr/share/nginx/html/
  410. 409 kubectl exec -it myweb-ff8bf9988-4rr8v -- cat /usr/share/nginx/html/index.html
  411. 410 kubectl create secret generic dbpwd --from-literal=ROOT_PASSWORD=password
  412. 411 kubectl describe secrets dbpwd
  413. 412 kubectl get secrets dbpwd -o yaml
  414. 413 echo cGFzc3dvcmQ= | base64 -d
  415. 414 kubectl create deployment mynewdb --image=mariadb
  416. 415 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MARIADB_
  417. 416 kubectl set env deploy mynewdb --from=secret/dbpwd --prefix=MARIADB_
  418. 417 kubectl get pods
  419. 418 history
  420. 419 ./countdown 13
  421. 420 kubectl api-resources | less
  422. 421 cat ~/.kube/config
  423. 422 kubectl proxy --port=8001 &
  424. 423 kubectl create deploy curlginx --image=nginx --replicas=3
  425. 424 curl http://localhost:8001/version
  426. 425 curl http://localhost:8001/api/
  427. 426 curl http://localhost:8001/api/v1/
  428. 427 curl http://localhost:8001/api/v1/namespaces/default/pods
  429. 428 kubectl get pods
  430. 429 curl http://localhost:8001/api/v1/namespaces/default/pods/curlginx-c6f4b6874-h5tdv
  431. 430 curl -XDELETE http://localhost:8001/api/v1/namespaces/default/pods/curlginx-c6f4b6874-h5tdv
  432. 431 kubectl get pods
  433. 432 kubectl auth can-i get pods
  434. 433 kubectl auth can-i get pods --as bob@example.com
  435. 434 vim mypod.yaml
  436. 435 kubectl apply -f mypod.yaml
  437. 436 kubectl get pods mypod -o yaml | less
  438. 437 kubectl exec -it mypod -- sh
  439. 438 cat mysa.yaml
  440. 439 kubectl apply -f mysa
  441. 440 kubectl apply -f mysa.yaml
  442. 441 vim list-pods.yaml
  443. 442 kubectl apply -f list-pods.yaml
  444. 443 cat list-pods-mysa-binding.yaml
  445. 444 kubectl apply -f mysapod.yaml
  446. 445 kubectl exec -it mypod -- sh
  447. 446 cat mysapod.yaml
  448. 447 kubectl create -f mysapod.yaml
  449. 448 kubectl delete pod mysapod
  450. 449 kubectl create -f mysapod.yaml
  451. 450 kubectl get pod mysapod -o yaml
  452. 451 kubectl exec -it mysapod -- sh
  453. 452 kubectl config view
  454. 453 kubectl get sa
  455. 454 kubectl get rolebindings.rbac.authorization.k8s.io
  456. 455 kubectl apply -f list-pods-mysa-binding.yaml
  457. 456 kubectl get rolebindings.rbac.authorization.k8s.io
  458. 457 kubectl exec -it mysapod -- sh
  459. 458 kubectl get rolebindings.rbac.authorization.k8s.io
  460. 459 cd ../Downloads/
  461. 460 ls
  462. 461 tar xvf helm-v3.9.0-linux-amd64.tar.gz
  463. 462 sudo mv linux-amd64/helm /usr/local/bin/
  464. 463 helm version
  465. 464 helm repo add bitnami https://charts.bitnami.com/bitnami
  466. 465 helm repo list
  467. 466 helm search repo bitnami
  468. 467 helm repo update
  469. 468 helm install bitnami/mysql --generate-name
  470. 469 kubectl get all
  471. 470 helm show chart bitnami/mysql
  472. 471 helm show all bitnami/mysql
  473. 472 helm list
  474. 473 helm status mysql-1654183483
  475. 474 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  476. 475 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  477. 476 kubectl get svc
  478. 477 kubectl get deploy blue-nginx -o yaml > green-nginx.yaml
  479. 478 vim green-nginx.yaml
  480. 479 kubectl create -f green-nginx.yaml
  481. 480 kubectl get deploy
  482. 481 for i in nginxsvc myweb mynewdb firstginx curlginx bluelabel; do kubectl delete deploy $i; done
  483. 482 kubectl get all
  484. 483 kubectl describe svc bgnginx
  485. 484 kubectl delete svc bgnginx; kubectl expose deploy green-nginx --port=80 --name=bgnginx
  486. 485 kubectl describe svc bgnginx
  487. 486 kubectl delete deploy blue-nginx
  488. 487 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > ~/oldnginx.yaml
  489. 488 vim ~/oldnginx.yaml
  490. 489 kubectl create -f ~/oldnginx.yaml
  491. 490 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  492. 491 kubectl describe svc oldnginx
  493. 492 minikube ssh
  494. 493 kubectl cp old-nginx-66bd7bb796-zffnm:/usr/share/nginx/html/index.html blah.html
  495. 494 vim index.html
  496. 495 kubectl create cm canaray --from-file=index.html
  497. 496 kubectl create cm canary --from-file=index.html
  498. 497 kubectl describe cm canary
  499. 498 cd ../ckad/
  500. 499 vim canary.yaml
  501. 500 kubectl create -f canary.yaml
  502. 501 kubectl describe svc oldnginx
  503. 502 minikube ssh
  504. 503 kubectl get deploy
  505. 504 kubectl scale deployment new-nginx --replicas 3
  506. 505 kubectl get deploy
  507. 506 kubectl scale deployment old-nginx --replicas 0
  508. 507 kubectl get deploy
  509. 508 vim busybox-ready.yaml
  510. 509 kubectl create -f busybox-ready.yaml
  511. 510 kubectl get pods
  512. 511 kubectl describe pod busybox-ready
  513. 512 kubectl edit pods busybox-ready
  514. 513 kubectl exec -it busybox-ready -- touch /tmp/nothing
  515. 514 kubectl get pods
  516. 515 history
  517.  
Add Comment
Please, Sign In to add comment