Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kubernetes - Undefined backend #710

Closed
valentin2105 opened this issue Oct 2, 2016 · 1 comment
Closed

Kubernetes - Undefined backend #710

valentin2105 opened this issue Oct 2, 2016 · 1 comment

Comments

@valentin2105
Copy link

valentin2105 commented Oct 2, 2016

Hi,

I'm trying deploy Traefik (v1.0.3) in my Kubernetes cluster (GitVersion:"v1.3.6").

I have two deployments running : Wordpress and Flask (each on port 80).

My problem is :

Traefik only work with my wordpress deployment but give me an "Undefined Backend" for my Flask deployment. I use the same Deployment/SVC/Ingress pattern for my two deployments.

Here is some logs & configuration files :

WP-svc :

apiVersion: v1
kind: Service
metadata:
  labels:
    run: wp
  name: wp
  namespace: default
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    run: wp
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

WP-Ingress :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: wp
spec:
  rules:
  - host: wp.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: wp
          servicePort: http

Flask-svc :

apiVersion: v1
kind: Service
metadata:
  labels:
    run: flask
  name: flask
  namespace: default
spec:
  ports:
  - port: 80
    protocol: TCP
    targetPort: 80
  selector:
    run: flask
  sessionAffinity: None
  type: ClusterIP
status:
  loadBalancer: {}

Flask-Ingress :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: flask
spec:
  rules:
  - host: flask.example.com
    http:
      paths:
      - path: /
        backend:
          serviceName: flask
          servicePort: http

⚠️ Each SVC work fine when I reach each service IP.

Here is the Traefik's logs for WP :

time="2016-10-02T22:37:20Z" level=debug msg="Creating frontend wp.example.com/"
time="2016-10-02T22:37:20Z" level=debug msg="Wiring frontend wp.example.com/ to entryPoint http"
time="2016-10-02T22:37:20Z" level=debug msg="Creating route wp.example.com Host:wp.example.com"
time="2016-10-02T22:37:20Z" level=debug msg="Creating route / PathPrefix:/"
time="2016-10-02T22:37:20Z" level=debug msg="Creating backend wp.example.com/"
time="2016-10-02T22:37:20Z" level=debug msg="Creating load-balancer wrr"
time="2016-10-02T22:37:20Z" level=debug msg="Creating server http://10.200.1.x:80 at http://10.200.1.10:80 with weight 1"
time="2016-10-02T22:37:20Z" level=debug msg="Creating server http://10.200.1.x:80 at http://10.200.1.13:80 with weight 1"
time="2016-10-02T22:37:20Z" level=info msg="Server configuration reloaded on :80"

Here is the Traefik's logs for Flask :

time="2016-10-02T22:25:02Z" level=debug msg="Creating frontend flask.example.com/"
time="2016-10-02T22:25:02Z" level=debug msg="Wiring frontend flask.example.com/ to entryPoint http"
time="2016-10-02T22:25:02Z" level=debug msg="Creating route / PathPrefix:/"
time="2016-10-02T22:25:02Z" level=debug msg="Creating route flask.example.com Host:flask.example.com"
time="2016-10-02T22:25:02Z" level=debug msg="Creating backend flask.example.com/"
time="2016-10-02T22:25:02Z" level=error msg="Undefined backend 'flask.example.com/' for frontend flask.example.com/"
time="2016-10-02T22:25:02Z" level=error msg="Skipping frontend flask.example.com/..."

It's look like "Flask" svc is unavailable but I can reach my service in Kuber's API :

/api/v1/namespaces/default/services/flask --> Work fine.

Can you help me ?

@valentin2105
Copy link
Author

I found the bug,

replace :
servicePort: http
by :
servicePort: 80
In the ingress file.

I close the issue, can you make the changes in the documentation ?

Thanks a lot for Traefik. 🏆

@traefik traefik locked and limited conversation to collaborators Sep 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants