sandervanvugt

CKAD day 3 august 22

Aug 24th, 2022
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.83 KB | None | 0 0
  1. student@student-virtual-machine:~$ history
  2. 1 minikube start --vm-driver=docker
  3. 2 kubectl get all
  4. 3 history
  5. 4 kubectl get all
  6. 5 minikube status
  7. 6 kubectl get all
  8. 7 minikube --help
  9. 8 minikube ssh
  10. 9 minikube dashboard
  11. 10 bg
  12. 11 kubectl get all
  13. 12 ./countdown 15
  14. 13 kubectl get all
  15. 14 kubectl get all -o wide
  16. 15 kubectl --help | less
  17. 16 kubectl completion --help
  18. 17 kubectl completion --help | less
  19. 18 source <(kubectl completion bash)
  20. 19 cd
  21. 20 ls -a
  22. 21 cd .kube/
  23. 22 ls
  24. 23 cat config
  25. 24 pwd
  26. 25 kubectl config view
  27. 26 cd
  28. 27 cd ckad/
  29. 28 ls
  30. 29 cd dockerfile/
  31. 30 ls
  32. 31 vim Dockerfile
  33. 32 docker run -t mymap .
  34. 33 docker build -t mymap .
  35. 34 docker images
  36. 35 cd ..
  37. 36 docker run mymap
  38. 37 docker run -it mymap sh
  39. 38 cd dockerfile/
  40. 39 vim Dockerfile
  41. 40 docker build -t taketwo .
  42. 41 docker run taketwo
  43. 42 docker run -it taketwo sh
  44. 43 minikube ssh
  45. 44 kubectl get pods
  46. 45 kubectl get pods imback-7f9f7d658b-kkjqt -o yaml | less
  47. 46 kubectl get all
  48. 47 kubectl delete pod imback-7f9f7d658b-kkjqt
  49. 48 kubectl get all
  50. 49 kubectl run -h | less
  51. 50 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701
  52. 51 kubectl get pods
  53. 52 kubectl describe pod hazelcast
  54. 53 kubectl get pods
  55. 54 history
  56. 55 kubectl delete pod hazelcast
  57. 56 kubectl get pods
  58. 57 cd ..
  59. 58 ./countdown 12
  60. 59 history
  61. 60 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701
  62. 61 history
  63. 62 kubectl get pods
  64. 63 kubectl get pods hazelcast -o yaml | less
  65. 64 kubectl describe pods hazelcast
  66. 65 kubectl describe pods hazelcast | less
  67. 66 kubectl run mydb --image=mariadb
  68. 67 kubectl get pods
  69. 68 kubectl describe pods mydb
  70. 69 kubectl logs mydb
  71. 70 kubectl get pods
  72. 71 history
  73. 72 kubectl get pods hazelcast -o yaml | less
  74. 73 kubectl explain pod.spec | less
  75. 74 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 --dry-run=client -o yaml
  76. 75 kubectl run hazelcast --image=hazelcast/hazelcast --port=5701 --dry-run=client -o yaml > hazelcast.yam l
  77. 76 vim hazelcast.yam
  78. 77 kubectl explain pods.spec | less
  79. 78 kubectl create deploy sadep --image=nginx --replicas=3 --dry-run=client -o yaml
  80. 79 vim hazelcast.yam
  81. 80 kubectl get pods hazelcast -o yaml | less
  82. 81 kubectl get pods hazelcast -o yaml > hazelnut.yaml
  83. 82 vim hazelnut.yaml
  84. 83 history
  85. 84 ./countdown 1
  86. 85 kubectl run --help | less
  87. 86 kubectl run dryrun --image=nginx --dry-run=server -o yaml
  88. 87 kubectl get pods
  89. 88 kubectl run dryrun --image=nginx --dry-run=server -o yaml
  90. 89 vim sidecar.yaml
  91. 90 kubectl create -f sidecar.yaml
  92. 91 kubectl get pods
  93. 92 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  94. 93 vim morevolumes.yaml
  95. 94 ./countdown 12
  96. 95 vim init-example1.yaml
  97. 96 kubectl create -f init-example1.yaml
  98. 97 kubectl get pods
  99. 98 vim init-example2.yaml
  100. 99 kubectl create -f init-example2.yaml
  101. 100 kubectl get pods
  102. 101 kubectl get ns
  103. 102 kubectl get pods
  104. 103 kubectl get pods -n kube-system,
  105. 104 kubectl get pods -n kube-system
  106. 105 kubectl create namespace mynamespace
  107. 106 kubectl run myhttp --image=httpd -n mynamespace
  108. 107 kubectl get pods
  109. 108 kubectl get pods -n mynamespace
  110. 109 kubectl config set-context --current --namespace=mynamespace
  111. 110 kubectl get pods
  112. 111 kubectl config set-context --current --namespace=default
  113. 112 kubectl get pods
  114. 113 history
  115. 114 kubectl get pods -A
  116. 115 kubectl exec -it hazelcast -- sh
  117. 116 kubectl explain pods.spec.securitycontext
  118. 117 kubectl explain pods.spec | less
  119. 118 kubectl explain pods.spec.securityContext
  120. 119 vim securitycontextdemo2.yaml
  121. 120 kubectl create -f securitycontextdemo2.yaml
  122. 121 kubectl exec -it security-context-demo -- sh
  123. 122 cat securitycontextdemo2.yaml
  124. 123 kubectl apply -f securitycontextdemo.yaml
  125. 124 kubectl get pods
  126. 125 vim securitycontextdemo.yaml
  127. 126 kubectl describe pods nginxsecure
  128. 127 kubectl create job onejob --image=busybox -- date
  129. 128 kubectl get jobs
  130. 129 kubectl get pods
  131. 130 kubectl get jobs onejob -o yaml | less
  132. 131 kubectl delete job onejob
  133. 132 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > mynewjob.yaml
  134. 133 vim mynewjob.yaml
  135. 134 kubectl create -f mynewjob.yaml
  136. 135 kubectl get jobs,pods
  137. 136 history
  138. 137 echo #### NEXT STEPS WERE NOT IN THE CKAD COURSE #######
  139. 138 minikube status
  140. 139 cd
  141. 140 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
  142. 141 kubectl edit deploy -n kube-system metrics-server
  143. 142 kubectl get pods -n kube-system
  144. 143 kubectl top pods
  145. 144 kubectl apply -f https://k8s.io/examples/application/php-apache.yaml
  146. 145 kubectl get all --selector app=php-apache
  147. 146 kubectl get all
  148. 147 kubectl autoscale deploy php-apache --cpu-percent=50 --min=1 --max=10
  149. 148 kubectl get hpa
  150. 149 kubectl get deploy php-apache
  151. 150 kubectl get hpa
  152. 151 kubectl delete pod load-generator
  153. 152 kubectl get hpa
  154. 153 echo ##### START OF CKAD DAY 2 ######
  155. 154 kubectl get jobs,pods
  156. 155 kubectl create cronjob -h | less
  157. 156 kubectl create cronjob runme --image=busybox --schedule="*/2 * * * 1-5" -- echo greetings from the cluster
  158. 157 kubectl get cronjobs,jobs,pods
  159. 158 kubectl create job --from=cronjob
  160. 159 kubectl create job onceonly --from=cronjob
  161. 160 kubectl create job -h | less
  162. 161 kubectl create job onceonly --from=cronjob/runme
  163. 162 kubectl get jobs
  164. 163 history | grep source
  165. 164 kubectl get cronjobs,jobs,pods
  166. 165 kubectl logs runme-27687612-2twcn
  167. 166 kubectl delete cronjob runme
  168. 167 history
  169. 168 cd ckad/
  170. 169 vim frontend-resources.yaml
  171. 170 kubectl apply -f frontend-resources.yaml
  172. 171 kubectl get pods
  173. 172 kubectl describe pod frontend
  174. 173 kubectl get pods
  175. 174 kubectl describe pod frontend
  176. 175 kubectl delete pod frontend
  177. 176 vim frontend-resources.yaml
  178. 177 kubectl apply -f frontend-resources.yaml
  179. 178 kubectl get pods
  180. 179 kubectl delete pod frontend
  181. 180 vim frontend-resources.yaml
  182. 181 kubectl apply -f frontend-resources.yaml
  183. 182 kubectl get pods
  184. 183 kubectl describe pod frontend
  185. 184 kubectl delete -f frontend-resources.yaml
  186. 185 kubectl explain pods.spec.containers.livenessProbe
  187. 186 kubectl explain pods.spec.containers.livenessProbe | less
  188. 187 kubectl explain pods.spec.containers.livenessProbe.httpGet | less
  189. 188 vim busybox-ready.yaml
  190. 189 kubectl create -f busybox-ready.yaml
  191. 190 kubectl get pods
  192. 191 kubectl describe pods busybox-ready
  193. 192 kubectl edit pods busybox-ready
  194. 193 kubectl get pods
  195. 194 kubectl exec -it busybox sh
  196. 195 kubectl exec -it busybox-ready -- sh
  197. 196 kubectl get pods
  198. 197 vim nginx-probes.yaml
  199. 198 kubectl create -f nginx-probes.yaml
  200. 199 kubectl get pods
  201. 200 vim nginx-probes.yaml
  202. 201 kubectl create deploy myweb --image=nginx --replicas=3
  203. 202 kubectl describe deploy myweb
  204. 203 kubectl get all
  205. 204 kubectl delete pod myweb-58d88b7dfb-4s22x
  206. 205 kubectl get all
  207. 206 kubectl run mypod --image=nginx
  208. 207 kubectl get pods
  209. 208 kubectl delete pod mypod
  210. 209 kubectl get pods
  211. 210 kubectl delete pod mydb
  212. 211 kubectl delete pod nginxsecure
  213. 212 kubectl get all
  214. 213 kubectl get all --selector app=myweb
  215. 214 ./countdown 12
  216. 215 vim redis-deploy.yaml
  217. 216 kubectl create -f redis-deploy.yaml
  218. 217 kubectl api-resources | less
  219. 218 vim redis-deploy.yaml
  220. 219 kubectl api-versions
  221. 220 vim redis-deploy.yaml
  222. 221 kubectl create -f redis-deploy.yaml
  223. 222 kubectl edit deployments.apps redis
  224. 223 kubectl get all
  225. 224 kubectl delete rs redis-5f578f9c95
  226. 225 kubectl get all
  227. 226 kubectl scale deployment redis --replicas 1
  228. 227 kubectl scale deployment redis --replicas 0
  229. 228 history
  230. 229 kubectl create deploy nginxup --image=nginx:1.14
  231. 230 kubectl get all --selector app=nginxup
  232. 231 kubectl set image deploy nginxup nginx=nginx:1.17
  233. 232 kubectl get all --selector app=nginxup
  234. 233 kubectl create deploy bluelabel --image=nginx
  235. 234 kubectl label deploy bluelabel state=demo
  236. 235 kubectl get deploy --show-labels
  237. 236 kubectl get all --selector state=demo
  238. 237 kubectl get all --selector app=bluelabel
  239. 238 kubectl describe deployments.apps bluelabel
  240. 239 kubectl describe pod bluelabel-69c96d4874-hnwqk
  241. 240 kubectl describe pod bluelabel-69c96d4874-hnwqk | less
  242. 241 kubectl label pod bluelabel-69c96d4874-hnwqk app-
  243. 242 kubectl get pods
  244. 243 kubectl delete pod bluelabel-69c96d4874-hnwqk
  245. 244 ./countdown 1
  246. 245 kubectl get deploy bluelabel -o yaml | less
  247. 246 kubectl scale deploy bluelabel --replicas 4
  248. 247 kubectl get all --selector app=bluelabel
  249. 248 kubectl set env deploy bluelabel type=blended
  250. 249 kubectl get all --selector app=bluelabel
  251. 250 history
  252. 251 vim rolling.yaml
  253. 252 kubectl apply -f rolling.yaml
  254. 253 kubectl get deploy rolling-nginx -o yaml | less
  255. 254 kubectl rollout history
  256. 255 kubectl rollout history deployment
  257. 256 kubectl edit deployments.apps rolling-nginx
  258. 257 kubectl rollout history deployment rolling-nginx
  259. 258 kubectl describe deployments.apps rolling-nginx
  260. 259 kubectl rollout history deployment rolling-nginx --revision=2
  261. 260 kubectl rollout history deployment rolling-nginx --revision=1
  262. 261 #kubectl rollout undo deployment rolling-nginx --to-revision=1
  263. 262 kubectl set image -h
  264. 263 kubectl set image -h | less
  265. 264 kubectl set image deployment/rolling nginx=nginx:latest
  266. 265 kubectl set image deployment/rolling-nginx nginx=nginx:latest
  267. 266 kubectl rollout history deployment rolling-nginx
  268. 267 kubectl rollout undo deployment rolling-nginx --to-revision=1
  269. 268 kubectl rollout history deployment rolling-nginx
  270. 269 kubectl describe deployments.apps rolling-nginx
  271. 270 ./countdown 13
  272. 271 ./countdown 1
  273. 272 kubectl create deploy nginxsvc --image=nginx
  274. 273 kubectl scale deploy nginxsvc --replicas=3
  275. 274 kubectl get all --selector app=nginxsvc
  276. 275 kubectl expose deploy nginxsvc --port=80
  277. 276 kubectl get all --selector app=nginxsvc
  278. 277 kubectl describe svc nginxsvc
  279. 278 kubectl get svc nginxsvc -o yaml
  280. 279 kubectl get svc
  281. 280 kubectl get endpoints
  282. 281 curl 10.98.205.97
  283. 282 kubectl get svc
  284. 283 minikube ssh
  285. 284 kubectl edit svc nginxsvc
  286. 285 kubectl get svc
  287. 286 minikube ip
  288. 287 curl 192.168.49.2:30558
  289. 288 curl $(minikube ip):30558
  290. 289 history
  291. 290 ./countdown 13
  292. 291 kubectl create service nodeport -h | less
  293. 292 kubectl get deploy
  294. 293 kubectl create svc nodeport bluelabel
  295. 294 kubectl create svc nodeport bluelabel 80
  296. 295 kubectl create svc nodeport -h | less
  297. 296 kubectl create svc nodeport bluelabel --tcp=32000:80
  298. 297 kubectl describe svc nodeport
  299. 298 kubectl describe svc bluelabel
  300. 299 kubectl delete svc bluelabel
  301. 300 kubectl create svc nodeport bluelabel --tcp=80
  302. 301 kubectl describe svc bluelabel
  303. 302 kubectl get svc
  304. 303 curl $(minikube ip):32611
  305. 304 kubectl get pods -n kube-system
  306. 305 kubectl run testpod --image=busybox -- sleep 3600
  307. 306 kubectl get svc
  308. 307 kubectl get svc,pods -n kube-system
  309. 308 kubectl exec -it testpod -- cat /etc/resolv.conf
  310. 309 kubectl exec -it testpod -- nslookup nginxsvc
  311. 310 kubectl get svc
  312. 311 kubectl edit nginxsvc
  313. 312 kubectl edit svc nginxsvc
  314. 313 kubectl get svc
  315. 314 curl $(minikube ip):30558
  316. 315 kubectl describe svc nginxsvc
  317. 316 kubectl edit svc nginxsvc
  318. 317 kubectl describe svc nginxsvc
  319. 318 curl $(minikube ip):30558
  320. 319 vim nwpolicy-complete-example.yaml
  321. 320 kubectl apply -f nwpolicy-complete-example.yaml
  322. 321 kubectl expose pod nginx --port=80
  323. 322 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  324. 323 kubectl get networkpolicy
  325. 324 kubectl get pods --show-labels
  326. 325 cd
  327. 326 ls
  328. 327 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  329. 328 kubectl describe networkpolicy
  330. 329 minikube ssh
  331. 330 minikube addons list
  332. 331 minikube stop
  333. 332 minikube start --cni=calico
  334. 333 kubectl get all
  335. 334 kubectl get networkpolicy
  336. 335 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  337. 336 kubectl get ns
  338. 337 kubectl get pods -n kube-system
  339. 338 cd ckad
  340. 339 kubectl delete -f nwpolicy-complete-example.yaml
  341. 340 kubectl create -f nwpolicy-complete-example.yaml
  342. 341 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  343. 342 minikube stop
  344. 343 minikube delete
  345. 344 minikube start --cni=calico
  346. 345 kubectl get all
  347. 346 kubectl create -f nwpolicy-complete-example.yaml
  348. 347 kubectl expose pod nginx --port=80
  349. 348 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  350. 349 kubectl get pods
  351. 350 history
  352. 351 kubectl get pods
  353. 352 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  354. 353 kubectl label pod busybox access=true
  355. 354 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  356. 355 minikube addons list
  357. 356 minikube addons enable ingress
  358. 357 kubectl get ns
  359. 358 kubectl get pods -n ingress-nginx
  360. 359 kubectl get deploy
  361. 360 kubectl create deploy nginxsvc --image=nginx --replicas=3
  362. 361 kubectl expose deployment nginxsvc --port=80
  363. 362 kubectl describe svc nginxsvc
  364. 363 kubectl create ingress -h | less
  365. 364 kubectl create ingress nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080"
  366. 365 kubectl describe ingress nginxsvc-ingress
  367. 366 sudo vim /etc/hosts
  368. 367 minikube ip
  369. 368 sudo vim /etc/hosts
  370. 369 kubectl get ingress
  371. 370 curl nginxsvc.info
  372. 371 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  373. 372 kubectl expose deploy newdep --port=8080
  374. 373 kubectl get svc
  375. 374 curl nginxsvc.info/hello
  376. 375 kubectl describe ingress nginxsvc-ingress
  377. 376 history
  378. 377 vim morevolumes.yaml
  379. 378 kubectl create -f morevolumes.yaml
  380. 379 kubectl get pods
  381. 380 kubectl describe pod morevol2
  382. 381 kubectl explain pod.spec.volumes
  383. 382 kubectl explain pod.spec.volumes | less
  384. 383 kubectl get pods
  385. 384 kubectl exec -it morevol2 -c centos1 -- touch /centos1/mynewfile
  386. 385 kubectl exec -it morevol2 -c centos2 -- ls /centos2/
  387. 386 ls
  388. 387 vim pv.yaml
  389. 388 kubectl create -f pv.yaml
  390. 389 kubectl get pv
  391. 390 vim pvc.yaml
  392. 391 kubectl create -f pvc.yaml
  393. 392 kubectl get pv,pvc
  394. 393 kubectl get storageclass
  395. 394 vim pvc-pod.yaml
  396. 395 kubectl create -f pvc-pod.yaml
  397. 396 kubectl get pvc,pv
  398. 397 kubectl exec -it nginx-pvc-pod -- touch /usr/share/nginx/html/hello
  399. 398 kubectl describe pv pvc-3fbe6fcb-ed90-4b47-a21c-dea9b4165c7f
  400. 399 minikube ssh
  401. 400 vim pv.yaml
  402. 401 kubectl explain pv.spec.accessModes
  403. 402 history
  404. 403 kubectl create deploy mydb --image=mariadb
  405. 404 kubectl get pods
  406. 405 kubectl describe pod mydb-6785d644c6-kp8rh
  407. 406 kubectl logs mydb-6785d644c6-kp8rh
  408. 407 kubectl get pods --selector app=mydb
  409. 408 kubectl get all --selector app=mydb
  410. 409 kubectl set env deploy mydb MYSQL_ROOT_PASSWORD=password
  411. 410 kubectl get all --selector app=mydb
  412. 411 kubectl get deploy mydb -o yaml > mydb.yaml
  413. 412 vim mydb.yaml
  414. 413 vim varsfile
  415. 414 kubectl create cm mydbvars --from-env-file=varsfile
  416. 415 kubectl describe cm mydbvars
  417. 416 kubectl get all
  418. 417 kubectl delete deploy mydb
  419. 418 kubectl create deployment mydb --image=mariadb --replicas=3
  420. 419 kubectl get all --selector app=mydb
  421. 420 kubectl set env -h | less
  422. 421 kubectl set env deploy mydb --from=configmap/mydbvars
  423. 422 kubectl get all --selector app=mydb
  424. 423 kubectl get deploy mydb -o yaml
  425. 424 kubectl explain pod.spec.volumes | less
  426. 425 echo hello wednesday > index.html
  427. 426 cat index.html
  428. 427 kubectl create cm myindex --from-file=index.html
  429. 428 kubectl describe cm myindex
  430. 429 kubectl create deploy myweb
  431. 430 kubectl create deploy myweb --image=myweb
  432. 431 kubectl edit deploy myweb
  433. 432 kubectl get all --selector app=myweb
  434. 433 kubectl edit deploy myweb
  435. 434 kubectl get all --selector app=myweb
  436. 435 kubectl exec -it myweb-8cb8f4f86-4kzph -- cat /usr/share/nginx/html/index.html
  437. 436 history
  438. 437 kubectl create secret generic dbpw --from-literal=ROOT_PASSWORD=password
  439. 438 kubectl describe secret dbpw
  440. 439 kubectl get secret -o yaml
  441. 440 echo cGFzc3dvcmQ= | base64 -d
  442. 441 kubectl create deploy mynewdb --image=mariadb
  443. 442 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MYSQL_
  444. 443 kubectl get all --selector app=mynewdb
  445. 444 kubectl exec -it mynewdb-79fc76579c-26r5d -- env
  446. 445 history
  447. 446 kubectl api-resources | less
  448. 447 kubectl proxy --port=8001 &
  449. 448 kubectl create deploy curlginx --image=nginx --replicas=3
  450. 449 curl http://localhost:8001/version
  451. 450 curl http://localhost:8001/api/v1/namespaces
  452. 451 curl http://localhost:8001/api/v1/namespaces/default/pods
  453. 452 kubectl get pods
  454. 453 curl http://localhost:8001/api/v1/namespaces/default/pods/curlginx-764b44859b-l2w5v/
  455. 454 curl -XDELETE http://localhost:8001/api/v1/namespaces/default/pods/curlginx-764b44859b-l2w5v/
  456. 455 kubectl get pods
  457. 456 history
  458. 457 vim mypod.yaml
  459. 458 kubectl apply -f mypod.yaml
  460. 459 kubectl get pods mypod -o yaml | less
  461. 460 kubectl get sa
  462. 461 kubectl exec -it mypod -- sh
  463. 462 vim mysa.yaml
  464. 463 kubectl create -f mysa.yaml
  465. 464 kubectl get sa
  466. 465 vim list-pods.yaml
  467. 466 kubectl create -f list-pods.yaml
  468. 467 vim list-pods-mysa-binding.yaml
  469. 468 kubectl apply -f list-pods-mysa-binding.yaml
  470. 469 vim mysapod.yaml
  471. 470 kubectl create -f mysapod.yaml
  472. 471 kubect exec -it mysapod -- sh
  473. 472 kubectl exec -it mysapod -- sh
  474. 473 kubectl get sa
  475. 474 kubectl get pods
  476. 475 kubectl edit pod mypod
  477. 476 kubectl get pods mypod -o yaml > mypodd.yaml
  478. 477 vim mypodd.yaml
  479. 478 kubectl delete pod mypod
  480. 479 kubectl create -f mypodd.yaml
  481. 480 vim mypodd.yaml
  482. 481 kubectl create -f mypodd.yaml
  483. 482 kubectl get pods -o yaml | less
  484. 483 vim mypodd.yaml
  485. 484 kubectl set serviceaccount -h | less
  486. 485 kubectl explain pod.spec.containers.spec | less
  487. 486 kubectl explain pod.spec.containers | less
  488. 487 kubectl explain pod.spec.containers.securityContext | less
  489. 488 kubectl explain pod.spec.securityContext | less
  490. 489 history
  491. 490 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > ~/oldnginx.yaml
  492. 491 vim ../oldnginx.yaml
  493. 492 kubectl create -f ../oldnginx.yaml
  494. 493 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  495. 494 kubectl describe svc oldnginx
  496. 495 kubectl edit svc oldnginx
  497. 496 kubectl get svc
  498. 497 curl 192.168.49.2:30387
  499. 498 kubectl cp old-nginx-546676cb6-gk7mf:/usr/share/nginx/html/index.html ..
  500. 499 kubectl cp old-nginx-546676cb6-gk7mf:/usr/share/nginx/html/index.html ../index.html
  501. 500 vim ../index.html
  502. 501 kubectl create cm canary --from-file=../index.html
  503. 502 kubectl describe cm canary
  504. 503 vim canary.yaml
  505. 504 kubectl get endpoints
  506. 505 kubectl create -f canary.yaml
  507. 506 kubectl get endpoints
  508. 507 curl 192.168.49.2:30387
  509. 508 kubectl get all --selector type=canary
  510. 509 kubectl scale deployment new-nginx --replicas=3
  511. 510 kubectl scale deployment old-nginx --replicas=0
  512. 511 history
  513. 512 ./countdown 1
  514. 513 kubectl get svc oldnginx -o yaml
  515. 514 vim crd-object.yaml
  516. 515 kubectl create -f crd-object.yaml
  517. 516 kubectl api-resources | grep backup
  518. 517 vim crd-backup.yaml
  519. 518 kubectl create -f crd-backup.yaml
  520. 519 kubectl get backups.stable.example.com
  521. 520 kubectl get backups.stable.example.com -o yaml
  522. 521 cd ../Downloads/
  523. 522 ls
  524. 523 cd ..
  525. 524 ls
  526. 525 cd
  527. 526 ls
  528. 527 cd Downloads/
  529. 528 ls
  530. 529 cd ..
  531. 530 find . -name "helm*"
  532. 531 tar -xvf snap/firefox/common/Downloads/helm-v3.9.3-linux-amd64.tar.gz
  533. 532 ls
  534. 533 sudo mv linux-amd64/helm /usr/local/bin
  535. 534 helm version
  536. 535 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  537. 536 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  538. 537 kubectl get deployments.apps blue-nginx -o yaml > green-nginx.yaml
  539. 538 vim green-nginx.yaml
  540. 539 kubectl create -f green-nginx.yaml
  541. 540 kubectl get pods
  542. 541 kubectl delete svc bgnginx; kubectl expose deploy green-nginx --port=80 --name=bgnginx
  543. 542 kubectl delete deployments.apps blue-nginx
  544. 543 history
  545.  
Add Comment
Please, Sign In to add comment