sandervanvugt

microservices july23

Jul 27th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.83 KB | None | 0 0
  1. student@student-virtual-machine:~$ history
  2. 1 minikube start --vm-driver=docker --cni=calico --memory=6G
  3. 2 kubectl get all
  4. 3 history
  5. 4 source <(kubectl completion bash)
  6. 5 kubectl create deployment mynginx --image=nginx --replicas=3
  7. 6 kubectl get all
  8. 7 kubectl describe pod mynginx-55cd454cfc-b4xgd
  9. 8 docker login
  10. 9 kubectl create secret -h | less
  11. 10 kubectl create secret docker-registry -h | less
  12. 11 kubectl create secret docker-registry dockersecret --from-file=.dockerconfigjson=/home/student/.docker/config.json
  13. 12 kubectl get all
  14. 13 kubectl delete deploy mynginx
  15. 14 kubectl create deploy mynginx --image=nginx --replicas=3 --dry-run=client -o yaml > mynginx.yaml
  16. 15 vim mynginx.yaml
  17. 16 kubectl explain deploy.spec.template.spec | less
  18. 17 vim mynginx.yaml
  19. 18 kubectl explain deploy.spec.template.spec | less
  20. 19 vim mynginx.yaml
  21. 20 kubectl apply -f mynginx.yaml
  22. 21 vim mynginx.yaml
  23. 22 kubectl apply -f mynginx.yaml
  24. 23 kubectl get all
  25. 24 kubectl describe pod mynginx-64f7c5487c-7pqpp
  26. 25 kubectl get all
  27. 26 kubectl describe pod mynginx-64f7c5487c-7pqpp
  28. 27 kubectl get all
  29. 28 vim mynginx.yaml
  30. 29 kubectl create testpod --image=quay.io/bitnami/nginx
  31. 30 kubectl create deploy testpod --image=quay.io/bitnami/nginx
  32. 31 kubectl get all
  33. 32 kubectl create deploy othertest --image=nginx:1.17 --replicas=3 --dry-run=client -o yaml > othertest.yaml
  34. 33 vim othertest.yaml
  35. 34 kubectl apply -f othertest.yaml
  36. 35 kubectl get all
  37. 36 kubectl describe pod testpod-788b4c8564-8qp9q
  38. 37 minikube stop
  39. 38 minikube delete
  40. 39 minikube start --mem=6G
  41. 40 history | grep minikube
  42. 41 minikube start --memory=6G
  43. 42 kubectl get all
  44. 43 kubectl create deploy testone --image=nginx
  45. 44 kubectl create secret docker-registry dockersecret --from-file=.dockerconfigjson=/home/student/.docker/config.json
  46. 45 kubectl get all
  47. 46 kubectl delete deploy testone
  48. 47 kubectl create deploy testone --image=nginx --dry-run=client -o yaml > testone.yaml
  49. 48 vim testone.yaml
  50. 49 kubectl apply -f testone.yaml
  51. 50 kubectl create deploy testtwo --image=bitnami/nginx
  52. 51 kubectl get all
  53. 52 history
  54. 53 ls
  55. 54 kubectl explain pod.spec.volumes | less
  56. 55 vim pvc.yaml
  57. 56 kubectl get pvc,pv
  58. 57 kubectl apply -f pvc.yaml
  59. 58 kubectl get pvc,pv
  60. 59 kubectl get storageclass
  61. 60 vim pv.yaml
  62. 61 kubectl apply -f pv.yaml
  63. 62 kubectl get pvc,pv
  64. 63 vim pv-pod.yaml
  65. 64 kubectl apply -f pv-pod.yaml
  66. 65 kubectl get pods
  67. 66 kubectl create deploy mydb --image=mariadb --replicas=3
  68. 67 kubectl get pods
  69. 68 kubectl describe pod mydb-6875696859-mccsx
  70. 69 kubectl logs mydb-6875696859-tcfdb
  71. 70 kubectl create cm mydbcm --from-literal=MARIADB_ROOT_PASSWORD=password
  72. 71 kubectl describe cm mydbcm
  73. 72 kubectl get pods
  74. 73 kubectl set env --from=configmap/mydbcm deploy/mydb
  75. 74 kubectl get pods
  76. 75 kubectl get pod mydb-779f9766fd-9bk8k -o yaml | less
  77. 76 cat nginx-custom-config.conf
  78. 77 kubectl create cm nginx-cm --from-file nginx-custom-config.conf
  79. 78 kubectl get cm nginx-cm -o yaml
  80. 79 vim nginx-cm.yaml
  81. 80 kubectl apply -f nginx-cm.yaml
  82. 81 kubectl exec -it nginx-cm -- cat /etc/nginx/conf.d/default.conf
  83. 82 ./countdown 12
  84. 83 kubectl create deploy nginxsvc --image=nginx --replicas=3
  85. 84 kubectl get all --selector app=nginxsvc
  86. 85 kubectl expose deploy nginxsvc --port=80
  87. 86 kubectl get svc
  88. 87 curl 10.102.56.211
  89. 88 kubectl edit svc nginxsvc
  90. 89 kubectl get svc
  91. 90 curl $(minikube ip):32065
  92. 91 minikube addons list
  93. 92 minikube addons enable ingress
  94. 93 kubectl get all --selector app=nginxsvc
  95. 94 vim nginxsvc-ingress.yaml
  96. 95 kubectl apply -f nginxsvc-ingress.yaml
  97. 96 kubectl create ing -h | less
  98. 97 #kubectl create ingress ingress1 --class=default \
  99. 98 kubectl get svc
  100. 99 kubectl create ingress ingress1 --class=default --rule="nginxsvc.info/=nginxsvc:80"
  101. 100 sudo vim /etc/hosts
  102. 101 kubectl get ns
  103. 102 kubectl get all -n ingress-nginx
  104. 103 kubectl get ing
  105. 104 curl nginxsvc.info
  106. 105 cat deployment.yaml
  107. 106 cat service.yaml
  108. 107 kubectl apply -f deployment.yaml
  109. 108 kubectl apply -f service.yaml
  110. 109 kubectl get deploy,svc
  111. 110 cat kustomization.yaml
  112. 111 kubectl get deploy,svc --show-labels
  113. 112 kubectl apply -k .
  114. 113 kubectl get deploy,svc --show-labels
  115. 114 kubectl delete deploy --all
  116. 115 kubectl delete svc --all
  117. 116 cd lesson6lab/
  118. 117 ls
  119. 118 vim kustomization.yaml
  120. 119 vim wordpress-deployment.yaml
  121. 120 vim mysql-deployment.yaml
  122. 121 kubectl apply -k .
  123. 122 kubectl get secrets
  124. 123 kubectl get secrets mysql-pass-bc6ggk5g2t -o yaml
  125. 124 echo cGFzc3dvcmQ= | base64 -d
  126. 125 kubectl get deploy
  127. 126 kubectl get pvc
  128. 127 kubectl get svc
  129. 128 minikube service wordpress --url
  130. 129 cd ..
  131. 130 kubectl api-resources | less
  132. 131 curl -L https://istio.io/downloadIstio | sh -
  133. 132 ls
  134. 133 cd istio-1.18.2/
  135. 134 ls
  136. 135 sudo cp bin/istioctl /usr/local/bin/
  137. 136 istioctl
  138. 137 istioctl install --set-profile=demo -y
  139. 138 istioctl install --set profile=demo -y
  140. 139 kubectl get crd
  141. 140 kubectl get all -n istio-system
  142. 141 kubectl get all
  143. 142 kubectl label ns default istio-injection=enabled
  144. 143 kubectl run testpod --image=nginx
  145. 144 kubectl get pods
  146. 145 kubectl describe pod testpod
  147. 146 kubectl describe pod testpod | less
  148. 147 history
  149. 148 cd
  150. 149 cd -
  151. 150 kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
  152. 151 kubectl get svc
  153. 152 kubectl get pods
  154. 153 kubectl exec "$(kubectl get pod -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"
  155. 154 kubectl get pods
  156. 155 less samples/bookinfo/networking/bookinfo-gateway.yaml
  157. 156 kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
  158. 157 istioctl analyze
  159. 158 kubectl get all
  160. 159 kubectl delete deploy wordpress wordpress-mysql
  161. 160 kubectl delete svc wordpress wordpress-mysql
  162. 161 kubectl get pods
  163. 162 kubectl delete pod nginx-cm pv-pod
  164. 163 istioctl analyze
  165. 164 history
  166. 165 vim ../setup_istio_vars.sh
  167. 166 source ../setup_istio_vars.sh
  168. 167 echo $GATEWAY_URL
  169. 168 echo "http://$GATEWAY_URL/productpage"
  170. 169 kubectl apply -f samples/addons
  171. 170 kubectl rollout status deployment kiali -n istio-system
  172. 171 kubectl get all -n istio-system
  173. 172 istioctl dashboard kiali
  174. 173 bg
  175. 174 for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done
  176. 175 vim samples/bookinfo/networking/destination-rule-all.yaml
  177. 176 kubectl apply -f samples/bookinfo/networking/destination-rule-all.yaml
  178. 177 kubectl get destinationrules.networking.istio.io
  179. 178 vim samples/bookinfo/networking/virtual-service-all-v1.yaml
  180. 179 kubectl get virtualservices.networking.istio.io
  181. 180 kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
  182. 181 less samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
  183. 182 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
  184. 183 kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml
  185. 184 kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
  186. 185 vim samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  187. 186 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  188. 187 vim samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  189. 188 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  190. 189 history
  191. 190 cd ..
  192. 191 ls
  193. 192 cd myapp-test/
  194. 193 ls
  195. 194 vim version-one-cm.yaml
  196. 195 kubectl apply -f version-one-cm.yaml
  197. 196 kubectl apply -f version-two-cm.yaml
  198. 197 kubectl apply -f version-three-cm.yaml
  199. 198 vim version1-deploy.yaml
  200. 199 kubectl apply -f version1-deploy.yaml
  201. 200 kubectl apply -f version2-deploy.yaml
  202. 201 kubectl apply -f version3-deploy.yaml
  203. 202 vim webshop-svc.yaml
  204. 203 kubectl apply -f webshop-svc.yaml
  205. 204 kubect get svc
  206. 205 kubectl get svc
  207. 206 minikube ssh
  208. 207 kubectl get all -n istio-system
  209. 208 echo $GATEWAY_URL || source ../setup_istio_vars.sh
  210. 209 vim virtual-service-initial.yaml
  211. 210 kubectl apply -f virtual-service-initial.yaml
  212. 211 curl $GATEWAY_URL -H "Host: webshop.svc.default.cluster.local"
  213. 212 vim webshop-gateway.yaml
  214. 213 kubectl apply -f webshop-gateway.yaml
  215. 214 curl $GATEWAY_URL -H "Host: webshop.svc.default.cluster.local"
  216. 215 istioctl proxy-config routes deploy/istio-ingressgateway.istio-system
  217. 216 istioctl proxy-config listener deploy/istio-ingressgateway.istio-system
  218. 217 vim virtual-service-webshop-80-20.yaml
  219. 218 kubectl apply -f virtual-service-webshop-80-20.yaml
  220. 219 vim destination-rule-webshop.yaml
  221. 220 kubectl apply -f destination-rule-webshop.yaml
  222. 221 curl $GATEWAY_URL
  223. 222 vim destination-rule-webshop.yaml
  224. 223 kubectl get deploy
  225. 224 kubectl delete deploy details-v1 productpage-v1 ratings-v1 reviews-v1 reviews-v2 reviews-v3
  226. 225 kubectl delete svc details-v1 productpage-v1 ratings-v1 reviews-v1 reviews-v2 reviews-v3
  227. 226 kubectl get svc
  228. 227 kubectl delete svc details productpage ratings reviews
  229. 228 cd ../istio-1.18.2/samples/addons/
  230. 229 ls
  231. 230 for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL"; done
  232. 231 for i in $(seq 1 100); do sleep 1; curl -s -o /dev/null "http://$GATEWAY_URL"; done
  233. 232 minikube --help
  234. 233 minikube node --help
  235. 234 cd
  236. 235 history
  237.  
Add Comment
Please, Sign In to add comment