ServiceMonitor with using https and TLS¶
This example show a basic configuration for ServiceMonitor.
spec:
endpoints:
- interval: 30s
port: metrics
scheme: https
tlsConfig:
caFile: /etc/prometheus/secrets/kube-etcd-client-certs/etcd-client-ca.crt
certFile: /etc/prometheus/secrets/kube-etcd-client-certs/etcd-client.crt
keyFile: /etc/prometheus/secrets/kube-etcd-client-certs/etcd-client.key
serverName: ""
jobLabel: k8s-app
namespaceSelector:
matchNames:
- kube-system
selector:
matchLabels:
k8s-app: etcd
It means that Prometheus will collect metrics from service with settings:
- metrics will collect with job with label
k8s-app
- metrics will collect from all pods with label
k8s-app: etcd
- metrics will collect from all discovered pod from port with name
metrics
with interval30s
and schemahttps
- metrics will collect with TLS config and specified certificates
- for verify certificates will use name "" (specify in
serverName: ""
)
Files¶
How to apply example¶
Kubernetes:
OpenShift:
Links¶
Prometheus operator API
Victoriametrics operator API