charts icon indicating copy to clipboard operation
charts copied to clipboard

[stable/prometheus] server, alertmanager and pushgateway return 404 not found when using ingress path

Open aroes opened this issue 7 years ago • 3 comments

Describe the bug When configuring the ingress values, adding a path to the "ingress.hosts" values results in 404s

Version of Helm and Kubernetes: Helm version:

Client: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.3", GitCommit:"0e7f3b6637f7af8fcfddb3d2941fcc7cbebb0085", GitTreeState:"clean"}

Kubernetes version:

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.2", GitCommit:"f6278300bebbb750328ac16ee6dd3aa7d3549568", GitTreeState:"clean", BuildDate:"2019-08-05T09:23:26Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.8", GitCommit:"a89f8c11a5f4f132503edbc4918c98518fd504e3", GitTreeState:"clean", BuildDate:"2019-04-23T04:41:47Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}

Which chart:

stable/prometheus

What happened: Using the values file below:

alertmanager:
  ingress:
    enabled: true
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
      kubernetes.io/ingress.class: system
    hosts:
      - alerts.example.com/alertmanager
pushgateway:
  ingress:
    enabled: true
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
      kubernetes.io/ingress.class: system
    hosts:
      - pushgateway.example.com
server:
  ingress:
    enabled: true
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
      kubernetes.io/ingress.class: system
    hosts:
      - prometheus.example.com/server/

What you expected to happen: Both cases should work (subdomain and path) Currently a valid path returns 404 not found, invalid path returns 404 not found - default backend

How to reproduce it (as minimally and precisely as possible): Install nginx controller for ingress. helm install --name prometheus stable/prometheus -f prometheus-values.yaml

Summary: Using the values file above, pushgateway.example.com will work, alerts.example.com/alertmanager and prometheus.example.com/server will return 404 not found.

aroes avatar Aug 09 '19 14:08 aroes

So, the service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0 annotation should actually be in the ingress controller specs, so I doubt that's actually doing anything.

I'm almost certain that you need a rewrite target annotation as well, ex: nginx.ingress.kubernetes.io/rewrite-target: /$2

However, that requires the path to have something appended to the path like: (/|$)(.*)

Given that this helm chart is expecting the whole url + path as the host, I think for hosts: you'd need to do something like: prometheus.example.com/server(/|$)(.*)

I'm currently testing this, I'll update with results

alistardust avatar Aug 21 '19 19:08 alistardust

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

stale[bot] avatar Sep 20 '19 19:09 stale[bot]

This issue is being automatically closed due to inactivity.

stale[bot] avatar Oct 04 '19 20:10 stale[bot]