sandervanvugt

kube3weeks all days june23

Jun 16th, 2023
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.81 KB | None | 0 0
  1. student@control:~/gitops$ history
  2. 1 git clone https://github.com/sandervanvugt/cka
  3. 2 cd cka
  4. 3 ls
  5. 4 ls *sh
  6. 5 sudo setup-container.sh
  7. 6 sudo ./setup-container.sh
  8. 7 ls *sh
  9. 8 sudo ./setup-kubetools.sh
  10. 9 history
  11. 10 sudo kubeadm init
  12. 11 history
  13. 12 mkdir -p $HOME/.kube
  14. 13 sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
  15. 14 sudo chown $(id -u):$(id -g) $HOME/.kube/config
  16. 15 kubectl get all
  17. 16 kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/tigera-operator.yaml
  18. 17 kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/custom-resources.yaml
  19. 18 kubectl get pods -n calico-system
  20. 19 history
  21. 20 kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/calico.yaml
  22. 21 kubectl get pods -n calico-system
  23. 22 kubectl get ns
  24. 23 kubectl get pods -n kube-system
  25. 24 history
  26. 25 kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml
  27. 26 history
  28. 27 cd
  29. 28 git clone https://github.com/sandervanvugt/kube3weeks
  30. 29 cd kube3weeks/
  31. 30 ls -l *sh
  32. 31 chmod +x setup-calico.sh
  33. 32 history
  34. 33 kubectl get pods -n calico-system
  35. 34 kubectl get pods -n kube-system
  36. 35 kubectl get nodes
  37. 36 kubectl run testapp --image=nginx
  38. 37 history
  39. 38 git pull
  40. 39 less setup-kubecluster-history.txt
  41. 40 git pull
  42. 41 less setup-kubecluster-history.txt
  43. 42 cd
  44. 43 source <(kubectl completion bash)
  45. 44 kubectl completion -h | less
  46. 45 kubectl create deployment myfirstapp --image=nginx --replicas=3
  47. 46 kubectl get all
  48. 47 kubectl delete pods myfirstapp-564cb9865d-czm74
  49. 48 kubectl get all
  50. 49 kubectl run lonelypod --image=nginx
  51. 50 kubectl get all
  52. 51 kubectl get pods
  53. 52 kubectl delete pod lonelypod
  54. 53 kubectl get all
  55. 54 history
  56. 55 kubectl api-resources | less
  57. 56 kubectl explain pods
  58. 57 kubectl explain pod.spec | less
  59. 58 cd kube3weeks/
  60. 59 ls
  61. 60 kubectl get pods
  62. 61 kubectl get pods testapp -o yaml | less
  63. 62 history
  64. 63 kubectl explain nodes.spec | less
  65. 64 history | grep yaml
  66. 65 wget https://raw.githubusercontent.com/projectcalico/calico/v3.26.0/manifests/calico.yaml
  67. 66 vim calico.yaml
  68. 67 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  69. 68 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  70. 69 vim mynginx.yaml
  71. 70 kubectl explain pod.spec
  72. 71 vim mynginx.yaml
  73. 72 kubectl apply -f mynginx.yaml
  74. 73 vim mynginx.yaml
  75. 74 kubectl apply -f mynginx.yaml
  76. 75 kubectl get pods
  77. 76 vim mynginx.yaml
  78. 77 kubectl apply -f mynginx.yaml
  79. 78 kubectl delete -f mynginx.yaml
  80. 79 kubectl apply -f mynginx.yaml
  81. 80 history
  82. 81 kubectl delete -f mynginx.yaml
  83. 82 vim multicontainer.yaml
  84. 83 kubectl create -f multicontainer.yaml
  85. 84 kubectl get pods
  86. 85 kubectl explain pod.spec | less
  87. 86 history
  88. 87 vim mynginx.yaml
  89. 88 kubectl create deploy yamltest --image=nginx --replicas=3 --dry-run=client -o yaml
  90. 89 vim initstuff.yaml
  91. 90 kubectl apply -f initstuff.yaml
  92. 91 kubectl get pods
  93. 92 vim initstuff.yaml
  94. 93 kubectl apply -f initstuff.yaml
  95. 94 vim initstuff.yaml
  96. 95 kubectl apply -f initstuff.yaml
  97. 96 kubectl get pods
  98. 97 kubectl get ns
  99. 98 kubectl get pods
  100. 99 kubectl get pods -n kube-system
  101. 100 kubectl get pods -n tigera-operator
  102. 101 kubectl get pods -A
  103. 102 kubectl get all -A
  104. 103 kubectl get pods -n kube-system
  105. 104 kubectl create ns secret
  106. 105 kubectl run secretapp --image=nginx -n secret
  107. 106 kubectl get pods
  108. 107 kubectl get pods -n secret
  109. 108 kubectl config set-context --current --namespace=secret
  110. 109 kubectl get pods
  111. 110 kubectl config view
  112. 111 kubectl config set-context --current --namespace=default
  113. 112 kubectl run mydb --image=mariadb
  114. 113 kubectl get pods
  115. 114 kubectl describe pod mydb | less
  116. 115 kubectl logs mydb
  117. 116 kubectl delete pod mydb
  118. 117 kubectl run mydb --image=mariadb -e MARIADB_ROOT_PASSWORD=password
  119. 118 kubectl run mydb --image=mariadb --env MARIADB_ROOT_PASSWORD=password
  120. 119 kubectl run -h | less
  121. 120 kubectl options
  122. 121 kubectl options | wc
  123. 122 kubectl get pods
  124. 123 kubectl run mydb --image=mariadb --env MARIADB_ROOT_PASSWORD=password --dry-run=client -o yaml > mydb.yaml
  125. 124 vim mydb.yaml
  126. 125 history
  127. 126 sudo poweroff
  128. 127 history
  129. 128 source <(kubectl completion bash)
  130. 129 kubectl create deployment mynginx --image=nginx --replicas=3
  131. 130 kubectl get all
  132. 131 kubectl delete pod mynginx-55cd454cfc-bkxd2
  133. 132 kubectl get all
  134. 133 kubectl scale deployment mynginx --replicas=2
  135. 134 kubectl get deploy mynginx -o yaml | less
  136. 135 kubectl get rs mynginx-55cd454cfc -o yaml
  137. 136 kubectl get rs mynginx-55cd454cfc -o yaml | less
  138. 137 kubectl delete rs mynginx-55cd454cfc
  139. 138 kubectl get rs
  140. 139 kubectl get pods
  141. 140 kubectl create deployment oldnginx --image=nginx:1.14 --replicas=3
  142. 141 kubectl get all --selector app=oldnginx
  143. 142 kubectl get all
  144. 143 kubectl set image -h | less
  145. 144 kubectl set image deploy oldnginx nginx=nginx:latest
  146. 145 kubectl get deploy oldnginx -o yaml | less
  147. 146 kubectl get all --selector app=oldnginx
  148. 147 kubectl rollout -h | less
  149. 148 kubectl rollout deploy oldnginx
  150. 149 kubectl rollout deploy
  151. 150 kubectl rollout status deployment oldnginx
  152. 151 kubectl rollout history deployment oldnginx
  153. 152 kubectl rollout undo deployment oldnginx ; kubectl get all --selector app=oldnginx
  154. 153 kubectl edit deployments.apps oldnginx
  155. 154 kubectl create deployment lnginx --image=nginx --replicas=3
  156. 155 kubectl get all --show-labels
  157. 156 kubectl get pods -n kube-system -L
  158. 157 kubectl get pods -n kube-system --show-label
  159. 158 kubectl get pods -n kube-system --show-labels
  160. 159 kubectl get all --selector app=lnginx
  161. 160 kubectl label pod lnginx-689f487b9f-rrgln app-
  162. 161 kubectl get all | grep lnginx
  163. 162 kubectl get all --show-labels | grep lnginx
  164. 163 kubectl create daemondemo --image=nginx --dry-run=client -o yaml > daemondemo.yaml
  165. 164 kubectl create deploy daemondemo --image=nginx --dry-run=client -o yaml > daemondemo.yaml
  166. 165 vim daemondemo.yaml
  167. 166 kubectl create -f daemondemo.yaml
  168. 167 kubectl get all
  169. 168 kubectl edit node control
  170. 169 kubectl get all
  171. 170 kubectl get ds -A
  172. 171 kubectl -n kube-system get ds kube-proxy -o yaml | less
  173. 172 kubectl -n kube-system get ds calico-node -o yaml | less
  174. 173 ls
  175. 174 cd kube3weeks/
  176. 175 ./countdown 13
  177. 176 kubectl get deploy
  178. 177 kubectl delete deploy lnginx myfirstapp mynginx oldnginx
  179. 178 kubectl create deploy nginxsvc --image=nginx
  180. 179 kubectl scale deployment nginxsvc --replicas=3
  181. 180 kubectl expose deployment nginxsvc --port=80
  182. 181 kubectl get all
  183. 182 kubectl get all --selector app=nginxsvc
  184. 183 kubectl get all --selector app=nginxsvc -o wide
  185. 184 kubectl describe svc nginxsvc
  186. 185 kubectl get svc nginxsvc -o yaml | less
  187. 186 kubectl get endpoints
  188. 187 curl 10.110.67.234
  189. 188 kubectl edit svc nginxsvc
  190. 189 kubectl get svc
  191. 190 ip a
  192. 191 kubectl get svc
  193. 192 ./countdown 1
  194. 193 kubectl config view
  195. 194 ps aux | grep api-server
  196. 195 ps aux | grep api-
  197. 196 ps aux | grep api
  198. 197 kubectl get svc
  199. 198 kubectl edit svc nginxsvc
  200. 199 kubectl scale deployment nginxsvc --replicas=20
  201. 200 kubectl get pods -o wide
  202. 201 kubectl describe svc nginxsvc
  203. 202 kubectl scale deployment nginxsvc --replicas=3
  204. 203 vim morevolumes.yaml
  205. 204 kubectl apply -f morevolumes.yaml
  206. 205 kubectl get pods
  207. 206 kubectl describe pods morevol2
  208. 207 kubectl get pods
  209. 208 kubectl exec morevol2 -c centos1 -- touch /centos1/testfile
  210. 209 kubectl exec morevol2 -c centos2 -- ls -l /centos2
  211. 210 ./countdown 13
  212. 211 vim pv.yaml
  213. 212 kubectl explain pv.spec | less
  214. 213 kubectl apply -f pv.yaml
  215. 214 kubectl get all
  216. 215 kubectl get pv
  217. 216 vim pvc.yaml
  218. 217 kubectl apply -f pvc.yaml
  219. 218 kubectl get pvc,pv
  220. 219 vim pvc.yaml
  221. 220 vim pv-pod.yaml
  222. 221 kubectl apply -f pv-pod.yaml
  223. 222 kubectl exec pv-pod -- touch /usr/share/nginx/html/hellofriday
  224. 223 kubectl describe pod pv-pod
  225. 224 kubectl describe pvc pv-claim
  226. 225 kubectl describe pv pv-volume
  227. 226 kubectl get pods -o wide
  228. 227 ssh 192.168.29.31
  229. 228 ssh 192.168.29.41
  230. 229 ssh 192.168.29.21
  231. 230 ssh 192.168.29.22
  232. 231 vim pv-pvc-pod.yaml
  233. 232 kubectl apply -f pv-pvc-pod.yaml
  234. 233 kubectl get pv,pvc
  235. 234 kubectl delete -f pv-pvc-pod.yaml
  236. 235 vim pv.yaml
  237. 236 kubectl apply -f pv.yaml
  238. 237 kubectl get pv
  239. 238 vim pv-pvc-pod.yaml
  240. 239 kubectl apply -f pv-pvc-pod.yaml
  241. 240 kubectl get pv,pvc
  242. 241 ./countdown 1
  243. 242 kubectl create ns myvol
  244. 243 kubectl get pods
  245. 244 kubectl get pods testapp -o yaml | less
  246. 245 kubectl get -n kube-system pod calico-kube-controllers-786b679988-plhh4 -o yaml | less
  247. 246 sudo apt install nfs-server -y
  248. 247 sudo mkdir /nfsexport
  249. 248 sudo vim /nfsexport
  250. 249 sudo vim /etc/export
  251. 250 sudo vim /etc/exports
  252. 251 cat /etc/exports
  253. 252 sudo systemctl restart nfs-server
  254. 253 showmount -e localhost
  255. 254 cd
  256. 255 ls
  257. 256 tar xvf helm-v3.12.0-linux-amd64.tar.gz
  258. 257 sudo cp linux-amd64/helm /usr/local/bin
  259. 258 helm version
  260. 259 helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
  261. 260 helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner --set nfs.server=192.168.29.30 --set nfs.path=/nfsexport
  262. 261 kubectl get pods -n kube-system
  263. 262 kubectl get ns
  264. 263 kubectl get pods
  265. 264 kubectl get storageclass
  266. 265 kubectl get pv
  267. 266 cd kube3weeks/
  268. 267 vim nfs-provisioner-pvc-test.yaml
  269. 268 kubectl apply -f nfs-provisioner-pvc-test.yaml
  270. 269 kubectl get pv
  271. 270 ls /nfsexport/
  272. 271 history
  273. 272 vim varsfile
  274. 273 kubectl create cm dbvars --from-env-file=varsfile
  275. 274 kubectl describe cm dbvars
  276. 275 kubectl create deploy mydb --image=mariadb --replicas=3
  277. 276 kubectl get all --selector app=mydb
  278. 277 kubectl logs mydb-6875696859-x2drl
  279. 278 kubectl set env deploy mydb --from=configmap/mydbvars
  280. 279 kubectl set env deploy mydb --from=configmap/dbvars
  281. 280 kubectl get deploy mydb -o yaml | less
  282. 281 kubectl get all --selector app=mydb
  283. 282 echo hello friday > index.html
  284. 283 kubectl create cm myindex --from-file=index.html
  285. 284 rm index.html
  286. 285 kubectl describe cm myindex
  287. 286 kubectl create deploy myweb --image=nginx
  288. 287 kubectl edit deployments.apps myweb
  289. 288 kubectl exec myweb-7777f58f5-t9kk6 -- cat /usr/share/nginx/index.html
  290. 289 kubectl edit deployments.apps myweb
  291. 290 kubectl exec myweb-7777f58f5-t9kk6 -- cat /usr/share/nginx/html/index.html
  292. 291 kubectl create secret docker-registry my-docker-credentials --docker-username=unclebob --docker-password=mypw --docker-email=uncel@bob.com --docker-server=myregistry:5000
  293. 292 kubectl get secret my-docker-credentials -o yaml
  294. 293 echo eyJhdXRocyI6eyJteXJlZ2lzdHJ5OjUwMDAiOnsidXNlcm5hbWUiOiJ1bmNsZWJvYiIsInBhc3N3b3JkIjoibXlwdyIsImVtYWlsIjoidW5jZWxAYm9iLmNvbSIsImF1dGgiOiJkVzVqYkdWaWIySTZiWGx3ZHc9PSJ9fX0= | base64 -d
  295. 294 kubectl explain --recursive pod.spec | less
  296. 295 history
  297. 296 sudo poweroff
  298. 297 cd kube3weeks/
  299. 298 ./countdown 1
  300. 299 ./countdown 15
  301. 300 kubectl get all
  302. 301 kubectl delete deply mydb myweb nginxsvc
  303. 302 kubectl delete deploy mydb myweb nginxsvc
  304. 303 source <(kubectl completion bash)
  305. 304 kubectl get all
  306. 305 kubectl delete pod init-demo init-demo2 lnginx-689f487b9f-rrgln local-pv-pod multicontainer mydb pv-pod testapp
  307. 306 helm version
  308. 307 helm repo add bitnami https://charts.bitnami.com/bitnami
  309. 308 helm repo list
  310. 309 helm search repo bitnami
  311. 310 helm repo update
  312. 311 helm list
  313. 312 helm --help
  314. 313 helm install bitnami/mysql --generate-name
  315. 314 kubectl get all
  316. 315 helm show chart bitnami/mysql
  317. 316 helm show all bitnami/mysql
  318. 317 helm list
  319. 318 helm status mysql-1686917437
  320. 319 kubectl get all
  321. 320 kubectl describe pod mysql-1686917437-0
  322. 321 systemctl status nfs-server
  323. 322 kubectl get storageclass
  324. 323 kubectl get pv,pvs
  325. 324 kubectl get pv,pvc
  326. 325 cd kube3weeks/
  327. 326 vim nfs-provisioner-pvc-test.yaml
  328. 327 helm show values
  329. 328 helm list
  330. 329 helm show values mysql
  331. 330 helm show values bitnami-mysql/bitnami-mysql
  332. 331 helm show values bitnami/bitnami-mysql
  333. 332 helm repo add bitnami https://charts.bitnami.com/bitnami
  334. 333 helm show values bitnami/nginx
  335. 334 helm show values bitnami/nginx | grep commonLabels
  336. 335 helm show values bitnami/nginx | grep replicaCount
  337. 336 vim values.yaml
  338. 337 helm install bitnami/nginx --generate-name --values values.yaml
  339. 338 kubectl get pods --show-labels
  340. 339 kubectl get all --show-labels
  341. 340 helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
  342. 341 mkdir dashboard
  343. 342 vim dashboard/values.yaml
  344. 343 helm repo list
  345. 344 helm install -f dashboard/values.yaml dashboard dashboard
  346. 345 helm install dashboard dashboard
  347. 346 helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard -f dashboard/values.yaml
  348. 347 helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard
  349. 348 kubectl get deploy
  350. 349 kubectl edit deploy kubernetes-dashboard
  351. 350 kubectl get all
  352. 351 kubectl port-forward kubernetes-dashboard-67b5dff5f4-lftqv 8443:8443
  353. 352 bg
  354. 353 ip a
  355. 354 helm upgrade --install ingress-nginx ingress-nginx --repo helm://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace
  356. 355 helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace
  357. 356 kubectl get pods -n ingress-nginx
  358. 357 kubectl get all -n ingress-nginx
  359. 358 kubectl create deploy nginxsvc --image=nginx --port=80
  360. 359 kubectl expose deploy nginxsvc
  361. 360 kubectl delete svc nginxsvc
  362. 361 kubectl expose deploy nginxsvc
  363. 362 kubectl describe svc nginxsvc
  364. 363 kubectl create ingress --help | less
  365. 364 kubectl create ingress nginxsvc --class=nginx --rule=nginxsvc.info/*=nginxsvc:80
  366. 365 kubectl describe ingress nginxsvc
  367. 366 kubectl get ing nginxsvc -o yaml | less
  368. 367 kubectl port-forward -n ingress-nginx svc/ingress-nginx-controller 8080:80
  369. 368 bg
  370. 369 sudo vim /etc/hosts
  371. 370 curl nginxsvc.info:8080
  372. 371 ./countdown 13
  373. 372 vim statefulset.yaml
  374. 373 kubectl get storageclass
  375. 374 kubectl apply -f statefulset.yaml
  376. 375 kubectl get all
  377. 376 kubectl get pvc
  378. 377 kubectl get pods
  379. 378 kubectl get svc
  380. 379 vim statefulset.yaml
  381. 380 kubectl explain deploy.spec
  382. 381 kubectl explain statefulset.spec
  383. 382 kubectl get all
  384. 383 kubectl describe pod mysql-1686917437-0
  385. 384 kubectl edit statefulsets.apps mysql-1686917437
  386. 385 kubectl get statefulsets.apps web -o yaml | less
  387. 386 kubectl edit statefulsets.apps mysql-1686917437
  388. 387 kubectl get statefulsets.apps mysql-1686917437 -o yaml > mysql-ss.yaml
  389. 388 kubectl delete statefulsets.apps mysql-1686917437
  390. 389 vim mysql-ss.yaml
  391. 390 kubectl get all
  392. 391 kubectl apply -f mysql-ss.yaml
  393. 392 kubectl get all
  394. 393 kubectl describe pod mysql-1686917437-0
  395. 394 kubectl edit statefulsets.apps mysql-1686917437
  396. 395 kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
  397. 396 kubectl get all -n kube-system
  398. 397 kubectl describe pod -n kube-system metrics-server-7b4c4d4bfd-24k49
  399. 398 kubectl -n kube-system logs metrics-server-7b4c4d4bfd-24k49
  400. 399 kubectl edit deployments.apps -n kube-system metrics-server
  401. 400 kubectl get all -n kube-system
  402. 401 kubectl get all -n kube-system -w
  403. 402 kubectl get pods -n kube-system
  404. 403 kubectl get pods -w -n kube-system
  405. 404 kubectl top pods
  406. 405 cd ..
  407. 406 git clone https://github.com/sandervanvugt/ckad
  408. 407 kubectl get svc -n kube-system
  409. 408 kubectl get svc -n ingress-nginx
  410. 409 kubectl edit svc -n ingress-nginx ingress-nginx-controller
  411. 410 ls
  412. 411 cd ckad
  413. 412 ls
  414. 413 cd autoscaling/
  415. 414 ls
  416. 415 vi Dockerfile
  417. 416 docker ps
  418. 417 crictl ps
  419. 418 sudo crictl ps
  420. 419 sudo crictl --help | less
  421. 420 sudo apt install docker.io
  422. 421 sudo systemctl status docker
  423. 422 sudo systemctl disable --now docker
  424. 423 sudo docker build -t php-apache .
  425. 424 vim hpa.yaml
  426. 425 kubectl apply -f hpa.yaml
  427. 426 kubectl get deploy
  428. 427 kubectl get deploy,pods
  429. 428 kubectl autoscale -h | less
  430. 429 kubectl autoscale deployment php-apache --cpu-percent=1 --min=3 --max=10
  431. 430 kubectl get hpa
  432. 431 kubectl get deploy,pods
  433. 432 kubectl get hpa
  434. 433 kubectl get deploy,pods
  435. 434 kubectl get hpa
  436. 435 ../countdown 13
  437. 436 kubectl get hpa
  438. 437 exit
  439. 438 kubectl run -it load-generator --rm --image=busybox --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O - http://php-apache; done"
  440. 439 kubectl create ns test
  441. 440 kubectl get ns
  442. 441 kubectl run -n test -it load-generator --rm --image=busybox --restart=Never -- /bin/sh -c "while sleep 0.01; do wget -q -O - http://php-apache; done"
  443. 442 kubectl run -n test -it load-generator --rm --image=busybox --restart=Never -- cat /etc/resolv.conf
  444. 443 kubectl get svc
  445. 444 kubectl get svc -n kube-system
  446. 445 kubectl run -n test -it load-generator --rm --image=busybox --restart=Never -- nslookup php-apache.default.svc.cluster.local
  447. 446 kubectl get svc -A
  448. 447 curl 10.98.103.32
  449. 448 cd kube3weeks/
  450. 449 vim crd-object.yaml
  451. 450 kubectl api-resources | grep ustom
  452. 451 vim crd-object.yaml
  453. 452 kubectl apply -f crd-object.yaml
  454. 453 kubectl api-resources | grep backup
  455. 454 cat crd-backup.yaml
  456. 455 kubectl create -f crd-backup.yaml
  457. 456 kubectl get backups
  458. 457 kubectl api-resources
  459. 458 kubectl api-resources | less
  460. 459 curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.25.0/install.sh | bash -s v0.25.0
  461. 460 kubectl get -n operator.yaml
  462. 461 exit
  463. 462 source <(kubectl completion bash)
  464. 463 kubectl get all -n operators
  465. 464 kubectl get pods -A
  466. 465 kubectl create -f https://operatorhub.io/install/kubeflow.yaml
  467. 466 kubectl api-resources | grep csv
  468. 467 kubectl get csv -n operators
  469. 468 kubectl describe csv -n operators kubeflow.v1.2.0
  470. 469 git clone https://github.com/sandervanvugt/gitops
  471. 470 cd gitops/
  472. 471 cd kustomize-bluegreen/blue/
  473. 472 ls
  474. 473 vim kustomization.yaml
  475. 474 ls
  476. 475 vim bluecm.yaml
  477. 476 cat index.html
  478. 477 vim deployment.yaml
  479. 478 vim blue-svc.yaml
  480. 479 vim myapp-ing.yaml
  481. 480 kubectl apply -k .
  482. 481 sudo vim /etc/hosts
  483. 482 curl http://myapp.local
  484. 483 kubectl describe ingress myapp
  485. 484 kubectl get svc
  486. 485 curl 10.106.10.49
  487. 486 history | grep port-f
  488. 487 kubectl port-forward -n ingress-nginx svc/ingress-nginx-controller 8080:80
  489. 488 curl http://myapp.local:8080
  490. 489 ../../countdown 14
  491. 490 curl http://myapp.local:8080
  492. 491 kubectl get ing myapp
  493. 492 kubectl get ing myapp -o yaml
  494. 493 cd ../green/
  495. 494 ls
  496. 495 cat greencm.yaml
  497. 496 vim myapp-ing.yaml
  498. 497 vim kustomization.yaml
  499. 498 kubectl apply -k .
  500. 499 curl http://myapp.local:8080
  501. 500 kubectl apply -f myapp-ing.yaml
  502. 501 curl http://myapp.local:8080
  503. 502 kubectl get deploy
  504. 503 kubectl scale deployment blue-deploy --replicas=0
  505. 504 kubectl get deploy
  506. 505 cd ../..
  507. 506 echo new-version > index.html
  508. 507 kubectl create cm new-version --from-file=index.html
  509. 508 echo old-version > index.html
  510. 509 kubectl create cm old-version --from-file=index.html
  511. 510 vim canary.yaml
  512. 511 kubectl apply -f canary.yaml
  513. 512 kubectl expose deploy old-version --port=80 --type=NodePort
  514. 513 sed -i -e 's/old/new/' canary.yaml
  515. 514 vim canary.yaml
  516. 515 kubectl apply -f canary.yaml
  517. 516 kubectl expose deploy new-version --port=80 --type=NodePort
  518. 517 kubectl get deploy,pods,svc
  519. 518 sudo vim /etc/hosts
  520. 519 kubectl create ing old-version --rule="theapp.info/=old.version:80"
  521. 520 kubectl create ing old-version --rule="theapp.info/=old-version:80"
  522. 521 curl theapp.info
  523. 522 curl theapp.info:8080
  524. 523 kubectl get ing
  525. 524 kubectl get ing myapp -o yaml
  526. 525 kubectl edit ing old-version
  527. 526 curl theapp.info:8080
  528. 527 vim new-ing.yaml
  529. 528 kubectl apply -f new-ing.yaml
  530. 529 kubectl get ing
  531. 530 curl theapp.info:8080
  532. 531 history
  533. 532 kubectl get svc -A
  534. 533 kubectl edit svc kubernetes-dashboard
  535. 534 kubectl get svc -A
  536. 535 kubectl get nodes
  537. 536 kubectl get nodes -o wide
  538. 537 kubectl edit deploy kubernetes-dashboard-67b5dff5f4-lftqv
  539. 538 kubectl edit deploy kubernetes-dashboard
  540. 539 kubectl get clusterroles | less
  541. 540 kubectl create clusterrolebinding --help
  542. 541 kubectl create clusterrolebinding cluster-admin --clusterrole=cluster-admin --serviceaccount=kubernetes-dahsboard
  543. 542 kubectl create clusterrolebinding cluster-admin --clusterrole=cluster-admin --serviceaccount=default:kubernetes-dahsboard
  544. 543 kubectl create clusterrolebinding clusterdash --clusterrole=cluster-admin --serviceaccount=default:kubernetes-dahsboard
  545. 544 kubectl create clusterrolebinding clusterdashg --clusterrole=cluster-admin --serviceaccount=default:kubernetes-dashboard
  546. 545 history
  547.  
Add Comment
Please, Sign In to add comment