Istio
推理应用故障排查清单
· ☕ 1 分钟
Pod 查看 1 号进程的子进程 1 ps --ppid 1 -f 查看 Time_Wait 连接 1 netstat -anp | grep TIME_WAIT Istio Ingress 1 kubectl -n istio-ingress logs -l app=istio-ingress |grep vlm-tag-v1 EastWestGateway 1 kubectl -n istio-ingress logs -l app=istio-eastwestgateway |grep vlm-tag-v1 XDS 推送慢 1 2 3 4 5 histogram_quantile(0.99, sum by (le, pod, type) ( rate(pilot_xds_push_time_bucket{}[1m]) ) ) 达到 30s 就需要注意优化推送。 Node 抓包 1 tcpdump -i bond0 -n -v -tttt 指定目标 IP 和端口 1 tcpdump -i bond0 -n -v -tttt host 10.0.0.10 AI 安装 Nodejs 1 2 3 4 5 6 7 curl -o-

Istio 中的 EnvoyFilter 配置
· ☕ 3 分钟
1. EnvoyFilter 是什么 EnvoyFilter 是 Istio 的 CRD 资源,它允许用户修改 Envoy 的配置,以满足用户针对不同场景的定制需求。 1 2 3 4 5 6 7 8 9 kubectl get envoyfilter -A NAMESPACE NAME AGE istio-system add-request-id-into-ingressgateway 54d istio-system compression-gzip 18d istio-system custom-access-log 3d istio-system ingressgateway-settings 52d istio-system preserve-request-header-us-test-ingress-gateway 95d istio-system preserve-x-request-id 54d 通常在使用 istio 时,或多或少都会用到一些 EnvoyFilter。 EnvoyFilter 提供的功能是基于 Envoy 已有的内

使用 tinygo 开发 Istio WasmPlugin
· ☕ 2 分钟
wasme 只支持到 istio 1.9,而我使用的是 Istio 1.14,因此本篇直接使用 tinygo 进行验证和学习。 1. 安装 tinygo 要求 Go v1.18+ 安装 tinygo 1 2 brew tap tinygo-org/tools brew install tinygo 查看版本 1 2 3 tinygo version tinygo version 0.27.0 darwin/amd64 (using go version go1.19.3 and LLVM version 15.0.0) 2. 创建 wasm-istio 项目 初始化项目 1 2 3 mkdir wasm-istio cd wasm-istio go mod init wasm-istio 编辑 main.go 见 https://github.com/shaowenchen/demo/blob/master/wasm-istio/main.go 主要是下面这段 1 2 3 4 5 6 7

Istio 注入 Sidecar 的几种方式
· ☕ 1 分钟
Istio 注入 Sidecar 的模板在 istio-sidecar-injector ConfigMap 中。通过 annotations 可以对 Sidecar 的各种参数进行自定义配置,比如 CPU 使用、proxyImage 等。下面主要整理的是 Sidecar 的注入方式。 1. 给命名空间添加标签 -> 整个命名空间生效 注入标签 1 kubectl label namespace default istio-injection=enabled --overwrite 重启应用之后,会自动注入 Sidecar 容器。此时,访问流量将通

Istio Gateway 下的几种流量配置路径
· ☕ 1 分钟
1. 常用对象配置 1.1 Gateway selector 选择规则生效的 Envoy servers 匹配的域名 端口 协议 TLS 证书 1.2 VirtualService gateways 指定生效的网关,默认值 mesh 为东西向流量;如果指定 Gateway 对象则为南北向流量 http 七层路由 重定向 重写 重试 条件规则 超时 故障注入 跨站策略 tcp 七层路由 tls 带证书路由 TLS 证书 1.3 DestinationRule host 路由 trafficPolicy 镜像流量 故障转