3.1 开放kiali至集群外部
-
首先将istio-inressateway暴露集群外部;
在node02的ens33网卡上面有多余的ip地址,将该地址绑定在igressgateway的svc 上面。
kubectl edit svc istio-ingressgateway -n istio-system
-
定义kiali的ingress gateway的资源配置清单
apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata:name: kiali-gatewaynamespace: istio-system spec:selector:app: istio-ingressgatewayservers:- hosts:- "kiali.icloud2native.com"port:name: http-kialinumber: 80protocol: HTTP ---
-
定义kiali的VirtualService清单
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:name: kiali-vsnamespace: istio-system spec:gateways:- kiali-gatewayhosts:- "kiali.icloud2native.com"http:- match:- uri:prefix: /route:- destination:host: kialiport:number: 20001
-
定义kiali的DestinationRule清单
apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata:name: kiali-drnamespace: istio-system spec:host: kialitrafficPolicy:tls:mode: DISABLE
-
本地解析,后访问kiali
3.2 开放grafana至集群外
-
定义grafana的gateway
apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata:name: granafa-gwnamespace: istio-system spec:selector:app: istio-ingressgatewayservers:- port:name: http-80number: 80protocol: HTTPhosts:- "grafana.icloud2native.com" ---
-
定义grafana的virtualservice
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:name: grafana-vsnamespace: istio-system spec:gateways:- granafa-gwhosts:- "grafana.icloud2native.com"http:- match:- uri:prefix: /route:- destination:host: grafanaport:number: 3000
-
定义grafana的dr
apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata:name: grafananamespace: istio-system spec:host: grafanatrafficPolicy:tls:mode: DISABLE ---
-
访问grafana
3.3 开放prometheus至集群外
-
prometheus的gateway,vs,dr资源配置清单
apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata:name: prometheus-gatewaynamespace: istio-system spec:selector:app: istio-ingressgatewayservers:- port:number: 80name: httpprotocol: HTTPhosts:- "prometheus.icloud2native.com" --- apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:name: prometheus-virtualservicenamespace: istio-system spec:hosts:- "prometheus.icloud2native.com"gateways:- prometheus-gatewayhttp:- match:- uri:prefix: /route:- destination:host: prometheusport:number: 9090 --- apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata:name: prometheusnamespace: istio-system spec:host: prometheustrafficPolicy:tls:mode: DISABLE ---
-
访问prometheus
3.4 开放trace至集群外
-
trace的gateway,vs,dr资源配置清单
apiVersion: networking.istio.io/v1beta1 kind: Gateway metadata:name: tracing-gatewaynamespace: istio-system spec:selector:app: istio-ingressgatewayservers:- port:number: 80name: httpprotocol: HTTPhosts:- "tracing.icloud2native.com" --- apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata:name: tracing-virtualservicenamespace: istio-system spec:hosts:- "tracing.icloud2native.com"gateways:- tracing-gatewayhttp:- match:- uri:prefix: /route:- destination:host: tracingport:number: 80 --- apiVersion: networking.istio.io/v1beta1 kind: DestinationRule metadata:name: tracing-drnamespace: istio-system spec:host: tracingtrafficPolicy:tls:mode: DISABLE ---
-
访问Jaeger