k8s istio 配置域名转发到外部节点机器上

关键字:k8s istio endpoint svc vs

1、创建VS

apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
  name: vs-luntan
  namespace: qa
spec:
  gateways:
  -gateway-qa11
  hosts:
  - luntan.qa.com
  http:
  - match:
    - uri:
        prefix: /
    route:
    - destination:
        host: svc-luntan.qa.svc.cluster.local 

2、创建svc

apiVersion: v1
kind: Service
metadata:
  name: svc-luntan
  namespace: qa
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {} 

3、创建endpoint

apiVersion: v1
kind: Endpoints
metadata:
  name: svc-luntan
  namespace: qa
subsets:
- addresses:
  - ip: 10.198.1.1
  ports:
  - port: 80
    protocol: TCP 

 

posted on 2020-06-14 16:25  studyphp  阅读(929)  评论(0编辑  收藏  举报

导航