0

I am currently running Kong via Helm inside of a Google Kubernetes Engine (GKE) cluster. I have created the following Kubernetes Ingress Controller which forwards traffic to two services based on paths.

I noticed a very strange behaviour that the ingress controller works only half the time i.e. when accessing /api/foo, half the time I would be forwarded to bar-service and the other half of the time I would be forwarded to the correct foo-service, and vice versa.

Have I configured my Ingress correctly? Thank you!

kind: Ingress
apiVersion: extensions/v1beta1
metadata:
  name: kong-ingress
  annotations:
    kubernetes.io/ingress.allow-http: "true"
    kubernetes.io/ingress.class: "kong"
spec:
  rules:
  - http:
      paths:
      - path: /api/foo
        backend:
          serviceName: foo-service
          servicePort: 8080
      - path: /
        backend:
          serviceName: bar-service
          servicePort: 8080
Matthew Lau
  • 59
  • 1
  • 9

1 Answers1

1

Problem solved! It turns out both foo-service, and bar-service share the same selector, and matchLabels with their respective deployments. And therefore half the time foo-service is served by foo-deployment and the other half is served by bar-deployment.

Matthew Lau
  • 59
  • 1
  • 9