123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- # Define persistent storage for Prometheus (PVC)
- prometheus:
- prometheusSpec:
- storageSpec:
- volumeClaimTemplate:
- spec:
- accessModes: ["ReadWriteOnce"]
- storageClassName: do-block-storage
- resources:
- requests:
- storage: 5Gi
- # Define persistent storage for Grafana (PVC)
- grafana:
- # Set password for Grafana admin user
- adminPassword: letmein
- persistence:
- enabled: true
- storageClassName: do-block-storage
- accessModes: ["ReadWriteOnce"]
- size: 5Gi
- # Define persistent storage for Alertmanager (PVC)
- alertmanager:
- alertmanagerSpec:
- storage:
- volumeClaimTemplate:
- spec:
- accessModes: ["ReadWriteOnce"]
- storageClassName: do-block-storage
- resources:
- requests:
- storage: 5Gi
- # Change default node-exporter port
- prometheus-node-exporter:
- service:
- port: 30206
- targetPort: 30206
- # Disable Etcd metrics
- kubeEtcd:
- enabled: false
- # Disable Controller metrics
- kubeControllerManager:
- enabled: false
- # Disable Scheduler metrics
- kubeScheduler:
- enabled: false
- prometheus:
- prometheusSpec:
- additionalScrapeConfigs:
- # Scrape config for service endpoints.
- #
- # The relabeling allows the actual service scrape endpoint to be configured
- # via the following annotations:
- #
- # * `prometheus.io/scrape`: Only scrape services that have a value of `true`
- # * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
- # to set this to `https` & most likely set the `tls_config` of the scrape config.
- # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
- # * `prometheus.io/port`: If the metrics are exposed on a different port to the
- # service then set this appropriately.
- - job_name: 'kubernetes-service-endpoints'
- kubernetes_sd_configs:
- - role: endpoints
- relabel_configs:
- - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]
- action: keep
- regex: true
- - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]
- action: replace
- target_label: __scheme__
- regex: (https?)
- - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]
- action: replace
- target_label: __metrics_path__
- regex: (.+)
- - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]
- action: replace
- target_label: __address__
- regex: ([^:]+)(?::\d+)?;(\d+)
- replacement: $1:$2
- - action: labelmap
- regex: __meta_kubernetes_service_label_(.+)
- - source_labels: [__meta_kubernetes_namespace]
- action: replace
- target_label: kubernetes_namespace
- - source_labels: [__meta_kubernetes_service_name]
- action: replace
- target_label: kubernetes_name
- - source_labels: [__meta_kubernetes_service_name]
- action: drop
- regex: 'node-exporter'
- # Example scrape config for pods
- #
- # The relabeling allows the actual pod scrape endpoint to be configured via the
- # following annotations:
- #
- # * `prometheus.io/scrape`: Only scrape pods that have a value of `true`
- # * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
- # * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
- - job_name: 'kubernetes-pods'
- kubernetes_sd_configs:
- - role: pod
- relabel_configs:
- - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
- action: keep
- regex: true
- - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
- action: replace
- target_label: __metrics_path__
- regex: (.+)
- - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
- action: replace
- regex: ([^:]+)(?::\d+)?;(\d+)
- replacement: $1:$2
- target_label: __address__
- - action: labelmap
- regex: __meta_kubernetes_pod_label_(.+)
- - source_labels: [__meta_kubernetes_namespace]
- action: replace
- target_label: kubernetes_namespace
- - source_labels: [__meta_kubernetes_pod_name]
- action: replace
- target_label: kubernetes_pod_name
|