sandervanvugt

kubernetes 3 weeks day 3 feb22

Feb 18th, 2022
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.79 KB | None | 0 0
  1. student@student-virtual-machine:~$ history
  2. 1 minikube start --vm-driver=docker
  3. 2 ./countdown 15
  4. 3 minikube status
  5. 4 kubectl get all
  6. 5 kubectl -h | less
  7. 6 kubectl completion -h | less
  8. 7 source <(kubectl completion bash)
  9. 8 kubectl create -h | less
  10. 9 kubectl create deploy -h | less
  11. 10 kubectl create deployment myfirstapp --image=quay.io/bitnami/nginx --replicas=3
  12. 11 kubectl get all
  13. 12 ./countdown 12
  14. 13 history
  15. 14 kubectl get all
  16. 15 kubectl describe pod myfirstapp-868c68b945-2zd45
  17. 16 kubectl describe pod myfirstapp-868c68b945-2zd45 | less
  18. 17 kubectl get all
  19. 18 kubectl delete pod myfirstapp-868c68b945-2zd45
  20. 19 kubectl get all
  21. 20 kubectl run lonelypod --image=nginx
  22. 21 kubectl get all
  23. 22 kubectl delete pod lonelypod
  24. 23 kubectl get all
  25. 24 kubectl -h | less
  26. 25 kubectl delete -h | less
  27. 26 kubectl get all
  28. 27 kubectl delete deploy myfirstapp
  29. 28 kubectl get all
  30. 29 kubectl api-resources | less
  31. 30 kubectl explain deployment
  32. 31 kubectl explain deployment.spec
  33. 32 kubectl explain deployment.spec.template
  34. 33 kubectl explain deployment.spec.template.spec | less
  35. 34 cd
  36. 35 cd kube3weeks/
  37. 36 ls
  38. 37 vim multicontainer.yaml
  39. 38 kubectl explain pod
  40. 39 vim multicontainer.yaml
  41. 40 kubectl explain deployment.spec.template.spec.containers | less
  42. 41 kubectl create deployment myfirstapp --image=quay.io/bitnami/nginx --replicas=3 --dry-run=client -o yaml
  43. 42 kubectl create deployment myfirstapp --image=quay.io/bitnami/nginx --replicas=3 --dry-run=client -o yaml > myfirstapp.yaml
  44. 43 vim myfirstapp.yaml
  45. 44 kubectl create -f myfirstapp.yaml
  46. 45 kubectl get all
  47. 46 history
  48. 47 exit
  49. 48 ls
  50. 49 sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
  51. 50 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
  52. 51 sudo apt-key fingerprint 0EBFCD88
  53. 52 sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
  54. 53 sudo apt-get update
  55. 54 sudo apt-get docker-ce docker-ce-cli containerd.io
  56. 55 sudo apt-get install docker-ce docker-ce-cli containerd.io
  57. 56 history
  58. 57 sudo docker run hello-world
  59. 58 git clone https://github.com/sandervanvugt/kube3weeks
  60. 59 cd kube3weeks/
  61. 60 ls
  62. 61 ./countdown 15
  63. 62 docker run nginx
  64. 63 sudo usermod -aG docker student
  65. 64 newgrp docker
  66. 65 docker run nginx
  67. 66 docker run -d nginx
  68. 67 docker run nginx -d
  69. 68 docker run busybox
  70. 69 docker ps
  71. 70 docker ps -a
  72. 71 docker run -it busybox
  73. 72 docker ps
  74. 73 docker ps -a
  75. 74 docker run -it nginx sh
  76. 75 docker ps
  77. 76 docker stop adoring_banzai
  78. 77 docker ps
  79. 78 docker images
  80. 79 docker run ubi8/ubi
  81. 80 docker run fedora
  82. 81 docker images
  83. 82 docker rmi hello-world:latest
  84. 83 docker ps -a
  85. 84 docker rm hungry_gauss
  86. 85 docker rmi hello-world:latest
  87. 86 ls
  88. 87 cd dockerfile/
  89. 88 vim Dockerfile
  90. 89 sudo apt install vim
  91. 90 vim Dockerfile
  92. 91 docker build -t mymap .
  93. 92 vim Dockerfile
  94. 93 docker build -t mymap .
  95. 94 docker images
  96. 95 docker run mymap
  97. 96 docker run -it map bash
  98. 97 vim Dockerfile
  99. 98 docker build -t yourmap .
  100. 99 docker images
  101. 100 docker inspect yourmap | less
  102. 101 docker inspect mymap | less
  103. 102 docker run yourmap
  104. 103 docker run -it yourmap bash
  105. 104 cd ..
  106. 105 ls
  107. 106 ./minikube-docker-setup.sh
  108. 107 history
  109. 108 minikube staus
  110. 109 minikube status
  111. 110 kubectl create deploy busybox --dry-run=client -o yaml -- sleep 3600
  112. 111 kubectl create deploy busybox --image=busybox --dry-run=client -o yaml -- sleep 3600
  113. 112 sudo poweroff
  114. 113 history
  115. 114 kubectl api-resources | less
  116. 115 minikube start
  117. 116 kubectl api-resources | less
  118. 117 kubectl explain ippools
  119. 118 kubectl explain ippools.spec
  120. 119 kubectl explain pods.spec
  121. 120 kubectl explain pods.spec | less
  122. 121 kubectl explain pods.spec.containers
  123. 122 kubectl explain pods.spec.containers.volumeDevices
  124. 123 kubectl explain pods.spec.containers.volumeDevices.devicePath
  125. 124 kubectl explain -h | less
  126. 125 kubectl explain --recursive pods
  127. 126 kubectl explain --recursive pods | less
  128. 127 history | grep dry-run
  129. 128 ls
  130. 129 cd kube3weeks/
  131. 130 vim myfirstapp.yaml
  132. 131 kubectl api-resources
  133. 132 source <(kubectl completion bash)
  134. 133 vim multicontainer.yaml
  135. 134 kubectl create -f multicontainer.yaml
  136. 135 kubectl get pods
  137. 136 ls
  138. 137 vim initcontainer.yaml
  139. 138 kubectl create -f initcontainer.yaml
  140. 139 kubectl get pods
  141. 140 kubectl describe pod init-demo
  142. 141 kubectl get pods
  143. 142 vim initcontainer.yaml
  144. 143 kubectl create -f initcontainer.yaml
  145. 144 vim initcontainer.yaml
  146. 145 kubectl create -f initcontainer.yaml
  147. 146 kubectl get pods
  148. 147 kubectl describe pod init-demo2
  149. 148 vim initcontainer.yaml
  150. 149 kubectl create -f initcontainer.yaml
  151. 150 kubectl get pods
  152. 151 kubectl delete pod init-demo2
  153. 152 kubectl delete pod init-demo3
  154. 153 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginxx.yaml
  155. 154 vim mynginxx.yaml
  156. 155 kubectl explain pods.spec
  157. 156 vim mynginxx.yaml
  158. 157 kubectl create -f mynginxx.yaml
  159. 158 vim mynginxx.yaml
  160. 159 kubectl apply -f mynginxx.yaml
  161. 160 kubectl get pods
  162. 161 kubectl delete -f mynginxx.yaml
  163. 162 kubectl get ns
  164. 163 kubectl get pods -n kube-system
  165. 164 minikube addons --list
  166. 165 minikube addons --help
  167. 166 minikube addons list
  168. 167 minikube dashboard
  169. 168 kubectl get ns
  170. 169 kubectl get all -n kubernetes-dashboard
  171. 170 kubectl create ns mynamespace
  172. 171 kubectl get ns
  173. 172 kubectl run mywhatever --image=nginx -n mynamespace
  174. 173 kubectl get pods
  175. 174 kubectl get pods -A
  176. 175 minikube ssh
  177. 176 ./countdown 12
  178. 177 kubectl api-resources | less
  179. 178 kubectl create deploy friginx --image=nginx --replicas=3
  180. 179 kubectl get all
  181. 180 kubectl get deployments.apps friginx -o yaml | less
  182. 181 kubectl get replicasets.apps friginx-f76f68bfc -o yaml | less
  183. 182 kubectl delete rs friginx-f76f68bfc
  184. 183 kubectl get all
  185. 184 kubectl delete pod friginx-f76f68bfc-6wl8w
  186. 185 kubectl get all
  187. 186 kubectl scale deployment friginx --replicas=0
  188. 187 kubectl get all
  189. 188 kubectl scale deployment friginx --replicas=3
  190. 189 kubectl get all
  191. 190 vim ds.yaml
  192. 191 kubectl create -h | less
  193. 192 vim ds.yaml
  194. 193 kubectl create -f ds.yaml
  195. 194 kubectl get all
  196. 195 kubectl get ds
  197. 196 vim ds.yaml
  198. 197 kubectl get all -n kube-system
  199. 198 cd ..
  200. 199 git clone https://github.com/sandervanvugt/cka
  201. 200 ls
  202. 201 cd cka
  203. 202 ls
  204. 203 kubectl get all -n kube-system
  205. 204 kubectl explain deployment.spec
  206. 205 kubectl explain deployment.spec.strategy
  207. 206 kubectl explain deployment.spec.strategy.type
  208. 207 kubectl explain deployment.spec.strategy.rollingUpdate
  209. 208 kubectl set -h | less
  210. 209 kubectl set env -h
  211. 210 kubectl create deploy oldnginx --image=nginx:1.7 --replicas=3
  212. 211 kubectl get all
  213. 212 kubectl get all --selector app=oldnginx
  214. 213 kubectl set image deploy nginx=nginx:latest; kubectl get all --selector app=oldnginx
  215. 214 kubectl set image deploy oldnginx nginx:latest; kubectl get all --selector app=oldnginx
  216. 215 kubectl set image --help | less
  217. 216 kubectl set image deploy oldnginx nginx=nginx:latest; kubectl get all --selector app=oldnginx
  218. 217 kubectl get all --selector app=oldnginx
  219. 218 kubectl edit deploy oldnginx
  220. 219 kubectl get pods
  221. 220 kubectl get pods oldnginx-696c559d96-92r4p -o yaml
  222. 221 kubectl create deploy astest --image=nginx --replicas=3 --dry-run=client -o yaml > astest.yaml
  223. 222 vim astest.yaml
  224. 223 kubectl apply -f astest.yaml
  225. 224 kubectl get all
  226. 225 vim astest.yaml
  227. 226 kubectl set image -h | less
  228. 227 kubectl delete -f astest.yaml
  229. 228 vim astest.yaml
  230. 229 kubectl set image -h | less
  231. 230 #kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
  232. 231 kubectl set image deployment/astest sleepy=busybox webby=nginx:1.9.1
  233. 232 kubectl apply -f astest.yaml
  234. 233 kubectl set image deployment/astest sleepy=busybox webby=nginx:1.9.1
  235. 234 kubectl rollout -h
  236. 235 kubectl rollout history deployment astest
  237. 236 kubectl rollout status deployment astest 2
  238. 237 kubectl rollout status deployment astest
  239. 238 kubectl rollout undo deployment astest
  240. 239 kubectl rollout status -h
  241. 240 kubectl rollout status deployment astest --revision=2
  242. 241 kubectl rollout status deployment astest --revision=3
  243. 242 kubectl get pods
  244. 243 kubectl set env -h | less
  245. 244 kubectl set env pod multicontainer cow=yes
  246. 245 kubectl set env -h | less
  247. 246 kubectl get deploy
  248. 247 kubectl rollout status deploy astest
  249. 248 kubectl rollout history deployment astest
  250. 249 kubectl rollout history deployment astest --revision=3
  251. 250 kubectl rollout history deployment astest --revision=2
  252. 251 kubectl rollout undo deployment astest --to-revision=2
  253. 252 history
  254. 253 kubectl get deploy
  255. 254 kubectl get deployments.apps friginx -o yaml | less
  256. 255 kubectl get all --show-labels
  257. 256 kubectl get all --show-labels --selector app=frigninx
  258. 257 kubectl get all --show-labels --selector app=frignix
  259. 258 kubectl get all --show-labels
  260. 259 kubectl get all --show-labels --selector app=friginx
  261. 260 kubectl label pod friginx-f76f68bfc-ff4cf app-
  262. 261 kubectl get all
  263. 262 kubectl get all --show-labels
  264. 263 ./counter.sh 13
  265. 264 kubectl get deploy
  266. 265 kubectl get pods -o wide
  267. 266 kubectl expose deployment friginx --port=80
  268. 267 kubectl describe deployments.apps friginx
  269. 268 kubectl describe service friginx
  270. 269 kubectl get endpoints
  271. 270 curl 10.102.28.29
  272. 271 minikube ssh
  273. 272 kubectl edit svc friginx
  274. 273 kubectl get svc
  275. 274 minikube ip
  276. 275 curl http://192.168.49.2:32175
  277. 276 kubectl describe svc friginx
  278. 277 minikube addon list
  279. 278 minikube addons list
  280. 279 minikube addons enable ingress
  281. 280 kubectl get ns
  282. 281 kubectl get all -n ingress-nginx
  283. 282 kubectl get svc fringinx
  284. 283 kubectl get svc friginx
  285. 284 kubectl create ingress friginx-ingress --rule="/=friginx:80" --rule="/hello=newdep:8080"
  286. 285 kubectl get ingress
  287. 286 sudo vim /etc/hosts
  288. 287 kubectl get ingress
  289. 288 curl friginx.info
  290. 289 ip a
  291. 290 minikube ip
  292. 291 sudo vim /etc/hosts
  293. 292 curl friginx.info
  294. 293 kubectl describe ingress friginx-ingress
  295. 294 kubectl create deploy newdep --image=gcr.io/google-sampels/hello-app:2.0
  296. 295 kubectl expose deploy newdep --port=8080
  297. 296 kubectl describe ingress friginx-ingress
  298. 297 kubectl delete deploy newdep
  299. 298 kubectl create deploy newdep --image=gcr.io/google-samples/hello-app:2.0
  300. 299 kubectl describe ingress friginx-ingress
  301. 300 curl nginxsvc.info/hello
  302. 301 kubectl get svc
  303. 302 curl friginx.info/hello
  304. 303 minikube ip
  305. 304 curl 10.107.229.254:8080
  306. 305 minikube ssh
  307. 306 ./counter.sh 13
  308. 307 kubectl describe ingress friginx-ingress
  309. 308 ssh 192.168.29.2
  310. 309 kubectl port-forward -h | less
  311. 310 kubectl explain pod.spec.volumes | less
  312. 311 kubectl explain pvc.spec
  313. 312 kubectl explain pvc.spec | less
  314. 313 cd ../kube3weeks/
  315. 314 ls
  316. 315 vim pv.yaml
  317. 316 kubectl create -f pv.yaml
  318. 317 kubectl get pv
  319. 318 vim pvc.yaml
  320. 319 kubectl create -f pvc.yaml
  321. 320 kubectl get pv,pvc
  322. 321 kubectl get storageclass
  323. 322 kubectl describe pv pvc-de9bd38c-38ac-407d-9338-caadc591650b
  324. 323 vim pv-pod.yaml
  325. 324 kubectl create -f pv-pod.yaml
  326. 325 vim pv-pod.yaml
  327. 326 kubectl get pods
  328. 327 kubectl exec -it pv-pod -- touch /usr/share/nginx/html/FRIDAY
  329. 328 minikube ssh
  330. 329 vim pv-pvc-pod.yaml
  331. 330 kubectl create -f pv-pvc-pod.yaml
  332. 331 kubectl create ns myvol
  333. 332 kubectl delete -f pv-pvc-pod.yaml
  334. 333 kubectl create -f pv-pvc-pod.yaml
  335. 334 kubectl get pvc,pv -n myvol
  336. 335 vim pv-pvc-pod.yaml
  337. 336 minikube node add
  338. 337 minikube node list
  339. 338 kubectl get all -n kube-system
  340. 339 kubectl get all -n kube-system -o wide
  341. 340 history
  342. 341 sudo poweroff
  343. 342 minikube start
  344. 343 minikube status
  345. 344 minikube addons list
  346. 345 minikube addons enable storage-provisioner-gluster
  347. 346 minikube addons list
  348. 347 kubectl get ns
  349. 348 kubectl get all -n storage-gluster
  350. 349 kubectl logs -n storage-gluster glusterfs-c9thl
  351. 350 kubectl -n storage-gluster describe daemonset glusterfs
  352. 351 kubectl get all -n storage-gluster
  353. 352 git clone https://github.com/sandervanvugt/ckad
  354. 353 cd ckad
  355. 354 ls
  356. 355 ip a
  357. 356 minikube status
  358. 357 cd ..
  359. 358 vim glusterfs-endpoints.yaml
  360. 359 kubectl create -f glusterfs-endpoints.yaml
  361. 360 kubectl get endpoints
  362. 361 vim glusterfs-service.yaml
  363. 362 kubectl cretae -f glusterfs-service.yaml
  364. 363 kubectl create -f glusterfs-service.yaml
  365. 364 vim glusterfs-pod.yaml
  366. 365 kubectl create -f glusterfs-pod.yaml
  367. 366 kubectl get pods
  368. 367 kubectl exec glusterfs -- mount
  369. 368 kubectl exec glusterpod -- mount
  370. 369 kubectl get pods
  371. 370 kubectl describe pod glusterpod
  372. 371 apt cache search glusterfs
  373. 372 apt-cache search glusterfs
  374. 373 apt install glusterfs-client
  375. 374 sudo apt install glusterfs-client
  376. 375 history
  377. 376 ip a
  378. 377 sudo apt-get download glusterfs-client
  379. 378 minikube addons list
  380. 379 ls -lrt
  381. 380 ip a
  382. 381 sudo apt install openssh-server
  383. 382 apt list --installed
  384. 383 apt list --installed | grep gluster
  385. 384 sudo find / -name "glusterfs*"
  386. 385 ip a | grep 29
  387. 386 kubectl get pods
  388. 387 kubectl delete pod glusterpod
  389. 388 ls
  390. 389 kubectl create -f glusterfs-pod.yaml
  391. 390 kubectl get pods
  392. 391 ls
  393. 392 vim glusterfs-endpoints.yaml
  394. 393 kubectl get endpoints
  395. 394 vim glusterfs-service.yaml
  396. 395 kubectl get svc
  397. 396 kubectl describe glusterfs-cluster
  398. 397 kubectl describe svc glusterfs-cluster
  399. 398 vim glusterfs-pod.yaml
  400. 399 source <(kubectl completion bash)
  401. 400 kubectl describe pod glusterpod
  402. 401 ls
  403. 402 cd kube3weeks/
  404. 403 ls
  405. 404 vim varsfile
  406. 405 kubectl create cm mydbvars --from-env-file=varsfile
  407. 406 kubectl describe cm mydbvars
  408. 407 kubectl create deploy mydb --image=mariadb --replicas=3
  409. 408 kubectl get pods
  410. 409 kubectl describe pods mydb-fb7ff4d78-7vx8b
  411. 410 kubectl logs mydb-fb7ff4d78-glgxc
  412. 411 kubectl set env deploy mydb --from=configmap/mydbvars
  413. 412 kubectl get all
  414. 413 kubectl get deployments.apps mydb -o yaml | less
  415. 414 echo "hello world" > index.html
  416. 415 kubectl create cm myindex --from-file=index.html
  417. 416 kubectl describe cm myindex
  418. 417 kubectl create deployment myweb --image=nginx
  419. 418 kubectl edit deploy myweb
  420. 419 kubectl get all
  421. 420 kubectl exec -it myweb-ff8bf9988-9td42 -- ls -l /usr/share/nginx/html/
  422. 421 kubectl get pods glusterpod -o yaml | less
  423. 422 kubectl create secret -h | less
  424. 423 kubectl create secret generic -h | less
  425. 424 kubectl create secret tls -h | less
  426. 425 kubectl create secret docker-registry -h | less
  427. 426 vim kube3w-fri-lab-1.txt
  428. 427 sudo apt-get download glusterfs-common
  429. 428 ls
  430. 429 mv glusterfs-common_7.2-2build1_amd64.deb ..
  431. 430 cd
  432. 431 kubectl create deploy anotherdb --image=mariadb
  433. 432 kubectl create secret generic mysqlroto --from-literal=MYSQL_ROOT_PASSWORD=password
  434. 433 kubectl get all
  435. 434 kubectl set env deploy anotherdb --from=secret/mysqlroto
  436. 435 kubectl get all
  437. 436 kubectl get secret
  438. 437 kubectl describe secret mysqlroto
  439. 438 kubectl get secret mysqlroto -o yaml
  440. 439 echo cGFzc3dvcmQ= | base64 -d
  441. 440 kubectl exec -it anotherdb-55bdc4f7b-l729f -- env
  442. 441 lvs
  443. 442 mount
  444. 443 mount | grep '^/'
  445. 444 df -h
  446. 445 history
  447.  
  448.  
  449. ######
  450.  
  451. 212 minikube start --vm-driver=docker
  452. 213 minikube addons list
  453. 214 minikube addons enable storage-provisioner-gluster
  454. 215 kubectl api-resources | grep storage
  455. 216 sudo -i
  456. 217 minikube ssh
  457. 218 minikube addons enable storage-provisioner-gluster
  458. 219 minikube ssh
  459. 220 minikube addons enable storage-provisioner-gluster
  460. 221 minikube statu
  461. 222 minikube status
  462. 223 history
  463. 224 kubectl get all
  464. 225 cd ../Downloads/
  465. 226 ls
  466. 227 tar xvf helm-v3.8.0-linux-amd64.tar.gz
  467. 228 sudo mv linux-amd64/helm /usr/local/bin/
  468. 229 helm version
  469. 230 cd
  470. 231 helm repo add k8s-dashboard https://kubernetes.github.io/dashboard
  471. 232 helm install my-kubernetes-dashboard k8s-dashboard/kubernetes-dashboard --version 5.2.0
  472. 233 helm repo add bitnami https://charts.bitnami.com/bitnami
  473. 234 helm repo list
  474. 235 helm search repo bitnami
  475. 236 helm repo update
  476. 237 helm list
  477. 238 kubectl get all
  478. 239 helm install bitnami/mysql --generate-name
  479. 240 kubectl get all
  480. 241 source <(kubectl completion bash)
  481. 242 kubectl describe pod mysql-1645196021-0
  482. 243 kubectl get pv
  483. 244 kubectl get storageclass
  484. 245 kubectl describe pvc data-mysql-1645196021-0
  485. 246 helm show chart bitnami/mysql
  486. 247 helm show all bitnami/mysql
  487. 248 helm show all bitnami/mysql | less
  488. 249 helm list
  489. 250 kubectl get all
  490. 251 helm status mysql-1645196021
  491. 252 helm show values bitnami/nginx
  492. 253 helm pull bitnami/nginx
  493. 254 ls
  494. 255 tar xvf nginx-9.7.6.tgz
  495. 256 vim nginx/values.yaml
  496. 257 helm template --debug nginx
  497. 258 helm install -f nginx/values.yaml mynginx nginx/
  498. 259 ls
  499. 260 kube3weeks/countdown 12
  500. 261 cd kube3weeks/
  501. 262 vim crd-object.yaml
  502. 263 kubectl api-resources | grep backup
  503. 264 kubectl create -f crd-object.yaml
  504. 265 kubectl api-resources | grep backup
  505. 266 vim crd-backup.yaml
  506. 267 kubectl create -f crd-backup.yaml
  507. 268 kubectl get backups
  508. 269 kubectl describe backups.stable.example.com mybackup
  509. 270 curl -sL https://github.com/operator-framework/operator-lifecycle-manager/releases/download/v0.20.0/install.sh | bash -s v0.20.0
  510. 271 kubectl api-resources | wc
  511. 272 kubectl create -f https://operatorhub.io/install/redis-operator.yaml
  512. 273 kubectl api-resources | wc
  513. 274 kubectl get csv -n operators
  514. 275 kubectl api-resources | grep scv
  515. 276 kubectl api-resources | grep csv
  516. 277 vim crd-object.yaml
  517. 278 minikube stop; minikube delete
  518. 279 minikube start --network-plugin=cni --extra-config=kubeadm.pod-network-cidr=10.10.0.0/16
  519. 280 kubectl create -f https://docs.projectcalico.org/manifests/tigera-operator.yaml
  520. 281 kubectl api-resources | wc
  521. 282 kubectl api-resources | grep tigera
  522. 283 kubectl get pods -n tigera-operator
  523. 284 wget https://docs.projectcalico.org/manifests/custom-resources.yaml
  524. 285 vim custom-resources.yaml
  525. 286 kubectl get installations.operator.tigera.io -o yaml
  526. 287 kubectl create -f custom-resources.yaml
  527. 288 kubectl get installations.operator.tigera.io -o yaml
  528. 289 kubectl get pods -n calico-system
  529. 290 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > ~/oldnginx.yaml
  530. 291 ls
  531. 292 cd ..
  532. 293 vim oldnginx.yaml
  533. 294 kubectl create -f oldnginx.yaml
  534. 295 kubectl get all
  535. 296 kubectl get all --show-labels
  536. 297 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  537. 298 kubectl describe svc oldnginx
  538. 299 kubectl edit svc oldnginx
  539. 300 kubectl get svc
  540. 301 kubectl get endpoints
  541. 302 curl $(minikube ip):32134
  542. 303 kubectl cp old-nginx-66bd7bb796-szv6q:/usr/share/nginx/html/index.html index.html
  543. 304 vim index.html
  544. 305 kubectl create cm canary --from-file=index.html
  545. 306 kubectl describe cm canary
  546. 307 cd kube3weeks/
  547. 308 vim canary.yaml
  548. 309 kubectl create -f canary.yaml
  549. 310 kubectl get all
  550. 311 kubectl describe svc
  551. 312 kubectl get endpoints
  552. 313 curl $(minikube ip):32134
  553. 314 kubectl get all
  554. 315 kubectl scale deploy new-nginx --replicas=3
  555. 316 kubectl get all
  556. 317 kubectl scale deployment old-nginx --replicas=0
  557. 318 kubectl get all
  558. 319 ./countdown 12
  559. 320 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  560. 321 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  561. 322 kubectl get all
  562. 323 kubetl get deploy blue-nginx -o yaml > green-nginx.yaml
  563. 324 kubectl get deploy blue-nginx -o yaml > green-nginx.yaml
  564. 325 vim green-nginx.yaml
  565. 326 kubectl create -f green-nginx.yaml
  566. 327 kubectl get all
  567. 328 kubectl delete svc bgnginx; kubectl expose deploy green-nginx --port=80 --name=bgnginx
  568. 329 kubectl scale deployment blue-nginx --replicas=0
  569. 330 history
  570.  
Add Comment
Please, Sign In to add comment