In the kube_prometheus_stack helm chart values.yaml file, I made the following changes to access the DNS records of Alertmanager, Grafana and Prometheus with ingress. Since we are currently using haproxy ingress for other services on EKS Kubernetes, I used haproxy ingress.
For Alertmanager:
alertmanager:
enabled: true
serviceAccount:
create: true
ingress:
enabled: true
annotations:
ingressClassName: haproxy
cert-manager.io/cluster-issuer: "letsencrypt"
haproxy.ingress.kubernetes.io/use-regex: "true"
haproxy.ingress.kubernetes.io/rewrite-target: /$1
labels:
app.kubernetes.io/instance: cert-manager
hosts:
- alertmanager.monitoring.new.io
tls:
- secretName: alertmanager-tls
hosts:
- alertmanager.monitoring.new.io
service:
port: 443
targetPort: 9093
For Grafana:
grafana:
enabled: true
service:
port: 443
targetPort: 3000
ingress:
enabled: true
annotations:
cert-manager.io/cluster-issuer: "letsencrypt"
kubernetes.io/ingress.class: haproxy
haproxy.ingress.kubernetes.io/use-regex: "true"
haproxy.ingress.kubernetes.io/rewrite-target: /$1
labels:
app.kubernetes.io/instance: cert-manager
hosts:
- grafana.monitoring.new.io
tls:
- secretName: test-grafana-tls
hosts:
- grafana.monitoring.new.io
For Prometheus:
prometheus:
enabled: true
serviceAccount:
create: true
ingress:
enabled: true
annotations:
ingressClassName: haproxy
cert-manager.io/cluster-issuer: "letsencrypt"
haproxy.ingress.kubernetes.io/use-regex: "true"
haproxy.ingress.kubernetes.io/rewrite-target: /$1
labels:
app.kubernetes.io/instance: cert-manager
hosts:
- prometheus.monitoring.new.io
tls:
- secretName: prometheus-tls
hosts:
- prometheus.monitoring.new.io
service:
port: 443
targetPort: 9090
I also defined DNS records on AWS Route-53 and made the necessary settings. But I can only access the Grafana WEb interface from the Grafana URL. When I try to access the Alertmanager and Prometheus web interfaces, I get a "default backend - 404" error.
Although I did a lot of research, I could not reach a clear conclusion. I wonder if I need to try a different method or where am I going wrong?