httpserver 服务以 Istio Ingress Gateway 的形式发布
一,安装istio
二,sidecar 自动注入, 重启httpserver的pod
kubectl label namespace default istio-injection=enabled
然后删除之前的httpserver pod , 重新拉起这个pod
看下这个pod拉起过程
三,确定 ingress IP 和端口,明确自身 Kubernetes 集群环境支持外部负载均衡
root@iZbp12lq02mc4cz0rt0ce9Z:~# kubectl get svc istio-ingressgateway -n istio-system NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istio-ingressgateway LoadBalancer 10.105.131.213 <pending> 15021:31845/TCP,80:32444/TCP,443:31613/TCP,31400:30973/TCP,15443:31868/TCP 3h50m
四,创建 Istio Gateway:
apiVersion: networking.istio.io/v1bet
a1 kind: Gateway metadata: name: gateway spec: selector: istio: ingressgateway servers: - port: number: 80 name: http protocol: HTTP hosts: - '*'
apiVersion: networking.istio.io/v1beta1 kind: VirtualService metadata: name: httpserver namespace: default spec: gateways: - httpsserver hosts: - httpserver-helm.51.cafe http: - route: - destination: host: httpserver.default.svc.cluster.local port: number: 80
六:使用 curl 访问 httpserver服务
curl httpserver-helm.51.cafe
全世界的程序员们联合起来吧!