Advertisement
sandervanvugt

microservices nov22

Nov 23rd, 2022
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.42 KB | None | 0 0
  1. recorded video course; https://learning.oreilly.com/videos/building-and-managing/9780137649686/
  2. student@student-virtual-machine:~$ history
  3. 1 minikube start --vm-driver=docker --memory=4G
  4. 2 kubectl get all
  5. 3 history
  6. 4 top
  7. 5 kubectl create deploy mynginx --image=nginx --replicas=3
  8. 6 kubectl get all
  9. 7 source <(kubectl completion bash)
  10. 8 kubectl completion -h | less
  11. 9 kubectl get all
  12. 10 history
  13. 11 kubectl delete pod mynginx-ff886775c-xbjjk
  14. 12 kubectl get all
  15. 13 echo hello
  16. 14 ls
  17. 15 kubectl describe pod mynginx-ff886775c-wrzz6
  18. 16 kubectl set image -h | less
  19. 17 kubectl set image deployment/mynginx nginx=nginx:1.17
  20. 18 kubectl get all
  21. 19 history
  22. 20 kubectl create myweb --image=nginx --replicas=3 --dry-run=client -o yaml
  23. 21 kubectl create deploy myweb --image=nginx --replicas=3 --dry-run=client -o yaml
  24. 22 kubectl create deploy myweb --image=nginx --replicas=3 --dry-run=client -o yaml > myweb.yaml
  25. 23 vim myweb.yaml
  26. 24 kubectl explain deployment.spec | less
  27. 25 kubectl create -f myweb.yaml
  28. 26 kubectl apply -f myweb.yaml
  29. 27 kubectl delete -f myweb.yaml
  30. 28 kubectl apply -f myweb.yaml
  31. 29 kubectl get deploy myweb -o yaml | less
  32. 30 kubectl create deploy mydb --image=mariadb --replicas=3
  33. 31 kubectl get all --selector app=mydb
  34. 32 kubectl describe pod mydb-c8bddc94c-hbblg | less
  35. 33 kubectl logs mydb-c8bddc94c-hbblg
  36. 34 kubectl set env -h | less
  37. 35 kubectl set env deploy/mydb MARIADB_ROOT_PASSWORD=password
  38. 36 kubectl get all --selector app=mydb
  39. 37 ls
  40. 38 vim pv.yaml
  41. 39 kubectl apply -f pv.yaml
  42. 40 vim pvc.yaml
  43. 41 kubectl apply -f pvc.yaml
  44. 42 kubectl get pv,pvc
  45. 43 vim pv-pod.yaml
  46. 44 kubectl apply -f pv-pod.yaml
  47. 45 kubectl get deploy
  48. 46 kubectl delete deploy mydb
  49. 47 kubectl delete deploy mynginx
  50. 48 kubectl delete deploy myweb
  51. 49 kubectl get all
  52. 50 kubectl create deploy mydb --image=mariadb --replicas=3
  53. 51 kubectl get pods
  54. 52 kubectl create cm mydbcm --from-literal=MARIADB_ROOT_PASSWORD=password
  55. 53 kubectl describe cm mydbcm
  56. 54 kubectl set env --from=configmap/mydbcm deploy/mydb
  57. 55 kubectl get all
  58. 56 kubectl get pods mydb-69885c5df4-77djm -o yaml | less
  59. 57 history
  60. 58 cat nginx-custom-config.conf
  61. 59 kubectl create cm nginx-cm --from-file=nginx-custom-config.conf
  62. 60 kubectl get cm nginx-cm -o yaml
  63. 61 vim nginx-cm.yaml
  64. 62 kubectl apply -f nginx-cm.yaml
  65. 63 kubectl exec -it nginx-cm -- cat /etc/nginx/conf.d/default.conf
  66. 64 kubectl create deploy nginxsvc --image=nginx
  67. 65 kubectl scale deploy nginxsvc --replicas 3
  68. 66 kubectl get all --selector app=nginxsvc
  69. 67 kubectl expose deploy nginxsvc --port=80
  70. 68 kubectl get all --selector app=nginxsvc
  71. 69 curl 10.107.230.156
  72. 70 kubectl describe svc nginxsvc
  73. 71 minikube ip
  74. 72 minikube ssh
  75. 73 kubectl edit svc nginxsvc
  76. 74 kubectl get svc
  77. 75 curl 192.168.49.2:30303
  78. 76 kubectl edit svc nginxsvc
  79. 77 history
  80. 78 minikube addons list
  81. 79 minikube addons enable ingress
  82. 80 kubectl get ns
  83. 81 kubectl get all -n ingress-nginx
  84. 82 vim nginxsvc-ingress
  85. 83 vim nginxsvc-ingress.yaml
  86. 84 kubectl apply -f nginxsvc-ingress.yaml
  87. 85 vim nginxsvc-ingress.yaml
  88. 86 kubectl api-resources | grep ingress
  89. 87 kubectl create ingress -h | less
  90. 88 # kubectl create ingress multipath --class=default \
  91. 89 kubectl create ingress simple --rule="nginxsvc.info/=nginxsvc:80
  92. "
  93. 90 kubectl create ingress nginxsvc --class=default --rule="nginxsvc.info/=nginxsvc:80
  94. "
  95. 91 kubectl create ingress nginxsvc --class=default --rule="nginxsvc.info/=nginxsvc:80"
  96. 92 kubectl describe ingress nginxsvc
  97. 93 sudo vim /etc/hosts
  98. 94 kubectl get ingress
  99. 95 curl nginxsvc.info
  100. 96 cat deployment.yaml
  101. 97 cat service.yaml
  102. 98 kubectl apply -f deployment.yaml service.yaml
  103. 99 kubectl apply -f deployment.yaml
  104. 100 kubectl apply -f service.yaml
  105. 101 kubectl get all
  106. 102 ls
  107. 103 vim kustomization.yaml
  108. 104 kubectl get all --selector environment=testing
  109. 105 kubectl apply -k ./
  110. 106 kubectl get all --selector environment=testing
  111. 107 kubectl get deploy,svc
  112. 108 ./countdown 20
  113. 109 ls
  114. 110 cd lesson13lab/
  115. 111 ls
  116. 112 kubectl get deploy
  117. 113 kubectl delete deploy mydb
  118. 114 kubectl delete deploy nginx-friday20
  119. 115 kubectl delete deploy nginxsvc
  120. 116 kubectl delete deploy test-nginx-friday20
  121. 117 kubectl delete svc test-nginx-friday20
  122. 118 kubectl delete svc nginxsvc
  123. 119 kubectl delete svc mydb
  124. 120 kubectl get all
  125. 121 vim kustomization.yaml
  126. 122 vim mysql-deployment.yaml
  127. 123 vim wordpress-deployment.yaml
  128. 124 kubectl -k ./
  129. 125 kubectl apply -k ./
  130. 126 kubectl get all
  131. 127 kubectl get pvc,pv,cm,secret
  132. 128 minikube service wordpress --url
  133. 129 kubectl get svc
  134. 130 cd
  135. 131 curl -L https://istio.io/downloadIstio | sh -
  136. 132 cd istio-1.16.0/
  137. 133 sudo cp bin/istioctl /usr/bin/
  138. 134 istioctl --help
  139. 135 kubectl api-resources | wc
  140. 136 kubectl api-resources | grep istio
  141. 137 istioctl install --set-profile=demo -y
  142. 138 istioctl install --set profile=demo -y
  143. 139 kubectl get all -n istio-system
  144. 140 kubectl api-resources | grep istio
  145. 141 kubectl get ns
  146. 142 kubectl get pods
  147. 143 kubectl label namespace default istio-injection=enabled
  148. 144 kubectl get pods
  149. 145 kubectl get crds
  150. 146 kubectl create deploy testginx --image=nginx
  151. 147 kubectl get all --selector app=testginx
  152. 148 kubectl describe pod testginx-578fc7c877-6ndsl | less
  153. 149 ../microservices/countdown 12
  154. 150 ls
  155. 151 ls samples/
  156. 152 kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
  157. 153 kubectl get svc
  158. 154 kubectl delete svc wordpress wordpress-mysql
  159. 155 kubectl delete svc nginx-friday20
  160. 156 kubectl get svc
  161. 157 kubectl get pods
  162. 158 kubectl exec "$(kubectl get pods -l app=ratings -o jsonpath='{.items[0].metadata.name}')" -c ratings -- curl -sS productpage:9080/productpage | grep -o "<title>.*</title>"
  163. 159 less samples/bookinfo/networking/bookinfo-gateway.yaml
  164. 160 kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
  165. 161 istioctl analyze
  166. 162 cd ../microservices/
  167. 163 vim setup_istio_vars.sh
  168. 164 source setup_istio_vars.sh
  169. 165 echo "http://$GATEWAT_URL/productpage"
  170. 166 echo "http://$GATEWAY_URL/productpage"
  171. 167 cd ../istio-1.16.0/
  172. 168 kubectl apply -f samples/addons
  173. 169 kubectl rollout status deployment kiali -n istio-system
  174. 170 istioctl dashboard kiali
  175. 171 bg
  176. 172 for i in $(seq 1 100); do curl -s -o /dev/null "http://GATEWAY_URL/productpage"; done
  177. 173 for i in $(seq 1 100); do curl -s -o /dev/null "http://$GATEWAY_URL/productpage"; done
  178. 174 less samples/bookinfo/networking/destination-rule-all.yaml
  179. 175 kubectl apply -f samples/bookinfo/networking/destination-rule-all.yaml
  180. 176 kubectl get destinationrules.networking.istio.io
  181. 177 less samples/bookinfo/networking/virtual-service-all-v1.yaml
  182. 178 kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml
  183. 179 kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  184. 180 less samples/bookinfo/networking/virtual-service-reviews-50-v3.yaml
  185. 181 cd
  186. 182 history
  187.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement