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

URL map / backend service mapping is totally shuffled #555

Closed
cdaguerre opened this issue Nov 22, 2018 · 3 comments
Closed

URL map / backend service mapping is totally shuffled #555

cdaguerre opened this issue Nov 22, 2018 · 3 comments

Comments

@cdaguerre
Copy link

cdaguerre commented Nov 22, 2018

Hi, I have a single ingress pointing to multiple backend services with the following configuration:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: services
  annotations:
    kubernetes.io/ingress.class: gce
    kubernetes.io/ingress.global-static-ip-name: {{ .Values.ipName }}
    ingress.gcp.kubernetes.io/pre-shared-cert: {{ .Values.certificateName }}
spec:
  backend:
    serviceName: prometheus-grafana
    servicePort: 80
  rules:
  - host: grafana.{{ .Values.host }}
    http:
      paths:
      - path: /
        backend:
          serviceName: prometheus-grafana
          servicePort: 80
  - host: prometheus.{{ .Values.host }}
    http:
      paths:
      - path: /
        backend:
          serviceName: prometheus-prometheus
          servicePort: 9090
  - host: alerts.{{ .Values.host }}
    http:
      paths:
      - path: /
        backend:
          serviceName: prometheus-alertmanager
          servicePort: 9093
  - host: rabbitmq.{{ .Values.host }}
    http:
      paths:
      - path: /
        backend:
          serviceName: rabbitmq
          servicePort: 15672
  {{- if .Values.mailcatcherEnabled }}
  - host: mailcatcher.{{ .Values.host }}
    http:
      paths:
      - path: /
        backend:
          serviceName: mailcatcher
          servicePort: 80
  {{- end }}

These are all nodePort services with:
prometheus: 32500
alertmanager: 32501
grafana: 32502
mailcatcher: 32600
rabbitmq: 30385

The (automatically created) GCLB mixes up the url map, see below:
capture d ecran 2018-11-22 a 17 35 28
disclaimer: I searched the repo but didn't find any similar issues... ;)

@agadelshin
Copy link
Contributor

it's not mixed up. Default backend is grafana, so all unmatched requests go to grafana Backend. It acts like backend for 404 code handling.

you have to specify /* path for all host rules.

@agadelshin
Copy link
Contributor

Can't find where this magic happens in source code. If someone can point me to function where defaut backend is assigned to unmatched paths I'll be very happy.

@cdaguerre
Copy link
Author

@pondohva thanks. I could have figured that out myself ;)
I was migrating from nginx-ingress and expected the path matching to be the same.
Thanks!

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