├── qr-code.png ├── qr-code-256.png ├── qr-code-small.png ├── code ├── chapter8 │ ├── checknothing.yaml │ ├── log │ │ ├── handler.yaml │ │ ├── rule.yaml │ │ └── logentry.yaml │ ├── version.listentry.yaml │ ├── chaos.listchecker.yaml │ ├── denier.yaml │ ├── chaos.listchecker.2.yaml │ ├── fluentd │ │ ├── fluentd.handler.yaml │ │ ├── rule-fluentd.yaml │ │ └── fluentd-deployment.yaml │ ├── mem-quota │ │ ├── quota-instance.yaml │ │ ├── quotaspec.yaml │ │ ├── rule.yaml │ │ ├── spec-binding.yaml │ │ └── memquota-handler.yaml │ ├── redis-quota │ │ ├── quota-instance.yaml │ │ ├── quotaspec.yaml │ │ ├── redis-rule.yaml │ │ ├── spec-binding.yaml │ │ ├── redisquota.yaml │ │ └── redis.yaml │ ├── listentry.rule.yaml │ ├── denier.rule.yaml │ ├── prom │ │ ├── promhttp.rule.yaml │ │ ├── request.totalsize.yaml │ │ └── prometheus.handler.yaml │ └── debug.yaml ├── chapter9 │ ├── meshpolicy.yaml │ ├── meshpolicy.2.yaml │ ├── rbac.yaml │ ├── servicerole-owner.yaml │ ├── servicerole.yaml │ ├── destinationrule.mtls.yaml │ ├── destinationrule.mtls.plain.yaml │ ├── servicerolebinding-owner.yaml │ ├── servicerolebinding.yaml │ └── sleep.istio.yaml ├── chapter7 │ ├── httpbin.entry.yaml │ ├── serviceentry.virtualservice.yaml │ ├── flaskapp.virtualservice.yaml │ ├── httpbin.virtualservice.timeout.yaml │ ├── httpbin.virtualservice.retry.yaml │ ├── example.gateway.yaml │ ├── httpbin.virtualservice.copy.yaml │ ├── httpbin.virtualservice.delay.yaml │ ├── flaskapp.destinationrule.yaml.yaml │ ├── httpbin.virtualservice.timeout.retry.yaml │ ├── httpbin.virtualservice.yaml │ ├── httpbin.virtualservice.timeout.retry.2.yaml │ ├── flaskapp.virtualservice.gateway.yaml │ ├── httpbin.cb.yaml │ ├── 1-sample-destination-with-trafficPolicy.yaml │ ├── flaskapp.virtualservice-split.yaml │ ├── httpbin.virtualservice.rewrite.yaml │ ├── flaskapp.virtualservice-redirect.yaml │ ├── flaskapp.virtualservice-canary.yaml │ ├── httpbin.virtualservice.fault.yaml │ ├── flaskapp.virtualservice-version.yaml │ ├── flaskapp.virtualservice.gateway.2.yaml │ ├── example.gateway.cert.1.yaml │ └── example.gateway.cert.2.yaml ├── chapter4 │ ├── flaskapp-default-vs-v2.yaml │ └── flaskapp-destinationrule.yaml ├── httpbin │ ├── httpbin.virtualservice.yaml │ └── httpbin.yaml ├── sleep │ ├── sleep.yaml │ └── sleep.istio.yaml └── flaskapp │ └── flaskapp.istio.yaml └── README.md /qr-code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fleeto/istio-for-beginner/HEAD/qr-code.png -------------------------------------------------------------------------------- /qr-code-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fleeto/istio-for-beginner/HEAD/qr-code-256.png -------------------------------------------------------------------------------- /qr-code-small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/fleeto/istio-for-beginner/HEAD/qr-code-small.png -------------------------------------------------------------------------------- /code/chapter8/checknothing.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: checknothing 3 | metadata: 4 | name: place-holder 5 | spec: 6 | -------------------------------------------------------------------------------- /code/chapter8/log/handler.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: stdio 3 | metadata: 4 | name: handler 5 | spec: 6 | outputAsJson: true 7 | -------------------------------------------------------------------------------- /code/chapter8/version.listentry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: listentry 3 | metadata: 4 | name: version 5 | spec: 6 | value: source.labels["version"] -------------------------------------------------------------------------------- /code/chapter9/meshpolicy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "authentication.istio.io/v1alpha1" 2 | kind: "MeshPolicy" 3 | metadata: 4 | name: "default" 5 | spec: 6 | peers: 7 | - mtls: {} 8 | -------------------------------------------------------------------------------- /code/chapter8/chaos.listchecker.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: listchecker 3 | metadata: 4 | name: chaos 5 | spec: 6 | overrides: ["v1", "v3"] 7 | blacklist: true -------------------------------------------------------------------------------- /code/chapter8/denier.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: denier 3 | metadata: 4 | name: code-7 5 | spec: 6 | status: 7 | code: 7 8 | message: Not allowed 9 | -------------------------------------------------------------------------------- /code/chapter8/chaos.listchecker.2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: listchecker 3 | metadata: 4 | name: chaos 5 | spec: 6 | overrides: ["v1", "v3"] 7 | blacklist: false -------------------------------------------------------------------------------- /code/chapter8/fluentd/fluentd.handler.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: fluentd 3 | metadata: 4 | name: handler 5 | spec: 6 | address: "fluentd-listener.default:24224" -------------------------------------------------------------------------------- /code/chapter9/meshpolicy.2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "authentication.istio.io/v1alpha1" 2 | kind: "MeshPolicy" 3 | metadata: 4 | name: "default" 5 | spec: 6 | peers: 7 | - mtls: 8 | mode: PERMISSIVE -------------------------------------------------------------------------------- /code/chapter9/rbac.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "rbac.istio.io/v1alpha1" 2 | kind: RbacConfig 3 | metadata: 4 | name: default 5 | spec: 6 | mode: "ON_WITH_INCLUSION" 7 | inclusion: 8 | namespaces: ["default"] 9 | -------------------------------------------------------------------------------- /code/chapter9/servicerole-owner.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "rbac.istio.io/v1alpha1" 2 | kind: ServiceRole 3 | metadata: 4 | name: service-owner 5 | spec: 6 | rules: 7 | - services: ["*"] 8 | methods: ["GET", "POST"] 9 | -------------------------------------------------------------------------------- /code/chapter9/servicerole.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "rbac.istio.io/v1alpha1" 2 | kind: ServiceRole 3 | metadata: 4 | name: service-viewer 5 | spec: 6 | rules: 7 | - services: 8 | - "*" 9 | methods: 10 | - "GET" -------------------------------------------------------------------------------- /code/chapter8/mem-quota/quota-instance.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: quota 3 | metadata: 4 | name: dest-quota 5 | spec: 6 | dimensions: 7 | destination: destination.labels["app"] | destination.service | "unknown" -------------------------------------------------------------------------------- /code/chapter8/mem-quota/quotaspec.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: QuotaSpec 3 | metadata: 4 | name: request-count 5 | spec: 6 | rules: 7 | - quotas: 8 | - charge: "5" 9 | quota: dest-quota 10 | -------------------------------------------------------------------------------- /code/chapter8/mem-quota/rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: rule 3 | metadata: 4 | name: quota 5 | spec: 6 | actions: 7 | - handler: handler.memquota 8 | instances: 9 | - dest-quota.quota 10 | -------------------------------------------------------------------------------- /code/chapter8/redis-quota/quota-instance.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: quota 3 | metadata: 4 | name: dest-quota 5 | spec: 6 | dimensions: 7 | destination: destination.labels["app"] | destination.service | "unknown" -------------------------------------------------------------------------------- /code/chapter8/redis-quota/quotaspec.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: QuotaSpec 3 | metadata: 4 | name: request-count 5 | spec: 6 | rules: 7 | - quotas: 8 | - charge: "5" 9 | quota: dest-quota 10 | -------------------------------------------------------------------------------- /code/chapter8/redis-quota/redis-rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: rule 3 | metadata: 4 | name: quota 5 | spec: 6 | actions: 7 | - handler: handler.redisquota 8 | instances: 9 | - dest-quota.quota 10 | -------------------------------------------------------------------------------- /code/chapter9/destinationrule.mtls.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "networking.istio.io/v1alpha3" 2 | kind: "DestinationRule" 3 | metadata: 4 | name: "httpbin" 5 | spec: 6 | host: "httpbin.mesh.svc.cluster.local" 7 | trafficPolicy: 8 | tls: 9 | mode: ISTIO_MUTUAL 10 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.entry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: ServiceEntry 3 | metadata: 4 | name: httpbin-ext 5 | spec: 6 | hosts: 7 | - httpbin.org 8 | ports: 9 | - number: 80 10 | name: http 11 | protocol: HTTP 12 | resolution: DNS 13 | -------------------------------------------------------------------------------- /code/chapter8/listentry.rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: rule 3 | metadata: 4 | name: checkversion 5 | spec: 6 | match: destination.labels["app"] == "httpbin" 7 | actions: 8 | - handler: chaos.listchecker 9 | instances: 10 | - version.listentry 11 | -------------------------------------------------------------------------------- /code/chapter8/log/rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: rule 3 | metadata: 4 | name: stdio 5 | spec: 6 | match: context.protocol == "http" && source.labels["app"] == "sleep" 7 | actions: 8 | - handler: handler.stdio 9 | instances: 10 | - sleep-log.logentry -------------------------------------------------------------------------------- /code/chapter8/mem-quota/spec-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: QuotaSpecBinding 3 | metadata: 4 | name: spec-sleep 5 | spec: 6 | quotaSpecs: 7 | - name: request-count 8 | namespace: default 9 | services: 10 | - name: httpbin 11 | namespace: default -------------------------------------------------------------------------------- /code/chapter8/redis-quota/spec-binding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: QuotaSpecBinding 3 | metadata: 4 | name: spec-sleep 5 | spec: 6 | quotaSpecs: 7 | - name: request-count 8 | namespace: default 9 | services: 10 | - name: httpbin 11 | namespace: default -------------------------------------------------------------------------------- /code/chapter9/destinationrule.mtls.plain.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "networking.istio.io/v1alpha3" 2 | kind: "DestinationRule" 3 | metadata: 4 | name: "httpbin" 5 | namespace: "plain" 6 | spec: 7 | host: "httpbin.plain.svc.cluster.local" 8 | trafficPolicy: 9 | tls: 10 | mode: DISABLE 11 | -------------------------------------------------------------------------------- /code/chapter8/fluentd/rule-fluentd.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: rule 3 | metadata: 4 | name: fluentd 5 | spec: 6 | actions: 7 | - handler: handler.fluentd 8 | instances: 9 | - sleep-log.logentry 10 | match: context.protocol == "http" && source.labels["app"] == "sleep" -------------------------------------------------------------------------------- /code/chapter9/servicerolebinding-owner.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "rbac.istio.io/v1alpha1" 2 | kind: ServiceRoleBinding 3 | metadata: 4 | name: bind-service-owner 5 | spec: 6 | subjects: 7 | - user: "cluster.local/ns/default/sa/sleep" 8 | roleRef: 9 | kind: ServiceRole 10 | name: "service-owner" 11 | -------------------------------------------------------------------------------- /code/chapter4/flaskapp-default-vs-v2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp-default-v2 5 | spec: 6 | hosts: 7 | - flaskapp 8 | http: 9 | - route: 10 | - destination: 11 | host: flaskapp 12 | subset: v2 13 | -------------------------------------------------------------------------------- /code/chapter7/serviceentry.virtualservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin-service 5 | spec: 6 | hosts: 7 | - httpbin.org 8 | http: 9 | - timeout: 3s 10 | route: 11 | - destination: 12 | host: httpbin.org 13 | -------------------------------------------------------------------------------- /code/chapter9/servicerolebinding.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "rbac.istio.io/v1alpha1" 2 | kind: ServiceRoleBinding 3 | metadata: 4 | name: bind-service-viewer 5 | spec: 6 | subjects: 7 | - properties: 8 | source.namespace: "default" 9 | roleRef: 10 | kind: ServiceRole 11 | name: "service-viewer" 12 | -------------------------------------------------------------------------------- /code/chapter4/flaskapp-destinationrule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | host: flaskapp 7 | subsets: 8 | - name: v1 9 | labels: 10 | version: v1 11 | - name: v2 12 | labels: 13 | version: v2 14 | -------------------------------------------------------------------------------- /code/httpbin/httpbin.virtualservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin.default.svc.cluster.local 12 | -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: flaskapp.default.svc.cluster.local 12 | subset: v1 13 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.timeout.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - timeout: 3s 10 | route: 11 | - destination: 12 | host: httpbin.default.svc.cluster.local 13 | -------------------------------------------------------------------------------- /code/chapter8/denier.rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: rule 3 | metadata: 4 | name: deny-sleep-v1-to-httpbin 5 | spec: 6 | match: destination.labels["app"] == "httpbin" && source.labels["app"]=="sleep" && source.labels["version"] == "v1" 7 | actions: 8 | - handler: code-7.denier 9 | instances: [place-holder.checknothing] 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 深入浅出 Istio 2 | 3 | 正如我经常吐槽的一样,从纸质书上抄写 YAML 出来是一件非常难的事情,尤其是在一些缺乏校验的系统之中,可能一个缩进就会要了小命,出现各种古怪问题。 4 | 5 | 因此花了几天时间,把所有代码重新整理。按照书中的章节顺序以及命名进行了编排,希望能节省读者在拼写错误和缩进上浪费的时间。 6 | 7 | 同时,Istio 1.1 发布在即,目前预计本书涉及的绝大部分内容都是能够兼容 1.1 的。新版发布以后,我将在第一时间内,新建 1.1 分支,对这里涉及到的内容重做梳理和验证,如发现有过期部分,会尽快完成修复并公开发布同步更新内容。 8 | 9 | 望周知。 10 | 11 | 购书请扫二维码: 12 | 13 | ![jd](qr-code-256.png) 14 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.retry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin.default.svc.cluster.local 12 | retries: 13 | attempts: 3 14 | -------------------------------------------------------------------------------- /code/chapter7/example.gateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: example-gateway 5 | spec: 6 | selector: 7 | istio: ingressgateway 8 | servers: 9 | - port: 10 | number: 80 11 | name: http 12 | protocol: HTTP 13 | hosts: 14 | - "*.microservice.rocks" 15 | - "*.microservice.xyz" 16 | -------------------------------------------------------------------------------- /code/chapter8/mem-quota/memquota-handler.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: memquota 3 | metadata: 4 | name: handler 5 | spec: 6 | quotas: 7 | - name: dest-quota.quota.default 8 | maxAmount: 20 9 | validDuration: 10s 10 | overrides: 11 | - dimensions: 12 | destination: httpbin 13 | maxAmount: 1 14 | validDuration: 5s 15 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.copy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - "httpbin.default.svc.cluster.local" 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin.default.svc.cluster.local 12 | mirror: 13 | host: flaskapp.default.svc.cluster.local 14 | subset: v2 -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.delay.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - "httpbin.default.svc.cluster.local" 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin.default.svc.cluster.local 12 | fault: 13 | delay: 14 | fixedDelay: 3s 15 | percent: 100 -------------------------------------------------------------------------------- /code/chapter7/flaskapp.destinationrule.yaml.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | host: flaskapp.default.svc.cluster.local 7 | trafficPolicy: 8 | loadBalancer: 9 | simple: LEAST_CONN 10 | subsets: 11 | - name: v1 12 | labels: 13 | version: v1 14 | - name: v2 15 | labels: 16 | version: v2 17 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.timeout.retry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin.default.svc.cluster.local 12 | retries: 13 | attempts: 3 14 | perTryTimeout: 1s 15 | timeout: 7s 16 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - match: 10 | - uri: 11 | exact: "/get" 12 | redirect: 13 | uri: /post 14 | - route: 15 | - destination: 16 | host: httpbin.default.svc.cluster.local 17 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.timeout.retry.2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: httpbin.default.svc.cluster.local 12 | retries: 13 | attempts: 3 14 | perTryTimeout: 8s 15 | timeout: 3s 16 | -------------------------------------------------------------------------------- /code/chapter8/redis-quota/redisquota.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: redisquota 3 | metadata: 4 | name: handler 5 | spec: 6 | redisServerUrl: "redis.default:6379" 7 | quotas: 8 | - name: dest-quota.quota.default 9 | maxAmount: 20 10 | bucketDuration: 1s 11 | validDuration: 10s 12 | rateLimitAlgorithm: ROLLING_WINDOW 13 | overrides: 14 | - dimensions: 15 | destination: httpbin 16 | maxAmount: 1 17 | -------------------------------------------------------------------------------- /code/chapter8/prom/promhttp.rule.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: rule 3 | metadata: 4 | name: promhttp 5 | namespace: istio-system 6 | spec: 7 | actions: 8 | - handler: handler.prometheus 9 | instances: 10 | - requestcount.metric 11 | - requestduration.metric 12 | - requestsize.metric 13 | - responsesize.metric 14 | - requesttotalsize.metric 15 | match: context.protocol == "http" || context.protocol == "grpc" 16 | -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice.gateway.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | - flaskapp.microservice.rocks 9 | - flaskapp.microservice.xyz 10 | gateways: 11 | - mesh 12 | - example-gateway 13 | http: 14 | - route: 15 | - destination: 16 | host: flaskapp.default.svc.cluster.local 17 | subset: v2 18 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.cb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: httpbin 5 | spec: 6 | host: httpbin 7 | trafficPolicy: 8 | connectionPool: 9 | tcp: 10 | maxConnections: 1 11 | http: 12 | http1MaxPendingRequests: 1 13 | maxRequestsPerConnection: 1 14 | outlierDetection: 15 | consecutiveErrors: 1 16 | interval: 1s 17 | baseEjectionTime: 3m 18 | maxEjectionPercent: 100 19 | -------------------------------------------------------------------------------- /code/chapter8/log/logentry.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: logentry 3 | metadata: 4 | name: sleep-log 5 | spec: 6 | monitored_resource_type: '"global"' 7 | severity: '"Info"' 8 | timestamp: request.time 9 | variables: 10 | destinationApp: destination.labels["app"] | "" 11 | destinationIp: destination.ip | ip("0.0.0.0") 12 | destinationName: destination.name | "" 13 | destinationNamespace: destination.namespace | "" 14 | destinationWorkload: destination.workload.name | "" -------------------------------------------------------------------------------- /code/chapter7/1-sample-destination-with-trafficPolicy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: DestinationRule 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | host: flaskapp.default.svc.cluster.local 7 | trafficPolicy: 8 | loadBalancer: 9 | simple: LEAST_CONN 10 | subsets: 11 | - name: v1 12 | labels: 13 | version: v1 14 | trafficPolicy: 15 | loadBalancer: 16 | simple: ROUND_ROBIN 17 | - name: v2 18 | labels: 19 | version: v2 20 | -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice-split.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | http: 9 | - route: 10 | - destination: 11 | host: flaskapp.default.svc.cluster.local 12 | subset: v1 13 | weight: 70 14 | - destination: 15 | host: flaskapp.default.svc.cluster.local 16 | subset: v2 17 | weight: 30 18 | 19 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.rewrite.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - match: 10 | - uri: 11 | exact: "/get" 12 | rewrite: 13 | uri: /post 14 | route: 15 | - destination: 16 | host: httpbin.default.svc.cluster.local 17 | - route: 18 | - destination: 19 | host: httpbin.default.svc.cluster.local 20 | -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice-redirect.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | http: 9 | - match: 10 | - sourceLabels: 11 | app: sleep 12 | version: v1 13 | uri: 14 | exact: "/env/HOSTNAME" 15 | redirect: 16 | uri: /env/version 17 | - route: 18 | - destination: 19 | host: flaskapp.default.svc.cluster.local 20 | subset: v2 21 | -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice-canary.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | http: 9 | - match: 10 | - headers: 11 | lab: 12 | exact: canary 13 | route: 14 | - destination: 15 | host: flaskapp.default.svc.cluster.local 16 | subset: v2 17 | - route: 18 | - destination: 19 | host: flaskapp.default.svc.cluster.local 20 | subset: v1 21 | -------------------------------------------------------------------------------- /code/chapter7/httpbin.virtualservice.fault.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: httpbin 5 | spec: 6 | hosts: 7 | - httpbin.default.svc.cluster.local 8 | http: 9 | - match: 10 | - sourceLabels: 11 | version: v1 12 | route: 13 | - destination: 14 | host: httpbin.default.svc.cluster.local 15 | fault: 16 | abort: 17 | httpStatus: 500 18 | percent: 100 19 | - route: 20 | - destination: 21 | host: httpbin.default.svc.cluster.local -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice-version.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | http: 9 | - match: 10 | - sourceLabels: 11 | app: sleep 12 | version: v1 13 | route: 14 | - destination: 15 | host: flaskapp.default.svc.cluster.local 16 | subset: v1 17 | - route: 18 | - destination: 19 | host: flaskapp.default.svc.cluster.local 20 | subset: v2 21 | -------------------------------------------------------------------------------- /code/chapter8/redis-quota/redis.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ReplicationController 3 | metadata: 4 | name: redis 5 | labels: 6 | name: redis 7 | spec: 8 | replicas: 1 9 | selector: 10 | name: redis 11 | template: 12 | metadata: 13 | labels: 14 | name: redis 15 | spec: 16 | containers: 17 | - name: redis 18 | image: redis 19 | ports: 20 | - containerPort: 6379 21 | --- 22 | apiVersion: v1 23 | kind: Service 24 | metadata: 25 | name: redis 26 | labels: 27 | name: redis 28 | spec: 29 | ports: 30 | - port: 6379 31 | targetPort: 6379 32 | selector: 33 | name: redis -------------------------------------------------------------------------------- /code/sleep/sleep.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: sleep 5 | labels: 6 | app: sleep 7 | version: v1 8 | spec: 9 | selector: 10 | app: sleep 11 | version: v1 12 | ports: 13 | - name: ssh 14 | port: 80 15 | --- 16 | apiVersion: extensions/v1beta1 17 | kind: Deployment 18 | metadata: 19 | name: sleep 20 | spec: 21 | replicas: 1 22 | template: 23 | metadata: 24 | labels: 25 | app: sleep 26 | version: v1 27 | spec: 28 | containers: 29 | - name: sleep 30 | image: dustise/sleep 31 | imagePullPolicy: IfNotPresent 32 | --- 33 | 34 | -------------------------------------------------------------------------------- /code/chapter7/flaskapp.virtualservice.gateway.2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: VirtualService 3 | metadata: 4 | name: flaskapp 5 | spec: 6 | hosts: 7 | - flaskapp.default.svc.cluster.local 8 | - flaskapp.microservice.rocks 9 | - flaskapp.microservice.xyz 10 | gateways: 11 | - mesh 12 | - example-gateway 13 | http: 14 | - match: 15 | - gateways: 16 | - example-gateway 17 | route: 18 | - destination: 19 | host: flaskapp.default.svc.cluster.local 20 | subset: v1 21 | - route: 22 | - destination: 23 | host: flaskapp.default.svc.cluster.local 24 | subset: v2 25 | -------------------------------------------------------------------------------- /code/chapter7/example.gateway.cert.1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: example-gateway 5 | spec: 6 | selector: 7 | istio: ingressgateway 8 | servers: 9 | - port: 10 | number: 80 11 | name: http 12 | protocol: HTTP 13 | hosts: 14 | - "*.microservice.rocks" 15 | - "*.microservice.xyz" 16 | - port: 17 | number: 443 18 | name: https 19 | protocol: HTTPS 20 | tls: 21 | mode: SIMPLE 22 | serverCertificate: /etc/istio/ingressgateway-certs/tls.crt 23 | privateKey: /etc/istio/ingressgateway-certs/tls.key 24 | hosts: 25 | - "flaskapp.microservice.rocks" 26 | - "flaskapp.microservice.xyz" 27 | -------------------------------------------------------------------------------- /code/chapter8/debug.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: "config.istio.io/v1alpha2" 2 | kind: logentry 3 | metadata: 4 | name: debug 5 | spec: 6 | severity: '"error"' 7 | timestamp: request.time 8 | variables: 9 | source: source.labels["app"] | source.service | "unknown" 10 | user: source.user | "unknown" 11 | destination: destination.labels["app"] | destination.service | "unknown" 12 | responseCode: response.code | 0 13 | responseSize: response.size | 0 14 | latency: response.duration | "0ms" 15 | protocol: request.scheme | "unknown" 16 | monitored_resource_type: '"UNSPECIFIED"' 17 | --- 18 | # stdio(标准输入输出)handler 的配置 19 | apiVersion: "config.istio.io/v1alpha2" 20 | kind: stdio 21 | metadata: 22 | name: debug 23 | spec: 24 | severity_levels: 25 | error: 2 # Params.Level.WARNING 26 | outputAsJson: False 27 | -------------------------------------------------------------------------------- /code/chapter8/fluentd/fluentd-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: fluentd-listener 5 | labels: 6 | app: fluentd-listener 7 | spec: 8 | ports: 9 | - name: fluentd-tcp 10 | port: 24224 11 | protocol: TCP 12 | targetPort: 24224 13 | - name: fluentd-udp 14 | port: 24224 15 | protocol: UDP 16 | targetPort: 24224 17 | selector: 18 | app: fluentd-listener 19 | --- 20 | apiVersion: extensions/v1beta1 21 | kind: Deployment 22 | metadata: 23 | name: fluentd-listener 24 | labels: 25 | app: fluentd-listener 26 | spec: 27 | template: 28 | metadata: 29 | labels: 30 | app: fluentd-listener 31 | annotations: 32 | sidecar.istio.io/inject: "false" 33 | spec: 34 | containers: 35 | - name: fluentd-listener 36 | image: rocklviv/fluentd 37 | -------------------------------------------------------------------------------- /code/sleep/sleep.istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: sleep 5 | labels: 6 | app: sleep 7 | spec: 8 | selector: 9 | app: sleep 10 | ports: 11 | - name: ssh 12 | port: 80 13 | --- 14 | apiVersion: extensions/v1beta1 15 | kind: Deployment 16 | metadata: 17 | name: sleep-v1 18 | spec: 19 | replicas: 1 20 | template: 21 | metadata: 22 | labels: 23 | app: sleep 24 | version: v1 25 | spec: 26 | containers: 27 | - name: sleep 28 | image: dustise/sleep 29 | imagePullPolicy: Always 30 | --- 31 | apiVersion: extensions/v1beta1 32 | kind: Deployment 33 | metadata: 34 | name: sleep-v2 35 | spec: 36 | replicas: 1 37 | template: 38 | metadata: 39 | labels: 40 | app: sleep 41 | version: v2 42 | spec: 43 | containers: 44 | - name: sleep 45 | image: dustise/sleep 46 | imagePullPolicy: Always 47 | -------------------------------------------------------------------------------- /code/chapter9/sleep.istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: sleep 5 | labels: 6 | app: sleep 7 | spec: 8 | selector: 9 | app: sleep 10 | ports: 11 | - name: ssh 12 | port: 80 13 | --- 14 | apiVersion: extensions/v1beta1 15 | kind: Deployment 16 | metadata: 17 | name: sleep-v1 18 | spec: 19 | replicas: 1 20 | template: 21 | metadata: 22 | labels: 23 | app: sleep 24 | version: v1 25 | spec: 26 | serviceAccountName: sleep 27 | containers: 28 | - name: sleep 29 | image: dustise/sleep 30 | imagePullPolicy: Always 31 | --- 32 | apiVersion: extensions/v1beta1 33 | kind: Deployment 34 | metadata: 35 | name: sleep-v2 36 | spec: 37 | replicas: 1 38 | template: 39 | metadata: 40 | labels: 41 | app: sleep 42 | version: v2 43 | spec: 44 | serviceAccountName: sleep-v2 45 | containers: 46 | - name: sleep 47 | image: dustise/sleep 48 | imagePullPolicy: Always 49 | -------------------------------------------------------------------------------- /code/chapter7/example.gateway.cert.2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: networking.istio.io/v1alpha3 2 | kind: Gateway 3 | metadata: 4 | name: example-gateway 5 | spec: 6 | selector: 7 | istio: ingressgateway 8 | servers: 9 | - port: 10 | number: 80 11 | name: http-all 12 | protocol: HTTP 13 | hosts: 14 | - "flaskapp.microservice.xyz" 15 | - port: 16 | number: 443 17 | name: https-rocks 18 | protocol: HTTPS 19 | tls: 20 | mode: SIMPLE 21 | serverCertificate: /etc/istio/ingressgateway-certs/rocks-cert.pem 22 | privateKey: /etc/istio/ingressgateway-certs/rocks-key.pem 23 | hosts: 24 | - "flaskapp.microservice.rocks" 25 | - port: 26 | number: 443 27 | name: https-xyz 28 | protocol: HTTPS 29 | tls: 30 | mode: SIMPLE 31 | serverCertificate: /etc/istio/ingressgateway-certs/xyz-cert.pem 32 | privateKey: /etc/istio/ingressgateway-certs/xyz-key.pem 33 | hosts: 34 | - "flaskapp.microservice.xyz" 35 | -------------------------------------------------------------------------------- /code/flaskapp/flaskapp.istio.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: flaskapp 5 | labels: 6 | app: flaskapp 7 | spec: 8 | selector: 9 | app: flaskapp 10 | ports: 11 | - name: http 12 | port: 80 13 | targetPort: 80 14 | --- 15 | apiVersion: extensions/v1beta1 16 | kind: Deployment 17 | metadata: 18 | name: flaskapp-v1 19 | spec: 20 | replicas: 1 21 | template: 22 | metadata: 23 | labels: 24 | app: flaskapp 25 | version: v1 26 | spec: 27 | containers: 28 | - name: flaskapp 29 | image: dustise/flaskapp 30 | imagePullPolicy: IfNotPresent 31 | env: 32 | - name: version 33 | value: v1 34 | ports: 35 | - containerPort: 80 36 | --- 37 | apiVersion: extensions/v1beta1 38 | kind: Deployment 39 | metadata: 40 | name: flaskapp-v2 41 | spec: 42 | replicas: 1 43 | template: 44 | metadata: 45 | labels: 46 | app: flaskapp 47 | version: v2 48 | spec: 49 | containers: 50 | - name: flaskapp 51 | image: dustise/flaskapp 52 | imagePullPolicy: IfNotPresent 53 | env: 54 | - name: version 55 | value: v2 56 | ports: 57 | - containerPort: 80 58 | -------------------------------------------------------------------------------- /code/httpbin/httpbin.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2017 Istio Authors 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | ################################################################################################## 16 | # httpbin service 17 | ################################################################################################## 18 | apiVersion: v1 19 | kind: Service 20 | metadata: 21 | name: httpbin 22 | labels: 23 | app: httpbin 24 | spec: 25 | ports: 26 | - name: http 27 | port: 8000 28 | targetPort: 80 29 | selector: 30 | app: httpbin 31 | --- 32 | apiVersion: extensions/v1beta1 33 | kind: Deployment 34 | metadata: 35 | name: httpbin 36 | spec: 37 | replicas: 1 38 | template: 39 | metadata: 40 | labels: 41 | app: httpbin 42 | version: v1 43 | spec: 44 | containers: 45 | - image: docker.io/kennethreitz/httpbin 46 | imagePullPolicy: IfNotPresent 47 | name: httpbin 48 | ports: 49 | - containerPort: 80 50 | -------------------------------------------------------------------------------- /code/chapter8/prom/request.totalsize.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: metric 3 | metadata: 4 | name: requesttotalsize 5 | namespace: istio-system 6 | spec: 7 | dimensions: 8 | connection_security_policy: conditional((context.reporter.kind | "inbound") == 9 | "outbound", "unknown", conditional(connection.mtls | false, "mutual_tls", "none")) 10 | destination_app: destination.labels["app"] | "unknown" 11 | destination_principal: destination.principal | "unknown" 12 | destination_service: destination.service.host | "unknown" 13 | destination_service_name: destination.service.name | "unknown" 14 | destination_service_namespace: destination.service.namespace | "unknown" 15 | destination_version: destination.labels["version"] | "unknown" 16 | destination_workload: destination.workload.name | "unknown" 17 | destination_workload_namespace: destination.workload.namespace | "unknown" 18 | reporter: conditional((context.reporter.kind | "inbound") == "outbound", "source", 19 | "destination") 20 | request_protocol: api.protocol | context.protocol | "unknown" 21 | response_code: response.code | 200 22 | source_app: source.labels["app"] | "unknown" 23 | source_principal: source.principal | "unknown" 24 | source_version: source.labels["version"] | "unknown" 25 | source_workload: source.workload.name | "unknown" 26 | source_workload_namespace: source.workload.namespace | "unknown" 27 | monitored_resource_type: '"UNSPECIFIED"' 28 | value: request.total_size | 0 -------------------------------------------------------------------------------- /code/chapter8/prom/prometheus.handler.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.istio.io/v1alpha2 2 | kind: prometheus 3 | metadata: 4 | name: handler 5 | namespace: istio-system 6 | spec: 7 | metrics: 8 | - instance_name: requestcount.metric.istio-system 9 | kind: COUNTER 10 | label_names: 11 | - reporter 12 | - source_app 13 | - source_principal 14 | - source_workload 15 | - source_workload_namespace 16 | - source_version 17 | - destination_app 18 | - destination_principal 19 | - destination_workload 20 | - destination_workload_namespace 21 | - destination_version 22 | - destination_service 23 | - destination_service_name 24 | - destination_service_namespace 25 | - request_protocol 26 | - response_code 27 | - connection_security_policy 28 | name: requests_total 29 | - buckets: 30 | explicit_buckets: 31 | bounds: 32 | - 0.005 33 | - 0.01 34 | - 0.025 35 | - 0.05 36 | - 0.1 37 | - 0.25 38 | - 0.5 39 | - 1 40 | - 2.5 41 | - 5 42 | - 10 43 | instance_name: requestduration.metric.istio-system 44 | kind: DISTRIBUTION 45 | label_names: 46 | - reporter 47 | - source_app 48 | - source_principal 49 | - source_workload 50 | - source_workload_namespace 51 | - source_version 52 | - destination_app 53 | - destination_principal 54 | - destination_workload 55 | - destination_workload_namespace 56 | - destination_version 57 | - destination_service 58 | - destination_service_name 59 | - destination_service_namespace 60 | - request_protocol 61 | - response_code 62 | - connection_security_policy 63 | name: request_duration_seconds 64 | - buckets: 65 | exponentialBuckets: 66 | growthFactor: 10 67 | numFiniteBuckets: 8 68 | scale: 1 69 | instance_name: requestsize.metric.istio-system 70 | kind: DISTRIBUTION 71 | label_names: 72 | - reporter 73 | - source_app 74 | - source_principal 75 | - source_workload 76 | - source_workload_namespace 77 | - source_version 78 | - destination_app 79 | - destination_principal 80 | - destination_workload 81 | - destination_workload_namespace 82 | - destination_version 83 | - destination_service 84 | - destination_service_name 85 | - destination_service_namespace 86 | - request_protocol 87 | - response_code 88 | - connection_security_policy 89 | name: request_bytes 90 | - buckets: 91 | exponentialBuckets: 92 | growthFactor: 10 93 | numFiniteBuckets: 8 94 | scale: 1 95 | instance_name: responsesize.metric.istio-system 96 | kind: DISTRIBUTION 97 | label_names: 98 | - reporter 99 | - source_app 100 | - source_principal 101 | - source_workload 102 | - source_workload_namespace 103 | - source_version 104 | - destination_app 105 | - destination_principal 106 | - destination_workload 107 | - destination_workload_namespace 108 | - destination_version 109 | - destination_service 110 | - destination_service_name 111 | - destination_service_namespace 112 | - request_protocol 113 | - response_code 114 | - connection_security_policy 115 | name: response_bytes 116 | - instance_name: tcpbytesent.metric.istio-system 117 | kind: COUNTER 118 | label_names: 119 | - reporter 120 | - source_app 121 | - source_principal 122 | - source_workload 123 | - source_workload_namespace 124 | - source_version 125 | - destination_app 126 | - destination_principal 127 | - destination_workload 128 | - destination_workload_namespace 129 | - destination_version 130 | - destination_service 131 | - destination_service_name 132 | - destination_service_namespace 133 | - connection_security_policy 134 | name: tcp_sent_bytes_total 135 | - instance_name: tcpbytereceived.metric.istio-system 136 | kind: COUNTER 137 | label_names: 138 | - reporter 139 | - source_app 140 | - source_principal 141 | - source_workload 142 | - source_workload_namespace 143 | - source_version 144 | - destination_app 145 | - destination_principal 146 | - destination_workload 147 | - destination_workload_namespace 148 | - destination_version 149 | - destination_service 150 | - destination_service_name 151 | - destination_service_namespace 152 | - connection_security_policy 153 | name: tcp_received_bytes_total 154 | - buckets: 155 | exponentialBuckets: 156 | growthFactor: 10 157 | numFiniteBuckets: 8 158 | scale: 1 159 | instance_name: requesttotalsize.metric.istio-system 160 | kind: DISTRIBUTION 161 | label_names: 162 | - connection_security_policy 163 | - destination_app 164 | - destination_principal 165 | - destination_version 166 | - destination_service 167 | - destination_service_name 168 | - destination_service_namespace 169 | - destination_workload 170 | - destination_workload_namespace 171 | - reporter 172 | - request_protocol 173 | - response_code 174 | - source_app 175 | - source_principal 176 | - source_workload 177 | - source_workload_namespace 178 | - source_version 179 | 180 | name: request_total_bytes 181 | --------------------------------------------------------------------------------