Traefik is failing to distribute traffic between multiple host URLs

17 Views Asked by At

We have two environments, dev and qa. When we deploy the Ingress resources, we are only able to access whichever environment was deployed first. Why is this happening?

kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
  name: dev-ingress
  namespace: dev
  annotations:
    traefik.ingress.kubernetes.io/router.entrypoints: web

spec:
  rules:
    - host: dev.example.com
      http:
        paths:
          - path: /
            backend:
              serviceName: dev
              servicePort: 80
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: dev
  namespace: dev
  labels:
    app: dev
    name: dev

spec:
  replicas: 2
  selector:
    matchLabels:
      app: dev
  template:
    metadata:
      labels:
        app: dev
    spec:
      containers:
        - name: devdev
          image: dev/dev
          ports:
            - containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: dev

spec:
  ports:
    - name: http
      port: 80
  selector:
    app: dev

0

There are 0 best solutions below