This commit is contained in:
adelorenzo 2023-02-01 21:50:52 -06:00
parent f8ef695f20
commit 18296a3ace
2 changed files with 56 additions and 175 deletions

View File

@ -416,6 +416,12 @@ metadata:
namespace: monitoring namespace: monitoring
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap
metadata:
labels:
name: prometheus-server-conf
name: prometheus-server-conf
namespace: monitoring
data: data:
prometheus.rules: |- prometheus.rules: |-
groups: groups:
@ -428,60 +434,40 @@ data:
severity: slack severity: slack
annotations: annotations:
summary: High Memory Usage summary: High Memory Usage
prometheus.yml: "global:\n scrape_interval: 5s\n evaluation_interval: 5s\nrule_files:\n prometheus.yml: |-
\ - /etc/prometheus/prometheus.rules\nalerting:\n alertmanagers:\n - scheme: global:
http\n static_configs:\n - targets:\n - \"alertmanager.monitoring.svc:9093\"\n\nscrape_configs:\n scrape_interval: 5s
\ - job_name: 'node-exporter'\n kubernetes_sd_configs:\n - role: endpoints\n evaluation_interval: 5s
\ relabel_configs:\n - source_labels: [__meta_kubernetes_endpoints_name]\n rule_files:
\ regex: 'node-exporter'\n action: keep\n \n - job_name: 'kubernetes-apiservers'\n\n - /etc/prometheus/prometheus.rules
\ kubernetes_sd_configs:\n - role: endpoints\n scheme: https\n\n tls_config:\n alerting:
\ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt\n bearer_token_file: alertmanagers:
/var/run/secrets/kubernetes.io/serviceaccount/token\n\n relabel_configs:\n - scheme: http
\ - source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, static_configs:
__meta_kubernetes_endpoint_port_name]\n action: keep\n regex: default;kubernetes;https\n\n - targets:
\ - job_name: 'kubernetes-nodes'\n\n scheme: https\n\n tls_config:\n ca_file: - "alertmanager.monitoring.svc:9093"
/var/run/secrets/kubernetes.io/serviceaccount/ca.crt\n bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token\n\n
\ kubernetes_sd_configs:\n - role: node\n\n relabel_configs:\n - action: scrape_configs:
labelmap\n regex: __meta_kubernetes_node_label_(.+)\n - target_label:
__address__\n replacement: kubernetes.default.svc:443\n - source_labels: - job_name: "haproxy"
[__meta_kubernetes_node_name]\n regex: (.+)\n target_label: __metrics_path__\n scrape_interval: 5s
\ replacement: /api/v1/nodes/${1}/proxy/metrics \n \n - job_name: 'kubernetes-pods'\n\n static_configs:
\ kubernetes_sd_configs:\n - role: pod\n\n relabel_configs:\n - source_labels: - targets: ['haproxy_exporter:9101']
[__meta_kubernetes_pod_annotation_prometheus_io_scrape]\n action: keep\n
\ regex: true\n - source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]\n - job_name: "rtmp-fra1"
\ action: replace\n target_label: __metrics_path__\n regex: (.+)\n scrape_interval: 5s
\ - source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]\n static_configs:
\ action: replace\n regex: ([^:]+)(?::\\d+)?;(\\d+)\n replacement: - targets: ['fra1.edge.lol:32113']
$1:$2\n target_label: __address__\n - action: labelmap\n regex: __meta_kubernetes_pod_label_(.+)\n
\ - source_labels: [__meta_kubernetes_namespace]\n action: replace\n target_label: - job_name: "rtmp-lon1"
kubernetes_namespace\n - source_labels: [__meta_kubernetes_pod_name]\n action: scrape_interval: 5s
replace\n target_label: kubernetes_pod_name\n \n - job_name: 'kube-state-metrics'\n static_configs:
\ static_configs:\n - targets: ['kube-state-metrics.kube-system.svc.cluster.local:8080']\n\n - targets: ['lon1.edge.lol:32113']
\ - job_name: 'kubernetes-cadvisor'\n\n scheme: https\n\n tls_config:\n
\ ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt\n bearer_token_file: - job_name: "rtmp-nyc1"
/var/run/secrets/kubernetes.io/serviceaccount/token\n\n kubernetes_sd_configs:\n scrape_interval: 5s
\ - role: node\n\n relabel_configs:\n - action: labelmap\n regex: static_configs:
__meta_kubernetes_node_label_(.+)\n - target_label: __address__\n replacement: - targets: ['nyc1.edge.lol:32113']
kubernetes.default.svc:443\n - source_labels: [__meta_kubernetes_node_name]\n
\ regex: (.+)\n target_label: __metrics_path__\n replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor\n
\ \n - job_name: 'kubernetes-service-endpoints'\n\n kubernetes_sd_configs:\n
\ - role: endpoints\n\n relabel_configs:\n - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scrape]\n
\ action: keep\n regex: true\n - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_scheme]\n
\ action: replace\n target_label: __scheme__\n regex: (https?)\n
\ - source_labels: [__meta_kubernetes_service_annotation_prometheus_io_path]\n
\ action: replace\n target_label: __metrics_path__\n regex: (.+)\n
\ - source_labels: [__address__, __meta_kubernetes_service_annotation_prometheus_io_port]\n
\ action: replace\n target_label: __address__\n regex: ([^:]+)(?::\\d+)?;(\\d+)\n
\ replacement: $1:$2\n - action: labelmap\n regex: __meta_kubernetes_service_label_(.+)\n
\ - source_labels: [__meta_kubernetes_namespace]\n action: replace\n target_label:
kubernetes_namespace\n - source_labels: [__meta_kubernetes_service_name]\n
\ action: replace\n target_label: kubernetes_name"
kind: ConfigMap
metadata:
labels:
name: prometheus-server-conf
name: prometheus-server-conf
namespace: monitoring
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service

View File

@ -67,132 +67,27 @@ data:
- "alertmanager.monitoring.svc:9093" - "alertmanager.monitoring.svc:9093"
scrape_configs: scrape_configs:
- job_name: 'node-exporter'
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels: [__meta_kubernetes_endpoints_name]
regex: 'node-exporter'
action: keep
- job_name: 'kubernetes-apiservers'
kubernetes_sd_configs: - job_name: "haproxy"
- role: endpoints scrape_interval: 5s
scheme: https static_configs:
- targets: ['haproxy_exporter:9101']
tls_config: - job_name: "rtmp-fra1"
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt scrape_interval: 5s
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token static_configs:
- targets: ['fra1.edge.lol:32113']
relabel_configs: - job_name: "rtmp-lon1"
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name] scrape_interval: 5s
action: keep static_configs:
regex: default;kubernetes;https - targets: ['lon1.edge.lol:32113']
- job_name: 'kubernetes-nodes' - job_name: "rtmp-nyc1"
scrape_interval: 5s
static_configs:
- targets: ['nyc1.edge.lol:32113']
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__
replacement: kubernetes.default.svc:443
- source_labels: [__meta_kubernetes_node_name]
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics
- 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
- job_name: 'kube-state-metrics'
static_configs:
- targets: ['kube-state-metrics.kube-system.svc.cluster.local:8080']
- job_name: 'kubernetes-cadvisor'
scheme: https
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__
replacement: kubernetes.default.svc:443
- source_labels: [__meta_kubernetes_node_name]
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
- 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
--- ---
apiVersion: apps/v1 apiVersion: apps/v1