-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
This enhancement is to support prometheus servicemonitor
for NGINX Ingress controller helm deployments.
References:
Being able to leverage the servicemonitor
CRD that prometheus provides, allows users to have more flexibility and control when collecting metrics for NGINX Ingress controller.
This request will add support for both helm
and manifest
deployments, allowing customer to enable (helm) or apply (manifest) the additional services and servicemonitor that are required.
When using helm
, if the user opts to enable servicemonitor
the deployment will generate the appropriate service
and servicemonitor
required.
Example manifests (thanks @hostalp)
Additional service required:
apiVersion: v1
kind: Service
metadata:
name: nginx-ingress-nginx-ingress-servicemonitor
labels:
app: nginx-ingress-nginx-ingress-servicemonitor
spec:
ports:
- name: prometheus
protocol: TCP
port: 9113
targetPort: 9113
selector:
app: nginx-ingress-nginx-ingress
Servicemonitor definition:
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: nginx-ingress-nginx-ingress-servicemonitor
labels:
app: nginx-ingress-nginx-ingress-servicemonitor
release: kube-prometheus-stack
spec:
selector:
matchLabels:
app: nginx-ingress-nginx-ingress-servicemonitor
endpoints:
- port: prometheus
The user will have to have ensure they have prometheus installed and running correctly in there cluster in order for servicemonitor
to work correctly.
### Tasks
- [ ] https://github.com/nginxinc/kubernetes-ingress/issues/4329
- [ ] https://github.com/nginxinc/kubernetes-ingress/issues/4328
- [ ] https://github.com/nginxinc/kubernetes-ingress/issues/4330