Version 0.9.0 and above of NGINX ingress have built-in support for exporting Prometheus metrics.
- In nginx-ingress daemonset need added annotation:
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
labels:
name: nginx-ingress-lb
name: nginx-ingress-lb
namespace: kube-system
spec:
selector:
matchLabels:
name: nginx-ingress-lb
template:
metadata:
+ annotations:
+ prometheus.io/port: "10254"
+ prometheus.io/scrape: "true"
and need restart nginx-ingress-lb on each node.
- In nginx-ingress configmap need added data:
$ kubectl edit cm/nginx-configuration -n kube-system
apiVersion: v1
+ data:
+ enable-vts-status: "true"
kind: ConfigMap
metadata:
labels:
name: ...
name: ...
namespace: ...
$ helm repo add iqoption https://iqoption.github.io/exporter-nginx-ingress
$ helm upgrade --install exporter-nginx-ingress iqoption/exporter-nginx-ingress --tiller-namespace kube-system
Support variables:
namespaceMonitoring: monitoring
insecureSkipVerify: true
service.type: ClusterIP
service.port: 80