├── c3-1 └── code.txt ├── c3-10 └── code.txt ├── c3-11 ├── httpbin-v1.yaml ├── httpbin-v2.yaml ├── mirror.yaml ├── svc.yaml └── vs.yaml ├── c3-17 ├── code.txt ├── gateway.yaml └── httpbin.yaml ├── c3-18 └── code.yaml ├── c3-19 ├── code.yaml ├── demo.jwt └── jwks.json ├── c3-2 └── code.txt ├── c3-3 ├── gateway.yaml └── virtualservice.yaml ├── c3-4 ├── code.txt └── serviceentry.yaml ├── c3-5 └── code.txt ├── c3-6 ├── code.txt ├── gateway.yaml └── vs.yaml ├── c3-7 ├── gw.yaml ├── se.yaml └── vs.yaml ├── c3-8 ├── retry.yaml ├── timeout.yaml ├── vs-rating.yaml └── vs.yaml ├── c3-9 ├── circuitbreaking.yaml └── code.txt ├── c4-1 └── code.yaml ├── c4-2 └── code.yaml ├── c4-3 ├── auth.yaml ├── cb.yaml ├── vs-normal.yaml ├── vs-retry.yaml └── vs-timeout.yaml ├── c4-4 └── code.yaml ├── c4-5 ├── configmap-v2.yaml ├── configmap.yaml ├── deployment.yaml └── grafana-deploy.yaml ├── c4-6 ├── deployment.yaml └── filebeat.yaml ├── c4-7 └── code.txt ├── 第一章 理论篇.pdf ├── 第三章 实验篇-安全.pdf ├── 第三章 实验篇-流量控制.pdf ├── 第三章-可观察性.pdf ├── 第二章 Istio入门篇.pdf ├── 第四章 实战篇-项目准备及构建过程.pdf └── 第四章 实战篇.pdf /c3-1/code.txt: -------------------------------------------------------------------------------- 1 | 本课代码可在官方安装包下获取: 2 | samples/bookinfo/platform/kube/bookinfo.yaml 3 | samples/bookinfo/networking/bookinfo-gateway.yaml -------------------------------------------------------------------------------- /c3-10/code.txt: -------------------------------------------------------------------------------- 1 | 官方代码: 2 | kubectl apply -f samples/bookinfo/networking/virtual-service-all-v1.yaml 3 | kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-test-v2.yaml 4 | kubectl apply -f samples/bookinfo/networking/virtual-service-ratings-test-delay.yaml -------------------------------------------------------------------------------- /c3-11/httpbin-v1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: httpbin-v1 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: httpbin 10 | version: v1 11 | template: 12 | metadata: 13 | labels: 14 | app: httpbin 15 | version: v1 16 | spec: 17 | containers: 18 | - image: docker.io/kennethreitz/httpbin 19 | imagePullPolicy: IfNotPresent 20 | name: httpbin 21 | command: ["gunicorn", "--access-logfile", "-", "-b", "0.0.0.0:80", "httpbin:app"] 22 | ports: 23 | - containerPort: 80 24 | -------------------------------------------------------------------------------- /c3-11/httpbin-v2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: httpbin-v2 5 | spec: 6 | replicas: 1 7 | selector: 8 | matchLabels: 9 | app: httpbin 10 | version: v2 11 | template: 12 | metadata: 13 | labels: 14 | app: httpbin 15 | version: v2 16 | spec: 17 | containers: 18 | - image: docker.io/kennethreitz/httpbin 19 | imagePullPolicy: IfNotPresent 20 | name: httpbin 21 | command: ["gunicorn", "--access-logfile", "-", "-b", "0.0.0.0:80", "httpbin:app"] 22 | ports: 23 | - containerPort: 80 24 | -------------------------------------------------------------------------------- /c3-11/mirror.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin 12 | subset: v1 13 | weight: 100 14 | mirror: 15 | host: httpbin 16 | subset: v2 17 | mirror_percentage: 18 | value: 100 19 | -------------------------------------------------------------------------------- /c3-11/svc.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: httpbin 5 | labels: 6 | app: httpbin 7 | spec: 8 | ports: 9 | - name: http 10 | port: 8000 11 | targetPort: 80 12 | selector: 13 | app: httpbin 14 | -------------------------------------------------------------------------------- /c3-11/vs.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin 12 | subset: v1 13 | weight: 100 14 | --- 15 | apiVersion: networking.istio.io/v1alpha3 16 | kind: DestinationRule 17 | metadata: 18 | name: httpbin 19 | spec: 20 | host: httpbin 21 | subsets: 22 | - name: v1 23 | labels: 24 | version: v1 25 | - name: v2 26 | labels: 27 | version: v2 28 | -------------------------------------------------------------------------------- /c3-17/code.txt: -------------------------------------------------------------------------------- 1 | 1.为服务创建根证书和私钥: 2 | openssl req -x509 -sha256 -nodes -days 365 -newkey rsa:2048 -subj '/O=example Inc./CN=example.com' -keyout example.com.key -out example.com.crt 3 | 4 | 2.为httpbin.example.com创建证书和私钥: 5 | openssl req -out httpbin.example.com.csr -newkey rsa:2048 -nodes -keyout httpbin.example.com.key -subj "/CN=httpbin.example.com/O=httpbin organization" 6 | openssl x509 -req -days 365 -CA example.com.crt -CAkey example.com.key -set_serial 0 -in httpbin.example.com.csr -out httpbin.example.com.crt 7 | 8 | 3. 创建secret 9 | kubectl create -n istio-system secret tls httpbin-credential --key=httpbin.example.com.key --cert=httpbin.example.com.crt 10 | 11 | 4.定义网关,vs,见yaml 12 | 13 | 5. 请求验证 14 | curl -HHost:httpbin.example.com \ 15 | --resolve httpbin.example.com:443:127.0.0.1 \ 16 | --cacert example.com.crt "https://httpbin.example.com:443/status/418" -------------------------------------------------------------------------------- /c3-17/gateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: mygateway 5 | spec: 6 | selector: 7 | istio: ingressgateway 8 | servers: 9 | - port: 10 | number: 443 11 | name: https 12 | protocol: HTTPS 13 | tls: 14 | mode: SIMPLE 15 | credentialName: httpbin-credential 16 | hosts: 17 | - httpbin.example.com 18 | -------------------------------------------------------------------------------- /c3-17/httpbin.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: httpbin 5 | labels: 6 | app: httpbin 7 | spec: 8 | ports: 9 | - name: http 10 | port: 8000 11 | selector: 12 | app: httpbin 13 | --- 14 | apiVersion: apps/v1 15 | kind: Deployment 16 | metadata: 17 | name: httpbin 18 | spec: 19 | replicas: 1 20 | selector: 21 | matchLabels: 22 | app: httpbin 23 | version: v1 24 | template: 25 | metadata: 26 | labels: 27 | app: httpbin 28 | version: v1 29 | spec: 30 | containers: 31 | - image: docker.io/citizenstig/httpbin 32 | imagePullPolicy: IfNotPresent 33 | name: httpbin 34 | ports: 35 | - containerPort: 8000 36 | -------------------------------------------------------------------------------- /c3-18/code.yaml: -------------------------------------------------------------------------------- 1 | # 给default添加命名空间策略 2 | # 兼容模式 3 | kubectl apply -f - <.:9411 29 | istioctl manifest apply \ 30 | --set values.global.tracer.zipkin.address=simplest-collector.observability:9411 \ 31 | --set values.tracing.ingress.enabled=true \ 32 | --set values.pilot.traceSampling=100 33 | 34 | 重启pod 35 | 36 | #添加注入agent 37 | sidecar.jaegertracing.io/inject: "true" 38 | 39 | kubectl patch deployment productpage-v1 -p "{\"spec\":{\"template\":{\"metadata\":{\"labels\":{\"date\":\"`date +'%s'`\"}}}}}" -------------------------------------------------------------------------------- /第一章 理论篇.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第一章 理论篇.pdf -------------------------------------------------------------------------------- /第三章 实验篇-安全.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第三章 实验篇-安全.pdf -------------------------------------------------------------------------------- /第三章 实验篇-流量控制.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第三章 实验篇-流量控制.pdf -------------------------------------------------------------------------------- /第三章-可观察性.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第三章-可观察性.pdf -------------------------------------------------------------------------------- /第二章 Istio入门篇.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第二章 Istio入门篇.pdf -------------------------------------------------------------------------------- /第四章 实战篇-项目准备及构建过程.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第四章 实战篇-项目准备及构建过程.pdf -------------------------------------------------------------------------------- /第四章 实战篇.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/malphi/geektime-servicemesh/221a6ef100c25a05c7ddfbe6209c3f56510c8fce/第四章 实战篇.pdf --------------------------------------------------------------------------------