Advertisement
sandervanvugt

Kube3weeks march23 day2

Mar 17th, 2023
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.33 KB | None | 0 0
  1. student@control:~/kube3weeks$ history
  2. 1 exit
  3. 2 free -m
  4. 3 lscpu | less
  5. 4 df -h
  6. 5 git clone https://github.com/sandervanvugt/kube3weeks
  7. 6 cd kube3weeks/
  8. 7 ./countdown 15
  9. 8 ls -l *sh
  10. 9 cd ..
  11. 10 cd kube3weeks/
  12. 11 git pull
  13. 12 history
  14. 13 vim setup-container.sh
  15. 14 ./setup-container.sh
  16. 15 sudo systemctl status containerd
  17. 16 history
  18. 17 ./setup-kubetools.sh
  19. 18 sudo ./setup-kubetools.sh
  20. 19 sudo kubeadm init
  21. 20 mkdir -p $HOME/.kube
  22. 21 kubectl get all
  23. 22 ls cal*
  24. 23 kubectl apply -f calico.yaml
  25. 24 history
  26. 25 sudo systemctl status containerd
  27. 26 free -m
  28. 27 history
  29. 28 kubectl get all
  30. 29 source <(kubectl completion bash)
  31. 30 kubectl create deploy myfirstapp --image=nginx --replicas=3
  32. 31 kubectl get all
  33. 32 history
  34. 33 kubectl get all
  35. 34 kubectl delete pod myfirstapp-ff8c4b4d4-fkg4h
  36. 35 kubectl get all
  37. 36 history
  38. 37 kubectl run lonelypod --image=nginx
  39. 38 kubectl get all
  40. 39 kubectl delete pod lonelypod
  41. 40 kubectl get all
  42. 41 history
  43. 42 sudo systemctl status containerd
  44. 43 sudo systemctl status kubelet
  45. 44 kubectl get pods -n kube-system
  46. 45 kubectl get all
  47. 46 kubectl config view
  48. 47 kubectl get nodes
  49. 48 kubectl edit nodes control
  50. 49 kubectl get all
  51. 50 history | grep create depl
  52. 51 history | grep 'create depl'
  53. 52 kubectl api-resources | less
  54. 53 kubectl explain pod.spec
  55. 54 kubectl explain pod.spec | less
  56. 55 history
  57. 56 kubectl run mynginx --image=nginx --dry-run=client -o yaml
  58. 57 kubectl run mynginx --image=nginx --dry-run=client -o yaml > mynginx.yaml
  59. 58 kubectl explain pods.spec
  60. 59 kubectl explain pods.spec.volumes
  61. 60 kubectl apply -f mynginx.yaml
  62. 61 kubectl create -f mynginx.yaml
  63. 62 kubectl get pods
  64. 63 kubectl delete -f mynginx.yaml
  65. 64 ./countdown 13
  66. 65 vim multicontainer.yaml
  67. 66 kubectl apply -f multicontainer.yaml
  68. 67 kubectl get pods
  69. 68 vim initcontainer.yaml
  70. 69 kubectl create -f initcontainer.yaml
  71. 70 kubectl get pods
  72. 71 kubectl get ns
  73. 72 kubectl get pods
  74. 73 kubectl get pods -n kube-system
  75. 74 kubectl create ns myns
  76. 75 kubectl get ns
  77. 76 kubectl run mypod --image=nginx -n myns
  78. 77 kubectl get pods
  79. 78 kubectl get pods -n myns
  80. 79 kubectl get pods -A
  81. 80 history
  82. 81 kubectl config set-context --current namespace=myns
  83. 82 kubectl config set-context --current --namespace=myns
  84. 83 kubectl get pods
  85. 84 kubectl config set-context --current --namespace=default
  86. 85 kubectl get pdos
  87. 86 kubectl get pods
  88. 87 kubectl config view
  89. 88 history
  90. 89 kubectl run mydb --image=mariadb
  91. 90 kubectl get pods
  92. 91 kubectl describe pods mydb
  93. 92 kubectl get pods
  94. 93 kubectl describe pod mydb | less
  95. 94 history
  96. 95 kubectl logs mydb
  97. 96 kubectl delete pod mydb
  98. 97 kubectl run -h | less
  99. 98 kubectl run dbsdb --image=mariadb --env MARIADB_ROOT_PASSWORD=password
  100. 99 kubectl get pods
  101. 100 ls
  102. 101 cd ..
  103. 102 cd kube3weeks/
  104. 103 git pull
  105. 104 vim frontend-resources.yaml
  106. 105 kubectl apply -f frontend-resources.yaml
  107. 106 kubectl get pods
  108. 107 kubectl describe pod frontend
  109. 108 vim frontend-resources.yaml
  110. 109 kubectl delete pod frontend
  111. 110 kubectl apply -f frontend-resources.yaml
  112. 111 kubectl get pods
  113. 112 kubectl describe pod frontend
  114. 113 kubectl delete pod frontend
  115. 114 kubectl run busy --image=busybox
  116. 115 kubectl get pods
  117. 116 kubectl describe pod busy | less
  118. 117 kubectl logs busy
  119. 118 history
  120. 119 kubectl get pods -o wide
  121. 120 history
  122. 121 sudo poweroff
  123. 122 cd kube3weeks/
  124. 123 ./countdown 15
  125. 124 kubectl get all
  126. 125 source <(kubectl completion bash)
  127. 126 kubectl get deploy
  128. 127 kubectl delete deploy myfirstapp
  129. 128 kubectl create deploy mynginx --image=nginx --replicas=3
  130. 129 kubectl get all
  131. 130 kubectl delete pod mynginx-56766fcf49-88vjj
  132. 131 kubectl get all
  133. 132 kubectl scale deploy mynginx --replicas=4
  134. 133 kubectl get all
  135. 134 kubectl scale deploy mynginx --replicas=0
  136. 135 history
  137. 136 kubectl get all
  138. 137 kubectl edit deploy mynginx
  139. 138 kubectl create deploy oldnginx --image=nginx:1.14 --replicas=3
  140. 139 kubectl get all --selector app=oldnginx
  141. 140 kubectl set image deploy oldnginx nginx=nginx:latest
  142. 141 kubectl get all --selector app=oldnginx
  143. 142 kubectl rollout status
  144. 143 kubectl rollout status deployment oldnginx
  145. 144 kubectl rollout history deployment oldnginx
  146. 145 kubectl get all --selector app=oldnginx -o wide
  147. 146 kubectl edit deployments.apps oldnginx
  148. 147 kubectl get deploy oldnginx -o yaml
  149. 148 kubectl create deploy lnginx --image=nginx --replicas=3
  150. 149 kubectl get all --show-labels
  151. 150 kubectl get all --selector app=lnginx
  152. 151 kubectl label pod lnginx-54d4579875-2jwjt app-
  153. 152 kubectl get all
  154. 153 kubectl delete pod lnginx-54d4579875-2jwjt
  155. 154 kubectl get all
  156. 155 history
  157. 156 kubectl get deploy
  158. 157 kubectl delete deploy lnginx mynginx oldnginx
  159. 158 kubectl create deploy daemondemo --image=nginx --dry-run=client -o yaml > daemondemo.yaml
  160. 159 vim daemondemo.yaml
  161. 160 kubectl apply -f daemondemo.yaml
  162. 161 kubectl get daemonset
  163. 162 kubectl get all --selector app=daemondemo
  164. 163 kubectl get all --selector app=daemondemo -o wide
  165. 164 history
  166. 165 vim daemondemo.yaml
  167. 166 kubectl edit nodes control
  168. 167 kubectl create deploy nginxsvc --image=nginx
  169. 168 kubectl scale deploy nginxsvc --replicas 3
  170. 169 kubectl get all --selector app=nginxsvc
  171. 170 kubectl expose deploy nginxsvc --port=80
  172. 171 kubectl get all --selector app=nginxsvc
  173. 172 kubectl describe svc nginxsvc
  174. 173 kubectl get svc
  175. 174 kubectl get enpoints
  176. 175 kubectl get endpoints
  177. 176 curl 10.109.60.162
  178. 177 kubectl edit svc nginxsvc
  179. 178 kubectl get svc
  180. 179 ip a
  181. 180 history
  182. 181 kubectl edit svc nginxsvc
  183. 182 kubectl get svc
  184. 183 kubectl edit svc nginxsvc
  185. 184 kubectl get svc
  186. 185 kubectl edit svc nginxsvc
  187. 186 kubectl get svc
  188. 187 kubectl edit svc nginxsvc
  189. 188 kubectl get svc
  190. 189 kubectl edit svc nginxsvc
  191. 190 cat daemondemo.yaml
  192. 191 kubectl get svc
  193. 192 kubectl run testpod --image=busybox -- sh
  194. 193 kubectl exec -it testpod -- sh
  195. 194 kubectl delete pod testpod
  196. 195 kubectl run -it testpod --image=busybox -- sh
  197. 196 kubectl run -it testpod --image=sandervanvugt/gittools -- sh
  198. 197 kubectl run -it testpod2 --image=sandervanvugt/gittools -- sh
  199. 198 reset
  200. 199 kubectl get pods
  201. 200 kubectl delete pod testpod
  202. 201 kubectl delete pod testpod2
  203. 202 kubectl run -it testpod --image=busybox -- sh
  204. 203 kubectl get svc
  205. 204 kubectl get svc -A
  206. 205 history
  207. 206 ls
  208. 207 tar xvf helm-v3.11.2-linux-amd64.tar.gz
  209. 208 ls -l linux-amd64/helm
  210. 209 sudo cp linux-amd64/helm /usr/local/bin
  211. 210 helm version
  212. 211 helm upgrade --install ingress-nginx ingress-nginx --repo https://kubernetes.github.io/ingress-nginx --namespace ingress-nginx --create-namespace
  213. 212 kubectl get all -n ingress-nginx
  214. 213 kubectl get all --selector app=nginxsvc
  215. 214 kubectl create ingress nginxsvc --class=nginx --rule=nginxsvc.info/*=nginxsvc:80
  216. 215 kubectl port-forward -n ingress-nginx svc/ingress-nginx-controller 8080:80
  217. 216 bg
  218. 217 history
  219. 218 sudo vim /etc/hosts
  220. 219 curl nginxsvc.info:8080
  221. 220 history
  222. 221 kubectl get ing,svc,pods --selector app=nginxsvc
  223. 222 kubectl get ing,svc,pods
  224. 223 kubectl describe ing nginxsvc
  225. 224 history
  226. 225 helm version
  227. 226 kubectl explain pods.spec.volumes | less
  228. 227 cd kube3weeks/
  229. 228 ls
  230. 229 vim morevolumes.yaml
  231. 230 kubectl apply -f morevolumes.yaml
  232. 231 kubectl get pods
  233. 232 kubectl get pods -o wide
  234. 233 kubectl describe pod morevol2
  235. 234 kubectl exec -it morevol2 -c centos1 -- touch /centos1/testfile
  236. 235 kubectl exec -it morevol2 -c centos2 -- ls /centos2
  237. 236 history
  238. 237 vim pv.yaml
  239. 238 kubectl apply -f pv.yaml
  240. 239 kubectl get pv
  241. 240 vim pvc.yaml
  242. 241 kubectl apply -f pvc.yaml
  243. 242 kubectl get pvc,pv
  244. 243 kubectl describe pv
  245. 244 vim pv-pod.yaml
  246. 245 kubectl apply -f pv-pod.yaml
  247. 246 kubectl get pods
  248. 247 kubectl exec -it pv-pod -- touch /usr/share/nginx/html/hello.txt
  249. 248 kubectl get pods -o wide
  250. 249 ssh student@192.168.29.41
  251. 250 ls
  252. 251 vim pv-pvc-pod.yaml
  253. 252 history
  254. 253 kubectl get pods -o wide
  255. 254 kubectl describe pod pv-pod
  256. 255 kubectl get pvc,pv
  257. 256 kubectl describe pv pv-volume
  258. 257 kubectl get pods -o wide
  259. 258 ssh 192.168.29.41
  260. 259 sudo apt install nfs-server -y
  261. 260 sudo mkdir /nfsexport
  262. 261 sudo vim /etc/exports
  263. 262 sudo systemctl restart nfs-server
  264. 263 showmount -e localhost
  265. 264 sudo vim /etc/hosts
  266. 265 helm repo add nfs-subdir-external-provisioner https://kubernetes-sigs.github.io/nfs-subdir-external-provisioner/
  267. 266 helm install nfs-subdir-external-provisioner nfs-subdir-external-provisioner/nfs-subdir-external-provisioner --set nfs.server=192.168.29.40 --set nfs.path=/nfsexport
  268. 267 kubectl get all
  269. 268 kubectl get pods -n kube-system
  270. 269 kubectl get pv
  271. 270 vim nfs-provisioner-pvc-test.yaml
  272. 271 kubectl get storageclass
  273. 272 kubectl describe storageclass nfs-client
  274. 273 kubectl edit storageclasses.storage.k8s.io nfs-client
  275. 274 kubectl apply -f nfs-provisioner-pvc-test.yaml
  276. 275 kubectl get pvc,pv
  277. 276 vim nfs-provisioner-pvc-test.yaml
  278. 277 kubectl apply -f nfs-provisioner-pvc-test.yaml
  279. 278 kubectl get pvc,pv
  280. 279 ls /nfsexport/
  281. 280 history
  282. 281 ./countdown 1
  283. 282 cat /etc/exports
  284. 283 history
  285. 284 tail -n /etc/exports
  286. 285 tail -1 /etc/exports
  287. 286 cat /etc/hosts
  288. 287 helm repo add kubernetes-dashboard https://kubernetes.github.io/dashboard/
  289. 288 helm install kubernetes-dashboard kubernetes-dashboard/kubernetes-dashboard
  290. 289 kubectl get all
  291. 290 kubectl edit deploy kubernetes-dashboard
  292. 291 kubectl get all
  293. 292 kubectl get pods
  294. 293 kubectl get svc
  295. 294 kubectl edit svc kubernetes-dashboard
  296. 295 kubectl get svc
  297. 296 echo RBAC PROBLEM ON DASHBOARDkubectl get svc!
  298. 297 history
  299.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement