Advertisement
chestnutj2000

CKAD Sander Day 2 July 2020

Jul 21st, 2020
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. statefulsets.apps
  2. storageclasses.storage.k8s.io
  3. validatingwebhookconfigurations.admissionregistration.k8s.io
  4. volumeattachments.storage.k8s.io
  5. [student@localhost ckad]$ history
  6. 1 sudo dnf install -y vim git
  7. 2 git clone https://github.com/sandervanvugt/ckad
  8. 3 sudo -i
  9. 4 history
  10. 5 sudo -i
  11. 6 cd ckad/
  12. 7 vim sidecar.yaml
  13. 8 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  14. 9 kubectl get pods
  15. 10 minikube status
  16. 11 minikube start
  17. 12 vim sidecar.yaml
  18. 13 kubectl exec -it sidecar-pod -c sidecar -- /bin/bash
  19. 14 history | grep git
  20. 15 ls
  21. 16 kubectl explain pods
  22. 17 kubectl explain pods.spec
  23. 18 kubectl explain pods.spec.volumes
  24. 19 vim sidecar.yaml
  25. 20 kubectl exec -h | less
  26. 21 kubectl get pods
  27. 22 vim sidecar.yaml
  28. 23 vim initpod.yaml
  29. 24 kubectl create -f initpod.yaml
  30. 25 kubectl get pods
  31. 26 kubectl completion -h
  32. 27 source <(kubectl completion bash)
  33. 28 kubectl describe pods init-demo
  34. 29 kubectl get pods -h | less
  35. 30 kubectl get pods -o wide
  36. 31 kubectl describe pods init-demo
  37. 32 kubectl get events
  38. 33 kubectl get events -A
  39. 34 kubectl run nginx-lab --image nginx
  40. 35 kubectl get pods
  41. 36 kubectl get pods init-demo -o yaml | less
  42. 37 kubectl get pods.spec.restartpolicy
  43. 38 kubectl explain pods.spec.restartpolicy
  44. 39 kubectl explain pods.spec.restartPolicy
  45. 40 kubectl explain pods.spec.containers
  46. 41 ls
  47. 42 vim initpod.yaml
  48. 43 kubectl create -f initpod.yaml
  49. 44 vim initpod.yaml
  50. 45 kubectl create -f initpod.yaml
  51. 46 kubectl get pods
  52. 47 kubectl describe init-fail
  53. 48 kubectl describe pods init-fail
  54. 49 kubectl get pods
  55. 50 kubectl delete pods init-fail
  56. 51 kubectl get pods
  57. 52 kubectl exec -it busybox2 sh
  58. 53 kubectl get pods
  59. 54 kubectl logs busybox2
  60. 55 kubectl logs nginx-lab
  61. 56 kubectl logs sidecar-pod
  62. 57 kubectl logs sidecar-pod -c app
  63. 58 kubectl logs sidecar-pod -c sidecar
  64. 59 kubectl -h | less
  65. 60 ./countdown 12
  66. 61 kubectl logs -h | less
  67. 62 kubectl logs --all-containers
  68. 63 kubectl logs -h | less
  69. 64 kubectl get pods --show-labels
  70. 65 kubectl logs --selector=k8s-app=dashnginx
  71. 66 ls
  72. 67 kubectl get pods
  73. 68 kubectl port-forward pod/nginx-lab 8080:80
  74. 69 bg
  75. 70 curl http://localhost:8080
  76. 71 kubectl port-forward pod/nginx-lab 8080:80 -o yaml --dry-run
  77. 72 kubectl explain pod.spec
  78. 73 kubectl explain pod.spec.securityContext
  79. 74 kubectl explain pod.spec.containers.securityContext
  80. 75 history
  81. 76 vim securitycontextdemo.yaml
  82. 77 kubectl apply -f securitycontextdemo.yaml
  83. 78 kubectl get pods
  84. 79 kubectl describe pods nginxsecure
  85. 80 kubectl port-forward -h | less
  86. 81 sudo iptables -L
  87. 82 vim simplejob.yaml
  88. 83 kubectl create -f simplejob.yaml
  89. 84 kubectl get jobs
  90. 85 kubectl get pods
  91. 86 kubectl get jobs
  92. 87 kubectl get jobs simple-job -o yaml
  93. 88 vim simplejob.yaml
  94. 89 kubectl create -f simplejob.yaml
  95. 90 kubectl delete jobs.batch simple-job
  96. 91 kubectl get pods
  97. 92 kubectl create -f simplejob.yaml
  98. 93 kubectl get jobs
  99. 94 kubectl get pods
  100. 95 kubectl get all
  101. 96 kubectl explain CronJob.spec
  102. 97 kubectl explain CronJob.spec.schedule
  103. 98 vim cron-example.yaml
  104. 99 kubectl apply -f cron-example.yaml
  105. 100 kubectl get cronjobs.batch hello
  106. 101 kubectl get jobs
  107. 102 kubectl get pods
  108. 103 kubectl logs hello-1595346
  109. 104 kubectl logs hello-1595346360-gj54c
  110. 105 kubectl get jobs
  111. 106 kubectl delete cronjobs.batch hello
  112. 107 vim cron-example.yaml
  113. 108 kubectl explain pods.spec.containers.command
  114. 109 kubectl explain pods.spec.containers.args
  115. 110 vim frontend-resources.yaml
  116. 111 kubectl create -f frontend-resources.yaml
  117. 112 vim frontend-resources.yaml
  118. 113 kubectl get pods
  119. 114 kubectl describe frontend
  120. 115 kubectl describe pods frontend
  121. 116 kubectl logs frontend -c db
  122. 117 kubectl delete pod frontend
  123. 118 vim frontend-resources.yaml
  124. 119 kubectl create -f frontend-resources.yaml
  125. 120 kubectl describe pod frontend
  126. 121 kubectl get pods
  127. 122 kubectl delete pod frontend --grace-period=0 --force
  128. 123 ./countdown 14
  129. 124 kubectl get all --all-namespaces
  130. 125 kubectl get all --namespace=kube-system
  131. 126 kubectl create ns secret
  132. 127 kubectl get ns secret -o yaml
  133. 128 vim busybox-ns.yaml
  134. 129 kubectl create -f busybox-ns.yaml
  135. 130 kubectl config set-context --current --namespace=secret
  136. 131 kubectl config
  137. 132 kubectl config viewq
  138. 133 kubectl config view
  139. 134 kubectl create -f busybox-ns.yaml
  140. 135 kubectl config view --minify
  141. 136 kubectl config view --minify | grep secret
  142. 137 kubectl config view | grep secret
  143. 138 kubectl config view
  144. 139 kubectl config set-context --current --namespace=default
  145. 140 kubectl get ns secret -o yaml
  146. 141 kubectl explain deployments.spec | less
  147. 142 kubectl delete ns secret
  148. 143 kubectl get pods -A
  149. 144 kubectl get pods -A | grep busy
  150. 145 kubectl create nginxblah --image=nginx
  151. 146 kubectl create deployment nginxblah --image=nginx
  152. 147 kubectl get do
  153. 148 kubectl get deployments.apps
  154. 149 kubectl get deployments.apps nginxblah -o yaml | less
  155. 150 kubectl get all --selector app=nginxblah
  156. 151 kubectl get all --selector app=nginxblah --show-labels
  157. 152 kubectl delete pod nginxblah-7d698f57d-g5h5v
  158. 153 kubectl get all --selector app=nginxblah --show-labels
  159. 154 kubectl explain replicaset
  160. 155 kubectl explain replicaset.spec
  161. 156 kubectl explain deployment.spec | less
  162. 157 kubectl api-resources | less
  163. 158 kubectl edit deployments.apps nginxblah
  164. 159 kubectl get all --selector app=nginxblah --show-labels
  165. 160 kubectl scale deployment --replicas=0
  166. 161 kubectl scale deployment nginxblah --replicas=0
  167. 162 kubectl get all --selector app=nginxblah --show-labels
  168. 163 kubectl scale deployment nginxblah --replicas=3
  169. 164 vim redis-deploy.yaml
  170. 165 kubectl create -f redis-deploy.yaml
  171. 166 vim redis-deploy.yaml
  172. 167 kubectl explain deployment
  173. 168 vim redis-deploy.yaml
  174. 169 kubectl create -f redis-deploy.yaml
  175. 170 kubectl edit redis-deploy.yaml
  176. 171 kubectl edit deployment redis-deploy.yaml
  177. 172 kubectl edit deployment redis
  178. 173 kubectl scale deployment redis --replicas=5
  179. 174 kubectl delete deployments.apps redis
  180. 175 kubectl explain statefullset
  181. 176 kubectl explain statefulset
  182. 177 kubectl get all --namespace=kube-system
  183. 178 vim rolling.yaml
  184. 179 kubectl create -f rolling.yaml
  185. 180 kubectl rollout history deployment rolling-nginx
  186. 181 kubectl edit deployments.apps rolling-nginx
  187. 182 kubectl get pods
  188. 183 kubectl get rs
  189. 184 kubectl rollout history deployment rolling-nginx
  190. 185 kubectl rollout history deployment rolling-nginx --revision=2
  191. 186 kubectl rollout history deployment rolling-nginx --revision=1
  192. 187 kubectl rollout undo deployment rolling-nginx --to-revision=1
  193. 188 kubectl get rs
  194. 189 ./countdown 12
  195. 190 kubectl get pods --show-labels
  196. 191 kubectl label pod rolling-nginx-6f55c5bb8b-64s9q app-
  197. 192 kubectl get pods --show-labels | grep rolling
  198. 193 kubectl get all | grep ghost
  199. 194 grep ghost *
  200. 195 kubectl create deployment spook --image=ghost
  201. 196 kubectl get deployments.apps --show-labels
  202. 197 kubectl label deployments.apps spook state=demo
  203. 198 kubectl get deployments.apps --show-labels
  204. 199 kubectl get deployments.apps --selector state=demo
  205. 200 kubectl run nginx --image=nginx
  206. 201 kubectl describe pod nginx
  207. 202 kubectl get pods --show-labels | grep nginx
  208. 203 kubectl label pod nginx run-
  209. 204 kubectl get pods --show-labels | grep nginx
  210. 205 kubectl get pods --show-labels | grep run=
  211. 206 kubectl get deploy
  212. 207 kubectl expose -h | less
  213. 208 kubectl expose deployment rolling-nginx --port=8088 --target-port=80
  214. 209 kubectl get deployments.apps --show-labels
  215. 210 kubectl get svc rolling-nginx
  216. 211 kubectl expose deployment nginxblah --port=8089 --target-port=80
  217. 212 kubectl get all --selector app-nginxblah
  218. 213 kubectl get all --selector app=nginxblah
  219. 214 kubectl describe svc nginxblah
  220. 215 kubectl label -h | less
  221. 216 history
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement