Advertisement
sandervanvugt

microservices aprill23

Apr 17th, 2023
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.19 KB | None | 0 0
  1. student@student-virtual-machine:~/microservices$ history
  2. 1 sudo apt install git vim -y
  3. 2 git clone https://github.com/sandervanvugt/microservices
  4. 3 cd microservices/
  5. 4 ls
  6. 5 ./minikube-docker-setup.sh
  7. 6 minikube start --vm-driver=docker --cni=calico --mem=6G
  8. 7 minikube start --vm-driver=docker --cni=calico --memory=6G
  9. 8 minikube status
  10. 9 minikube addons list
  11. 10 minikube addon enable istio
  12. 11 minikube addons enable istio
  13. 12 sudo poweroff
  14. 13 cd microservices/
  15. 14 ls
  16. 15 minikube delete
  17. 16 minikube start --vm-driver=docker --cni=calico --memory=12G --cpu=4
  18. 17 minikube start --vm-driver=docker --cni=calico --memory=12G --cpus=4
  19. 18 minikube addons enable istio
  20. 19 minikube addons disable istio
  21. 20 free -m
  22. 21 lscpu
  23. 22 history
  24. 23 kubectl get all
  25. 24 source <(kubectl completion bash)
  26. 25 kubectl create deploy mynginx --image=nginx --replicas=3
  27. 26 kubectl create deploy mynginx --image=docker.io/library/nginx --replicas=3
  28. 27 kubectl get all
  29. 28 kubectl get deploy -o yaml | less
  30. 29 kubectl get all
  31. 30 kubectl delete pod mynginx-56766fcf49-zvbwj
  32. 31 kubectl get all
  33. 32 kubectl create deploy mynewginx --image=nginx --replicas=3 --dry-run=client -o yaml > mynewginx.yaml
  34. 33 vim mynewginx.yaml
  35. 34 kubectl explain deploy.spec
  36. 35 kubectl create -f mynewginx.yaml
  37. 36 kubectl delete -f mynewginx.yaml
  38. 37 kubectl apply -f mynewginx.yaml
  39. 38 vim mynewginx.yaml
  40. 39 kubectl apply -f mynewginx.yaml
  41. 40 kubectl get deploy mynewginx -o yaml | less
  42. 41 ./countdown 12
  43. 42 history
  44. 43 kubectl run myapp --image=mariadb
  45. 44 kubectl describe pod myapp
  46. 45 kubectl get pods
  47. 46 kubectl describe pod myapp
  48. 47 kubectl logs myapp
  49. 48 ls
  50. 49 history
  51. 50 vim pv.yaml
  52. 51 kubectl apply -f pv.yaml
  53. 52 kubectl get pv
  54. 53 vim pvc.yaml
  55. 54 kubectl apply -f pvc.yaml
  56. 55 kubectl get pv,pvc
  57. 56 kubectl get storageclass
  58. 57 vim pv-pvc-pod.yaml
  59. 58 kubectl apply -f pv-pvc-pod.yaml
  60. 59 kubectl get pv,pvc
  61. 60 kubectl get pods
  62. 61 kubectl exec local-pv-pod -- touch /usr/share/nginx/html/hello.html
  63. 62 kubectl describe pod local-pv-pod
  64. 63 kubectl get pv local-pv-volume
  65. 64 kubectl describe pv local-pv-volume
  66. 65 minikube ssh
  67. 66 history
  68. 67 ./countdown 1
  69. 68 kubectl get deploy
  70. 69 kubectl delete deploy mynewginx
  71. 70 kubectl delete deploy mynginx
  72. 71 kubectl create deploy mydb --image=mariadb --replicas=3
  73. 72 kubectl get pods
  74. 73 kubectl logs mydb-7978c6b495-nbb4g
  75. 74 kubectl create cm mydbcm --from-literal=MARIADB_ROOT_PASSWORD=password
  76. 75 kubectl describe cm mydbcm
  77. 76 kubectl set env --from=configmap/mydbcm deploy/mydb
  78. 77 kubectl get all
  79. 78 kubectl get deploy mydb -o yaml | less
  80. 79 cat nginx-custom-config.conf
  81. 80 kubectl create cm nginx-cm --from-file nginx-custom-config.conf
  82. 81 kubectl get cm nginx-cm -o yaml
  83. 82 vim nginx-cm.yaml
  84. 83 kubectl apply -f nginx-cm.yaml
  85. 84 kubectl exec -it nginx-cm -- cat /etc/nginx/conf.d/default.conf
  86. 85 history
  87. 86 kubectl create deploy nginxsvc --image=nginx --replicas=3
  88. 87 kubectl get all --selector app=nginxsvc
  89. 88 kubectl expose deploy nginxsvc --port=80
  90. 89 kubectl describe svc nginxsvc
  91. 90 kubectl get endpoints
  92. 91 kubectl get svc
  93. 92 curl 10.110.204.235
  94. 93 minikube ssh
  95. 94 kubectl edit svc nginxsvc
  96. 95 kubectl get svc
  97. 96 curl 192.168.49.2:31503
  98. 97 minikube addons list
  99. 98 minikube addons enable ingress
  100. 99 kubectl get deploy
  101. 100 kubectl get svc
  102. 101 curl 192.168.49.2:31503
  103. 102 vim nginxsvc-ingress
  104. 103 vim nginxsvc-ingress.yaml
  105. 104 kubectl create ing -h | less
  106. 105 kubectl create ingress nginxsvc --rule="nginxsvc.info/=nginxsvc:80"
  107. 106 sudo vim /etc/hosts
  108. 107 curl nginxsvc.info
  109. 108 kubectl describe ing nginxsvc
  110. 109 vim deployment.yaml
  111. 110 vim service.yaml
  112. 111 vim kustomization.yaml
  113. 112 kubectl apply -f deployment.yaml
  114. 113 kubectl apply -f service.yaml
  115. 114 kubectl get deploy,svc
  116. 115 kubectl apply -k .
  117. 116 kubectl get deploy,svc
  118. 117 cat kustomization.yaml
  119. 118 kubectl get deployments.apps test-nginx-friday20 -o yaml | less
  120. 119 cd lesson6lab/
  121. 120 ls
  122. 121 vim kustomization.yaml
  123. 122 vim wordpress-deployment.yaml
  124. 123 vim mysql-deployment.yaml
  125. 124 kubectl get deploy
  126. 125 kubectl delete deploy mydb nginx-friday20 nginxsvc test-nginx-friday20
  127. 126 kubectl get svc
  128. 127 kubectl delete svc nginx-friday20 test-nginx-friday20 nginxsvc
  129. 128 kubectl apply -k .
  130. 129 kubectl get svc
  131. 130 kubectl get deploy
  132. 131 kubectl get pods
  133. 132 kubectl delete pod nginx-cm myapp local-pv-pod
  134. 133 kubectl get pods
  135. 134 kubectl describe pod wordpress-788d7565b4-vgdt8
  136. 135 kubectl get pvc
  137. 136 kubectl get pods
  138. 137 kubectl get svc wordpress
  139. 138 minikube service wordpress --url
  140. 139 cd ..
  141. 140 history
  142. 141 curl -L https://istio.io/downloadIstio | sh -
  143. 142 ls
  144. 143 cd istio-1.17.2/
  145. 144 ls
  146. 145 tree
  147. 146 sudo apt install tree
  148. 147 tree
  149. 148 sudo cp bin/istioctl /usr/bin/
  150. 149 istioctl --set-profile=demo -y
  151. 150 istioctl --set profile=demo -y
  152. 151 istioctl install --set profile=demo -y
  153. 152 kubectl get all -n istio-system
  154. 153 kubectl api-resources | less
  155. 154 kubectl label ns default istio-injection=enabled
  156. 155 kubectl get crds
  157. 156 kubectl get pods
  158. 157 kubectl run testapp --image=nginx
  159. 158 kubectl get pods
  160. 159 kubectl get pods testapp -o yaml
  161. 160 kubectl get pods testapp -o yaml | less
  162. 161 cd ../lab6
  163. 162 cd ../lesson6lab/
  164. 163 kubectl delete -k .
  165. 164 cd ../istio-1.17.2/
  166. 165 ls
  167. 166 kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
  168. 167 kubectl get all
  169. 168 kubectl get svc
  170. 169 kubectl get pods
  171. 170 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>"
  172. 171 less samples/bookinfo/networking/bookinfo-gateway.yaml
  173. 172 kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
  174. 173 istioctl analyze
  175. 174 history
  176. 175 vim ../setup_istio_vars.sh
  177. 176 source ../setup_istio_vars.sh
  178. 177 echo http://$GATEWAY_URL/productpage
  179. 178 kubectl apply -f samples/addons/
  180. 179 kubectl rollout status deployment/kiali -n istio-system
  181. 180 kubectl get all -n istio-system
  182. 181 kubectl get pods -n istio-system
  183. 182 istioctl dashboard kiali
  184. 183 bg
  185. 184 for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done
  186. 185 less samples/bookinfo/networking/destination-rule-all.yaml
  187. 186 kubectl apply -f samples/bookinfo/networking/destination-rule-all.yaml
  188. 187 kubectl get destinationrules.networking.istio.io
  189. 188 kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
  190. 189 kubectl get virtualservices.networking.istio.io productpage -o yaml
  191. 190 less samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
  192. 191 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
  193. 192 kubectl delete -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml
  194. 193 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  195. 194 kubectl get virtualservices.networking.istio.io reviews -o yaml | less
  196. 195 vim samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  197. 196 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  198. 197 kubectl get virtualservices.networking.istio.io reviews -o yaml | less
  199. 198 history
  200. 199 kubectl delete -f samples/bookinfo/networking/bookinfo-gateway.yaml
  201. 200 cd ..
  202. 201 vim istio-canary.yaml
  203. 202 kubectl create -f istio-canary.yaml
  204. 203 kubectl create -f littlebird-gateway.yaml
  205. 204 istioctl dashboard kiali &
  206. 205 for i $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_RUL/"; done
  207. 206 for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_RUL/"; done
  208. 207 history
  209.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement