istio 安装 gateway,vs 配置
环境要求: k8s集群
实现:
安装istio 1.8.1版本
将bin/目录下的istioctl文件,cp到可执行的PATH路径,就可以使用istioctl命令了
istioctl install --set profile=demo
Kubectl get pod -n istio-system
kubectl label ns default istio-injection=enabled default空间启用istio
vim dev-gw.yaml
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: blackboard-gw
spec:
selector:
istio: ingressgateway
servers:
- hosts:
- blackboard.para.com
port:
name: http
number: 80
protocol: HTTP
vim dev-vs.yaml
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
generation: 1
name: blackboard-vs
spec:
gateways:
- blackboard-gw
hosts:
- blackboard.para.com
http:
- match:
- uri:
prefix: /
route:
- destination:
host: blackboard-dev-zh-cn
weight: 100
vim nginx.conf
浙公网安备 33010602011771号