项目使用istio管理部署序
1, 给NS打上注入标签
kubectl label namespace default istio-injection-enabled
查看NS的标签
kubectl get ns/default --show-labels
2, 使用K8S部署应用
kubectl apply -f abc.yml
部署后会注入Envoy容器
3,查看相应的Service是否创建成功,这时东西向流量可正常通信(服务与服务之间)。
4,创建gateway
Gateway中的servers字段定义了 监听器 ; VirtualService定义了rule路由规则;
route->destination->host 里的productpage是对应的服务名
5,client ---> ingress Envoy(gateway) -->productPage 后
把符合路由规则的请求 发送到 productPage,接下来做网格内部代理。
三大资源
Gateway , VirtualServer , DestinationRule