Cannot create Ingress for Prometheus

3/25/2019

I would like to create an entry for Prometheus.

I have nodePort service deployed like this :

---
apiVersion: v1
kind: Service
metadata:
 name: prometheus
 namespace: monitoring
labels:
 app: prometheus
spec:
 type: NodePort
 ports:
  - port: 9090
    targetPort: 9090
    nodePort: 31190
    protocol: TCP
selector:
 app: prometheus

And my Ingress is :

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
 name: prometheus-ingress
 namespace: monitoring
 annotations:
  ingress.kubernetes.io/rewrite-target: /
spec:
 rules:
- host: prometheus.example.com
  http:
    paths:
      - path: /
        backend:
          serviceName: prometheus
          servicePort: 9090

Can you explain me why my ingress didn't work ?

-- M.Hol
google-cloud-platform
google-kubernetes-engine
kubernetes
prometheus

0 Answers