0

I expose my nginx service through traefik ingress controller. Unfortunately, it results with 503 error.

$ kubectl create deployment nginx --image=nginx
$ kubectl expose deployment nginx --port=80

My traefik ingress configuration following this documentation.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: nginx
          servicePort: http
Lukasz Dynowski
  • 11,169
  • 9
  • 81
  • 124

1 Answers1

2

It turned out that, I had to change servicePort: http to servicePort: 80 and this fixed the problem.

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: example
  annotations:
    kubernetes.io/ingress.class: traefik
spec:
  rules:
  - host: example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: nginx
          servicePort: 80
Lukasz Dynowski
  • 11,169
  • 9
  • 81
  • 124