服务对外暴露2个域名ingress

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: api-gateway
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "traefik"
    traefik.frontend.rule.type: "PathPrefixStrip"
spec:
  rules:
  - host: openapi1.test.cn
    http:
      paths:
      - path: /
        backend:
          serviceName: api-gateway
          servicePort: 80
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: openapi2.aaa.cn
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "traefik"
    traefik.frontend.rule.type: "PathPrefixStrip"
spec:
  rules:
  - host: openapi2.aaa.cn
    http:
      paths:
      - path: /
        backend:
          serviceName: api-gateway
          servicePort: 80

通过2个ingress创建,ingress name不通即可

你可能感兴趣的:(容器)