我正在 Kubernetes 的 deployment.yaml 中为我的服务设置 Ingress 控制器。
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {env}
annotations:
traefik.ingress.kubernetes.io/frontend-entry-points: "http,https"
ingress.kubernetes.io/force-hsts: "true"
traefik.ingress.kubernetes.io/redirect-regex: ^http://(.*)
traefik.ingress.kubernetes.io/redirect-replacement: https://$1
kubernetes.io/ingress.class: "traefik"
spec:
rules:
- host: “qa.mywebsite.com"
http:
paths:
- backend:
serviceName: serviceName-{env}
servicePort:8080
如何设置 Ingress 控制器,以便 QA pod 中的流量路由到 QA 端点,Prod prods 的流量路由到 Prod pod?