Skip to content

Ingress responding with 'default backend - 404' when using GKE #797

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

Closed
CGavrila opened this issue May 30, 2017 · 2 comments
Closed

Ingress responding with 'default backend - 404' when using GKE #797

CGavrila opened this issue May 30, 2017 · 2 comments

Comments

@CGavrila
Copy link

CGavrila commented May 30, 2017

Using the latest Kubernetes version in GCP (1.6.4), I have the following Ingress definition:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: myproject
  namespace: default
  annotations:
    ingress.kubernetes.io/rewrite-target: /
    kubernetes.io/ingress.class: "gce"
spec:
  rules:
  - host: staging.myproject.io
    http:
      paths:
      - path: /poller
        backend:
          serviceName: poller
          servicePort: 8080

Here is my service and deployment:

apiVersion: v1
kind: Service
metadata:
  name: poller
  labels:
    app: poller
    tier: backend
    role: service
spec:
  type: NodePort
  selector:
    app: poller
    tier: backend
    role: service
  ports:
  - port: 8080
    targetPort: 8080
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: poller
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: poller
        tier: backend
        role: service
    spec:
      containers:
      - name: poller
        image: gcr.io/myproject-1364/poller:latest
        imagePullPolicy: Always
        env:
        - name: SPRING_PROFILES_ACTIVE
          value: staging
        - name: GET_HOSTS_FROM
          value: dns
        ports:
        - containerPort: 8080

In my /etc/hosts I have a line like:

35.190.37.148 staging.myproject.io

However, I get default backend - 404 when curling any endpoint on staging.myproject.io:

$ curl staging.myproject.io/poller/cache/status
default backend - 404

I have the exact same configuration working locally inside Minikube, with the only difference being the domain (dev.myproject.io), and that works like a charm.

I have read and tried pretty much everything that I could find, including stuff from here and here and here, but maybe I'm just missing something... any ideas?

@nicksardo
Copy link
Contributor

Ingress controllers treat paths differently. #555 With the GCP controller, to match /poller/cache/status you'll need the path to be /poller/*.

Please post in stackoverflow for configuration issues in the future.

@CGavrila
Copy link
Author

CGavrila commented Jun 6, 2017

Thanks, @nicksardo, I'll try that. I only posted here because this looks like an inconsistency at first glance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants