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

View File

@ -67,132 +67,27 @@ data:
- "alertmanager.monitoring.svc:9093"
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:
- role: endpoints
scheme: https
- job_name: "haproxy"
scrape_interval: 5s
static_configs:
- targets: ['haproxy_exporter:9101']
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
- job_name: "rtmp-fra1"
scrape_interval: 5s
static_configs:
- targets: ['fra1.edge.lol:32113']
relabel_configs:
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: default;kubernetes;https
- job_name: "rtmp-lon1"
scrape_interval: 5s
static_configs:
- 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