sandervanvugt

CKAD Oct22 all days

Oct 13th, 2022
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.30 KB | None | 0 0
  1. #####MINIKUBE COMMANDSstudent@student-virtual-machine:~/Downloads$ history
  2. 1 sudo apt install vim git
  3. 2 cd ckad
  4. 3 ./countdown 15
  5. 4 ./countdown 13
  6. 5 ./countdown 1
  7. 6 git clone https://github.com/sandervanvugt/ckad
  8. 7 sudo apt install git vim -y
  9. 8 git clone https://github.com/sandervanvugt/ckad
  10. 9 cd ckad
  11. 10 ls
  12. 11 ./minikube-docker-setup.sh
  13. 12 minikube start --vm-driver=docker --cni=calico
  14. 13 kubectl get all
  15. 14 minikube ssh
  16. 15 kubectl get all
  17. 16 minikube status
  18. 17 minikube dashboard
  19. 18 kubectl get all
  20. 19 kubectl create deployment firstginx --image=nginx --replicas=3
  21. 20 kubectl get all
  22. 21 history
  23. 22 source <(kubectl completion bash)
  24. 23 sudo apt install bash-completion
  25. 24 kubectl -h
  26. 25 kubectl create -h | less
  27. 26 kubectl create deploy -h | less
  28. 27 history
  29. 28 cd
  30. 29 cd .kube/
  31. 30 cat config
  32. 31 kubectl config view
  33. 32 kubectl config set-context --current --namespace=mynamespace
  34. 33 kubectl config set-context --current --namespace=default
  35. 34 cd
  36. 35 cd ckad
  37. 36 ls
  38. 37 cd dockerfile/
  39. 38 ls
  40. 39 vim Dockerfile
  41. 40 docker build -t nmap .
  42. 41 docker images
  43. 42 docker save --help | less
  44. 43 docker save -o nmap.tar nmap
  45. 44 ls -l
  46. 45 cd ..
  47. 46 history
  48. 47 ./countdown 1
  49. 48 kubectl get pods
  50. 49 kubectl get pods firstginx-7c4fcf6b55-bk2c5 -o yaml| less
  51. 50 kubectl get all
  52. 51 kubectl delete deploy dashginx
  53. 52 kubectl get all
  54. 53 kubectl delete pod firstginx-7c4fcf6b55-bk2c5
  55. 54 kubectl get all
  56. 55 kubectl run -h | less
  57. 56 kubectl run nginx --image=nginx
  58. 57 kubectl get all
  59. 58 kubectl delete pod nginx
  60. 59 kubectl get all
  61. 60 kubectl describe pod firstginx-7c4fcf6b55-t4grh
  62. 61 history
  63. 62 kubectl get pods firstginx-7c4fcf6b55-bk2c5 -o yaml| less
  64. 63 kubectl get pods firstginx-7c4fcf6b55-t4grh -o yaml | less
  65. 64 kubectl explain pods
  66. 65 kubectl explain pods.spec | less
  67. 66 kubectl explain pods.spec.affinity | less
  68. 67 kubectl explain --recursive pods.spec
  69. 68 kubectl explain --recursive pods.spec | wc
  70. 69 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  71. 70 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  72. 71 vim sidecar.yaml
  73. 72 kubectl apply -f sidecar.yaml
  74. 73 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  75. 74 kubectl get pods
  76. 75 vim sidecar.yaml
  77. 76 docker search httpd | grep centos
  78. 77 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  79. 78 kubectl delete pod sidecar-pod
  80. 79 vim sidecard2.yaml
  81. 80 kubectl create -f sidecard2.yaml
  82. 81 vim sidecard2.yaml
  83. 82 kubectl create -f sidecard2.yaml
  84. 83 vim sidecard2.yaml
  85. 84 kubectl create -f sidecard2.yaml
  86. 85 kubectl get pods
  87. 86 kubectl describe pods two-containers
  88. 87 kubectl exec -it two-containers -c nginx-container -- sh
  89. 88 history
  90. 89 vim init-example1.yaml
  91. 90 kubectl apply -f init-example1.yaml
  92. 91 kubectl get pods
  93. 92 kubectl describe pods init-demo1
  94. 93 kubectl get pods
  95. 94 vim init-example2.yaml
  96. 95 kubectl create -f init-example2.yaml
  97. 96 kubectl get pods
  98. 97 sudo reboot
  99. 98 sudo -i
  100. 99 history | less
  101. 100 minikube start --vm-driver=docker --cni=calico
  102. 101 cd ckad
  103. 102 vim init-example1.yaml
  104. 103 kubectl get pods
  105. 104 kubectl delete pod init-demo1
  106. 105 vim init-example1.yaml
  107. 106 kubectl create -f init-example1.yaml
  108. 107 kubectl get pods
  109. 108 wget -O http://info.cern.ch
  110. 109 wget -O /tmp/index.html http://info.cern.ch
  111. 110 cat /tmp/index.html
  112. 111 source <(kubectl completion bash)
  113. 112 kubectl describe pod init-demo1
  114. 113 kubectl logs init-demo1
  115. 114 kubectl logs init-demo1 -c install
  116. 115 wget -O /tmp/index.html http://info.cern.ch
  117. 116 kubectl exec -it init-demo1 -c install -- bash
  118. 117 kubectl exec -it init-demo1 -c install -- sh
  119. 118 kubectl run mydb --image=mariadb
  120. 119 kubectl get pods
  121. 120 kubectl describe pod mydb
  122. 121 kubectl logs mydb
  123. 122 kubectl delete pod mydb
  124. 123 kubectl run -h | less
  125. 124 kubectl run mydb --image=mariadb --env MARIADB_ROOT_PASSWORD=password
  126. 125 kubectl get pods
  127. 126 kubectl run busy --image=busybox
  128. 127 kubectl get pods
  129. 128 kubectl describe pod busy
  130. 129 kubectl get pods busy -o yaml
  131. 130 kubectl get pods
  132. 131 kubectl get ns
  133. 132 kubectl get pods -n default
  134. 133 kubectl get pods -n kube-system
  135. 134 kubectl get all -n kubernetes-dashboard
  136. 135 kubectl describe ns kube-system
  137. 136 kubectl get all -A
  138. 137 kubectl get pods -A
  139. 138 kubectl create ns secret
  140. 139 kubectl run secretpod --image=nginx -n secret
  141. 140 kubectl get pods
  142. 141 kubectl get pods -n secret
  143. 142 kubectl config set-context --current --namespace=secret
  144. 143 kubectl get all
  145. 144 kubectl config set-context --current --namespace=default
  146. 145 history
  147. 146 sudo poweroff
  148. 147 minikube start
  149. 148 kubectl explain pod.spec | less
  150. 149 kubectl explain pod.spec.securityContext | less
  151. 150 kubectl explain pod.spec.containers.securityContext | less
  152. 151 cd ckad/
  153. 152 ls
  154. 153 vim securitycontextdemo2.yaml
  155. 154 kubectl apply -f securitycontextdemo2.yaml
  156. 155 kubectl get pods
  157. 156 kubectl exec -it security-context-demo -- sh
  158. 157 vim securitycontextdemo.yaml
  159. 158 kubectl apply -f securitycontextdemo.yaml
  160. 159 kubectl get pods
  161. 160 kubectl describe nginxsecure
  162. 161 kubectl describe pod nginxsecure
  163. 162 kubectl create job onejob --image=busybox -- date
  164. 163 kubectl get jobs,pods
  165. 164 kubectl get jobs onejob -o yaml | less
  166. 165 kubectl get jobs,pods
  167. 166 kubectl delete job onejob
  168. 167 kubectl get jobs,pods
  169. 168 kubectl create job mynewjob --image=busybox --dry-run=client -o yaml -- sleep 5 > mynewjob.yaml
  170. 169 vim mynewjob.yaml
  171. 170 kubectl apply -f mynewjob.yaml
  172. 171 kubectl get jobs,pods
  173. 172 kubectl explain jobs.spec | less
  174. 173 kubectl explain --recursive jobs.spec | less
  175. 174 kubectl get jobs,pods
  176. 175 kubectl create cronjob -h | less
  177. 176 kubectl create cronjob runme --image=busybox --schedule="*/10 * * * *" -- echo greetings from the cluster
  178. 177 kubectl get cronjobs,jobs,pods
  179. 178 date
  180. 179 kubectl creat job --from=cronjob/runme
  181. 180 kubectl create job --from=cronjob/runme
  182. 181 kubectl create job testjob --from=cronjob/runme
  183. 182 kubectl get cronjobs,jobs,pods
  184. 183 kubectl logs testjob-6ckzk
  185. 184 source <(kubectl completion bash)
  186. 185 history
  187. 186 kubectl create cronjob sayhello --image=busybox --schedule="* * * * *" -- logger hello world
  188. 187 date
  189. 188 kubectl get jobs,cronjobs,pods
  190. 189 kubectl logs sayhello-27759758-zxwzg
  191. 190 kubectl exec -it sayhello-27759758-zxwzg -- journalctl
  192. 191 vim frontend-resources.yaml
  193. 192 kubectl apply -f frontend-resources.yaml
  194. 193 kubectl get pods
  195. 194 kubectl describe pod frontend
  196. 195 kubectl delete -f frontend.yaml
  197. 196 kubectl delete -f frontend-resources.yaml
  198. 197 vim frontend-resources.yaml
  199. 198 kubectl apply -f frontend-resources.yaml
  200. 199 kubectl get pods
  201. 200 kubectl describe pods frontend
  202. 201 kubectl delete -f frontend-resources.yaml
  203. 202 vim frontend-resources.yaml
  204. 203 kubectl apply -f frontend-resources.yaml
  205. 204 kubectl get pods
  206. 205 kubectl describe pod frontend
  207. 206 kubectl delete -f frontend-resources.yaml
  208. 207 kubectl run httpd --image=httpd:2/4/54-alpine --dry-run=client -o yaml | kubectl set resources -f --limits "memory=512Mi" --requests "memory=512Mi" --local -o yaml | kubectl create -f -
  209. 208 kubectl run httpd --image=httpd:2.4.54-alpine --dry-run=client -o yaml | kubectl set resources -f - --limits "memory=512Mi" --requests "memory=512Mi" --local -o yaml | kubectl create -f -
  210. 209 kubectl get pods httpd -o yaml | less
  211. 210 vim lab6.yaml
  212. 211 kubectl create -f lab6.yaml
  213. 212 kubectl get pods
  214. 213 kubectl get pods webserver -o yaml
  215. 214 history
  216. 215 vim busybox-ready.yaml
  217. 216 kubectl creat -f busybox-ready.yaml
  218. 217 kubectl create -f busybox-ready.yaml
  219. 218 kubectl get pods
  220. 219 kubectl edit pods busybox-ready
  221. 220 kubectl get pods
  222. 221 kubectl exec -it busybox-ready -- touch /tmp/nothing
  223. 222 kubectl get pods
  224. 223 vim nginx-probes.yaml
  225. 224 kubectl create -f nginx-probes.yaml
  226. 225 kubectl get pods
  227. 226 kubectl create deploy -h | less
  228. 227 kubectl create deploy myweb --image=nginx --replicas=3
  229. 228 kubectl describe deploy myweb | less
  230. 229 kubectl get deploy myweb -o yaml | less
  231. 230 kubectl get all
  232. 231 kubectl get all --selector app=myweb
  233. 232 kubectl delete pods myweb-d5b9458bc-5wc98
  234. 233 kubectl get all --selector app=myweb
  235. 234 kubectl run blahpod --image=nginx
  236. 235 kubectl delete pod blahpod
  237. 236 vim redis-deploy.yaml
  238. 237 kubectl create -f redis-deploy.yaml
  239. 238 vim redis-deploy.yaml
  240. 239 kubectl api-versions
  241. 240 vim redis-deploy.yaml
  242. 241 kubectl create -f redis-deploy.yaml
  243. 242 kubectl api-resources | less
  244. 243 kubectl edit deploy redis
  245. 244 kubectl get all --selector app=redis
  246. 245 kubectl delete rs redis-6467896d84
  247. 246 kubectl get all --selector app=redis
  248. 247 kubectl create -h | less
  249. 248 kubectl create deploy -h | less
  250. 249 kubectl create deploy nginxup --image=nginx:1.14 --replicas=7
  251. 250 kubectl get all --selector app=nginxup
  252. 251 kubectl set -h | less
  253. 252 kubectl set image deploy nginxup nginx=nginx:1.17
  254. 253 kubectl get all --selector app=nginxup
  255. 254 kubectl get all --show-labels
  256. 255 kubectl get deploy redis -o yaml | less
  257. 256 history | grep redis
  258. 257 history | grep apply
  259. 258 vim redis-deploy.yaml
  260. 259 kubectl apply -f redis-deploy.yaml
  261. 260 kubectl get deploy redis2 -o yaml | less
  262. 261 kubectl create deploy bluelabel --image=nginx --replicas=2
  263. 262 kubectl label deployments.apps bluelabel state=demo
  264. 263 kubectl get deploy --show-labels
  265. 264 kubectl get deploy --selector state=demo
  266. 265 kubectl get all --selector state=demo
  267. 266 kubectl get all --selector app=bluelabel
  268. 267 kubectl describe deployments.apps bluelabel
  269. 268 kubectl get pods | grep blue
  270. 269 kubectl label pod bluelabel-d7894847c-c2vb5 app-
  271. 270 kubectl get pods | grep blue
  272. 271 kubectl create deploy -h | less
  273. 272 kubectl create deploy blah --image=nginx --label "state=demo"
  274. 273 kubectl get pods --show-labels
  275. 274 kubectl get pods -l run
  276. 275 kubectl get pods -l run --show-labels
  277. 276 kubectl get pods --show-labels | grep run
  278. 277 kubectl get pods --show-labels | grep run=
  279. 278 ./countdown 14
  280. 279 vim lab9.yaml
  281. 280 kubectl apply -f lab9.yaml
  282. 281 kubectl get all
  283. 282 kubectl get jobs,cronjobs,pods --show-labels
  284. 283 kubectl get jobs,cronjobs,pods | grep kill
  285. 284 vim lab9.yaml
  286. 285 kubectl get -h | less
  287. 286 kubectl get deploy bluelabel -o yaml
  288. 287 oc get deploy
  289. 288 kubectl get deploy
  290. 289 kubectl scale deploy bluelabel --replicas=8
  291. 290 kubectl set env deploy bluelabel type=blended
  292. 291 kubectl get all --selector app=bluelabel
  293. 292 kubectl delete all --all
  294. 293 kubectl get all
  295. 294 vim rolling.yaml
  296. 295 kubectl apply -f rolling.yaml
  297. 296 kubectl rollout history deploy
  298. 297 kubectl edit deploy rolling-nginx
  299. 298 kubectl rollout history deploy
  300. 299 kubectl describe deployments.apps rolling-nginx
  301. 300 kubectl rollout history deployment rolling-nginx --revision=2
  302. 301 kubectl rollout history deployment rolling-nginx --revision=1
  303. 302 kubectl rollout undo deployment rolling-nginx --to-revision=1
  304. 303 kubectl rollout history deploy
  305. 304 ./countdown 1
  306. 305 ./countdown 13
  307. 306 kubectl create deploy nginxsvc --image=nginx
  308. 307 kubectl get all --selector app=nginxsvc
  309. 308 kubectl scale deployment nginxsvc --replicas=3
  310. 309 kubectl expose deploy nginxsvc --port=80
  311. 310 kubectl describe svc nginxsvc
  312. 311 kubectl get svc nginxsvc -o yaml
  313. 312 kubectl get svc
  314. 313 kubectl get endpoints
  315. 314 curl 10.106.169.198
  316. 315 minikube ssh
  317. 316 kubectl edit svc nginxsvc
  318. 317 kubectl get svc
  319. 318 minikube ip
  320. 319 curl 192.168.49.2:31486
  321. 320 kubectl run testpod --image=busybox -- sleep 3600
  322. 321 kubectl get svc
  323. 322 kubectl get svc,pods -n kube-system
  324. 323 kubectl exec -it testpod -- cat /etc/resolv.conf
  325. 324 kubectl exec -it testpod -- nslookup nginxsvc
  326. 325 vim nwpolicy-complete-example.yaml
  327. 326 kubectl expose pod nginx --port=80
  328. 327 kubectl create -f nwpolicy-complete-example.yaml
  329. 328 kubectl expose pod nginx --port=80
  330. 329 kubectl get svc,pods,networkpolicy
  331. 330 kubectl exec -it busybox -- wget --spider --timeout=1 nginx
  332. 331 history
  333. 332 minikube status
  334. 333 minikube addons list
  335. 334 minikube addon enable ingress
  336. 335 minikube addons enable ingress
  337. 336 kubectl get ns
  338. 337 kubectl get pods -n ingress-nginx
  339. 338 source <(kubectl completion bash)
  340. 339 kubectl get deploy
  341. 340 kubectl delete deployments.apps rolling-nginx
  342. 341 kubectl get svc
  343. 342 curl http://192.168.49.2:31486
  344. 343 kubectl create ingress -h | less
  345. 344 kubectl create ingress nginxsvc-ingress --rule="/=nginxsvc:80" --rule="/hello=newdep:8080"
  346. 345 sudo vim /etc/hosts
  347. 346 kubectl get ingress
  348. 347 curl nginxsvc.info
  349. 348 kubectl describe ingress
  350. 349 kubectl describe svc nginxsvc
  351. 350 kubectl create deployment newdep --image=gcr.io/google-samples/hello-app:2.0
  352. 351 kubectl expose deployment newdep --port=8080
  353. 352 kubectl describe ingress
  354. 353 curl nginxsvc.info/hello
  355. 354 history
  356. 355 kubectl explain pod.spec.volumes | less
  357. 356 vim morevolumes.yaml
  358. 357 kubectl create -f morevolumes.yaml
  359. 358 kubectl get pods morevol2
  360. 359 kubectl describe pods morevol2
  361. 360 kubectl get pods morevol2
  362. 361 kubectl exec -it morevol2 -c centos1 -- touch /centos1/test
  363. 362 kubectl exec -it morevol2 -c centos2 -- ls -l /centos2
  364. 363 date
  365. 364 kubectl exec -it morevol2 -c centos1 -- touch /centos1/testingaain
  366. 365 kubectl exec -it morevol2 -c centos2 -- ls -l /centos2
  367. 366 history
  368. 367 vim pv.yaml
  369. 368 kubectl create -f pv.yaml
  370. 369 kubectl get pv
  371. 370 vim pvc.yaml
  372. 371 kubectl create -f pvc.yaml
  373. 372 kubectl get pvc,pv
  374. 373 kubectl get storageclass
  375. 374 kubectl describe pv pvc-cd6e6d2f-0b74-4dfd-801c-9a515d60cc00
  376. 375 kubectl get pvc,pv
  377. 376 vim pvc-pod.yaml
  378. 377 kubectl create -f pvc-pod.yaml
  379. 378 kubectl get pvc,pv
  380. 379 kubectl describe pv pvc-4d989416-4fcf-494a-9709-7dcbfc96cdce
  381. 380 kubectl exec -it nginx-pvc-pod -- touch /usr/share/nginx/html/testfileZ
  382. 381 minikube ssh
  383. 382 ./countdown 1
  384. 383 kubectl explain persistentvolume.spec.csi
  385. 384 ./countdown 13
  386. 385 kubectl create deploy mydb --image=mariadb
  387. 386 kubectl get all
  388. 387 kubectl describe pods mydb-c8bddc94c-nb8mv
  389. 388 kubectl logs mydb-c8bddc94c-nb8mv
  390. 389 kubectl set env deploy mydb MARIADB_ROOT_PASSWORD=password
  391. 390 kubectl get all
  392. 391 kubectl get deploy mydb -o yaml > mydb.yaml
  393. 392 vim mydb.yaml
  394. 393 vim varsfile
  395. 394 kubectl create cm mydbvars --from-env-file=varsfile
  396. 395 kubectl describe cm mydbvars
  397. 396 kubectl delete deploy mydb
  398. 397 kubectl create deploy mydb --image=mariadb --replicas=3
  399. 398 kubectl get all --selector app=mydb
  400. 399 kubectl set env deploy mydb --from=configmap/mydbvars
  401. 400 kubectl get all --selector app=mydb
  402. 401 kubectl get deploy mydb -o yaml
  403. 402 echo hello world > index.html
  404. 403 kubectl create cm myindex --from-file=index.html
  405. 404 kubectl describe cm myindex
  406. 405 kubectl create cm mypasswd --from-file=/etc/passwd
  407. 406 kubectl describe cm mypasswd
  408. 407 kubectl create deployment myweb --image=nginx
  409. 408 kubectl edit deploy myweb
  410. 409 kubectl get all
  411. 410 kubectl exec -it myweb -- cat /usr/share/nginx/html/index.html
  412. 411 kubectl exec -it myweb-859f554699-jqng6 -- cat /usr/share/nginx/html/index.html
  413. 412 kubectl create secret -h
  414. 413 kubectl create secret generic dbpw --from-literal=ROOT_PASSWORD=password
  415. 414 kubectl describe secret dbpw
  416. 415 kubectl get secret dbpw -o yaml
  417. 416 echo cGFzc3dvcmQ= | base64 -d
  418. 417 kubectl delete deployments.apps mydb
  419. 418 kubectl create deployment mynewdb --image=mariadb
  420. 419 kubectl set env deploy mynewdb --from=secret/dbpw --prefix=MYSQL_
  421. 420 history
  422. 421 ./countdown 1
  423. 422 kubectl api-resources | less
  424. 423 vim redis-deploy.yaml
  425. 424 kubectl config view
  426. 425 kubectl proxy --port=8001 &
  427. 426 kubectl create deploy curlginx --image=nginx --replicas=3
  428. 427 curl http://localhost:8001/version
  429. 428 curl http://localhost:8001/api/v1/namespaces/default/pods
  430. 429 curl http://localhost:8001/api/v1/namespaces/default/pods/testpod
  431. 430 curl h-XDELETE ttp://localhost:8001/api/v1/namespaces/default/pods/testpod
  432. 431 curl h-XDELETE http://localhost:8001/api/v1/namespaces/default/pods/testpod
  433. 432 curl -XDELETE http://localhost:8001/api/v1/namespaces/default/pods/testpod
  434. 433 kubectl get pods
  435. 434 kubectl auth can-i get pods
  436. 435 kubectl auth can-i get pods --as bob
  437. 436 ./countdown 13
  438. 437 vim mypod.yaml
  439. 438 kubectl apply -f mypod.yaml
  440. 439 kubectl get pods mypod -o yaml | grep ervice
  441. 440 kubectl get sa
  442. 441 kubectl get sa -A
  443. 442 kubectl exec -it mypod -- sh
  444. 443 cd
  445. 444 cd Downloads/
  446. 445 ls
  447. 446 tar xvf helm-v3.10.1-linux-amd64.tar.gz
  448. 447 sudo mv linux-amd64/helm /usr/local/bin/
  449. 448 helm version
  450. 449 kubectl get ns
  451. 450 history
  452.  
  453. ####AIO COMMANDS
  454. student@student-virtual-machine:~/ckad$ history
  455. 1 history
  456. 2 sudo apt install vim git -y
  457. 3 git clone https://github.com/sandervanvugt/cka
  458. 4 cd cka
  459. 5 ls
  460. 6 sudo ./setup-container.sh
  461. 7 sudo ./setup-kubetools.sh
  462. 8 sudo kubeadm init
  463. 9 mkdir -p $HOME/.kube
  464. 10 kubectl get all
  465. 11 kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
  466. 12 kubectl get pods -n kube-system
  467. 13 source <(kubectl completion bash)
  468. 14 kubectl edit nodes student-virtual-machine
  469. 15 kubectl get pods -n kube-system
  470. 16 kubectl create deploy --image=nginx
  471. 17 kubectl create deploy testdep --image=nginx
  472. 18 kubectl get all
  473. 19 history
  474. 20 sudo poweroff
  475. 21 history
  476. 22 cd ckad
  477. 23 ls
  478. 24 git clone https://github.com/sandervanvugt/ckad
  479. 25 cd ckad
  480. 26 kubectl apply -f mypod.yaml
  481. 27 kubectl exec -it mypod -- sh
  482. 28 kubectl get pods -n kube-system
  483. 29 ping dl-cdn.alpinelinux.org
  484. 30 kubectl get pods -o wide
  485. 31 kubectl exec -it mypod -- sh
  486. 32 vim list-pods.yaml
  487. 33 vim list-pods-mysa-binding.yaml
  488. 34 kubectl create sa mysa
  489. 35 vim mysapod.yaml
  490. 36 kubectl get sa
  491. 37 kubectl get sa -n secret
  492. 38 vim mysapod.yaml
  493. 39 ./countdown 1
  494. 40 cd ../Downloads/
  495. 41 ls
  496. 42 tar xvf helm-v3.10.1-linux-amd64.tar.gz
  497. 43 sudo cp linux-amd64/helm /usr/local/bin/
  498. 44 kubectl get ns
  499. 45 helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
  500. 46 helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard
  501. 47 export POD_NAME=$(kubectl get pods -n default -l "app.kubernetes.io/name=kubernetes-dashboard,app.kubernetes.io/instance=kubernetes-dashboard" -o jsonpath="{.items[0].metadata.name}")
  502. 48 echo $POD_NAME
  503. 49 kubectl get pods
  504. 50 kubectl -n default port-forward $POD_NAME 8443:8443
  505. 51 bg
  506. 52 cp ~/.kube/config ~/
  507. 53 cd
  508. 54 kubectl get all
  509. 55 history | less
  510. 56 ls -l .kube/config
  511. 57 mkdir .dummy
  512. 58 sudo /etc/kubernetes/admin.conf .dummy/
  513. 59 sudo cp /etc/kubernetes/admin.conf .dummy/
  514. 60 chown student:student .dummy/admin.conf
  515. 61 sudo chown student:student .dummy/admin.conf
  516. 62 cd .dummy/
  517. 63 ls -l
  518. 64 mv admin.conf config
  519. 65 cd
  520. 66 helm repo add bitnami https://charts.bitnami.com/bitnami
  521. 67 helm repo list
  522. 68 helm search repo bitnami
  523. 69 helm repo update
  524. 70 helm install bitnami/mysql --generate-name
  525. 71 kubectl get all
  526. 72 helm show chart bitnami/mysql
  527. 73 helm show all bitnami/mysql
  528. 74 helm list
  529. 75 helm status mysql-1665680527
  530. 76 helm show values bitnami/nginx
  531. 77 helm pull bitnami/nginx
  532. 78 ls
  533. 79 tar xvf nginx-13.2.10.tgz
  534. 80 vim nginx/values.yaml
  535. 81 helm template --debug nginx
  536. 82 helm install -f nginx/values.yaml my-nginx nginx/
  537. 83 cd ckad/
  538. 84 ./countdown 12
  539. 85 kubectl create deploy blue-nginx --image=nginx:1.14 --replicas=3
  540. 86 kubectl expose deploy blue-nginx --port=80 --name=bgnginx
  541. 87 source <(kubectl completion bash)
  542. 88 kubectl get deploy blue-nginx -o yaml > green-nginx.yaml
  543. 89 vim green-nginx.yaml
  544. 90 kubectl create -f green-nginx.yaml
  545. 91 kubectl get pods
  546. 92 kubectl delete svc bgnginx; kubectl expose deploy green-nginx --port=80 --name=bgnginx
  547. 93 kubectl get endpoints
  548. 94 kubectl get pods -o wide
  549. 95 kubectl scale deploy blue-nginx --replicas=0
  550. 96 kubectl get deploy green-nginx -o yaml > green.yaml
  551. 97 vim green.yaml
  552. 98 kubectl create deploy old-nginx --image=nginx:1.14 --replicas=3 --dry-run=client -o yaml > ~/oldnginx.yaml
  553. 99 vim ~/oldnginx.yaml
  554. 100 kubectl create -f ~/oldnginx.yaml
  555. 101 kubectl expose deploy old-nginx --name=oldnginx --port=80 --selector type=canary
  556. 102 kubectl get svc,endpoints
  557. 103 minikube ssh
  558. 104 curl 10.103.42.159
  559. 105 kubectl cp old-nginx-9b8576459-cwpc2:/usr/share/nginx/html/index.html index.html
  560. 106 vim index.html
  561. 107 kubectl create cm canary --from-file=index.html
  562. 108 kubectl describe cm canary
  563. 109 vim canary.yaml
  564. 110 kubectl create -f canary.yaml
  565. 111 kubectl get svc,endpoints
  566. 112 curl 10.103.42.159
  567. 113 kubectl scale deployment new-nginx --replicas=3
  568. 114 curl 10.103.42.159
  569. 115 kubectl scale deployment old-nginx --replicas=0
  570. 116 curl 10.103.42.159
  571. 117 ./countdown 1
  572. 118 history
  573. 119 cat crd-object.yaml
  574. 120 kubectl create -f crd-object.yaml
  575. 121 kubectl api-resources | grep backup
  576. 122 cat crd-backup.yaml
  577. 123 kubectl create -f crd-backup.yaml
  578. 124 kubectl get backups
  579. 125 kubectl get backups -o yaml
  580. 126 kubectl api-resources | grep crd
  581. 127 history
  582.  
Add Comment
Please, Sign In to add comment