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 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM