1
0
Fork 0

fully setup blackbox-exporter

This commit is contained in:
Massaki Archambault 2021-09-06 19:45:09 -04:00
parent beef8c1a3e
commit 0859b94acc
19 changed files with 57 additions and 18 deletions

View File

@ -1,3 +1,2 @@
resources: resources:
- blackbox-exporter-deployment.yaml - blackbox-exporter-deployment.yaml
- blackbox-exporter-probe.yaml

View File

@ -4,7 +4,7 @@ metadata:
name: drone name: drone
labels: labels:
app.kubernetes.io/name: drone app.kubernetes.io/name: drone
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${DRONE_EXTERNAL_HOST} - host: ${DRONE_EXTERNAL_HOST}

View File

@ -4,7 +4,7 @@ metadata:
name: gitea name: gitea
labels: labels:
app.kubernetes.io/name: gitea app.kubernetes.io/name: gitea
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${GITEA_EXTERNAL_HOST} - host: ${GITEA_EXTERNAL_HOST}

View File

@ -4,7 +4,7 @@ metadata:
name: grafana name: grafana
labels: labels:
app.kubernetes.io/name: grafana app.kubernetes.io/name: grafana
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${GRAFANA_EXTERNAL_HOST} - host: ${GRAFANA_EXTERNAL_HOST}

View File

@ -4,7 +4,7 @@ metadata:
name: kubernetes-dashboard name: kubernetes-dashboard
labels: labels:
app.kubernetes.io/name: kubernetes-dashboard app.kubernetes.io/name: kubernetes-dashboard
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${KUBERNETES_DASHBOARD_EXTERNAL_HOST} - host: ${KUBERNETES_DASHBOARD_EXTERNAL_HOST}

View File

@ -5,7 +5,7 @@ metadata:
namespace: longhorn-system namespace: longhorn-system
labels: labels:
app.kubernetes.io/name: longhorn-ui app.kubernetes.io/name: longhorn-ui
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${LONGHORN_EXTERNAL_HOST} - host: ${LONGHORN_EXTERNAL_HOST}

View File

@ -4,7 +4,7 @@ metadata:
name: nextcloud name: nextcloud
labels: labels:
app.kubernetes.io/name: nextcloud app.kubernetes.io/name: nextcloud
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${NEXTCLOUD_EXTERNAL_HOST} - host: ${NEXTCLOUD_EXTERNAL_HOST}

View File

@ -3,7 +3,3 @@ resources:
- prometheus-rbac.yaml - prometheus-rbac.yaml
- prometheus-ingress.yaml - prometheus-ingress.yaml
- traefik-podmonitor.yaml - traefik-podmonitor.yaml
- servicemonitors/generic-any-namespaces.yaml
- servicemonitors/kubelet.yaml
- servicemonitors/longhorn.yaml
- servicemonitors/prometheus.yaml

View File

@ -4,7 +4,7 @@ metadata:
name: prometheus name: prometheus
labels: labels:
app.kubernetes.io/name: prometheus app.kubernetes.io/name: prometheus
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${PROMETHEUS_EXTERNAL_HOST} - host: ${PROMETHEUS_EXTERNAL_HOST}

View File

@ -4,7 +4,7 @@ metadata:
name: traefik name: traefik
labels: labels:
app.kubernetes.io/name: traefik app.kubernetes.io/name: traefik
probe: blackbox probe: blackbox-http
spec: spec:
rules: rules:
- host: ${TRAEFIK_EXTERNAL_HOST} - host: ${TRAEFIK_EXTERNAL_HOST}

View File

@ -3,6 +3,11 @@ bases:
# - ../../bases/node-exporter # - ../../bases/node-exporter
- ../../bases/blackbox-exporter - ../../bases/blackbox-exporter
- ../../bases/kube-state-metrics - ../../bases/kube-state-metrics
- servicemonitors/any-namespaces-http.yaml
- servicemonitors/kubelet.yaml
- servicemonitors/longhorn.yaml
- servicemonitors/prometheus.yaml
- probes/blackbox-exporter.yaml
resources: resources:
- namespace.yaml - namespace.yaml

View File

@ -1,7 +1,7 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: Probe kind: Probe
metadata: metadata:
name: blackbox-exporter name: blackbox-exporter-http
labels: labels:
app.kubernetes.io/name: blackbox-exporter app.kubernetes.io/name: blackbox-exporter
monitor: prometheus monitor: prometheus
@ -15,4 +15,8 @@ spec:
any: true any: true
selector: selector:
matchLabels: matchLabels:
probe: blackbox probe: blackbox-http
relabelingConfigs:
- action: replace
sourceLabels: [__meta_kubernetes_ingress_label_app_kubernetes_io_name]
targetLabel: name

View File

@ -1,7 +1,7 @@
apiVersion: monitoring.coreos.com/v1 apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor kind: ServiceMonitor
metadata: metadata:
name: servicemonitor-http name: any-namespaces-http
labels: labels:
monitor: prometheus monitor: prometheus
spec: spec:

View File

@ -1,10 +1,13 @@
bases: bases:
- ../../namespaces/kubernetes-dashboard # - ../../namespaces/kubernetes-dashboard
- ../../namespaces/gitea - ../../namespaces/gitea
- ../../namespaces/grafana - ../../namespaces/grafana
- ../../namespaces/monitoring - ../../namespaces/monitoring
- ../../namespaces/nextcloud - ../../namespaces/nextcloud
resources:
- probes/external-services-bobcat-miner.yaml
images: images:
- name: gitea/gitea - name: gitea/gitea
newTag: 1.15.0 newTag: 1.15.0
@ -69,3 +72,6 @@ transformers:
# kind: Deployment # kind: Deployment
# name: nextcloud # name: nextcloud
# path: patches/nextcloud-deployment-patch.yaml # path: patches/nextcloud-deployment-patch.yaml
# patchesStrategicMerge:
# - patches/blackbox-exporter-probe-patch.yaml

View File

@ -0,0 +1,11 @@
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: blackbox-exporter
spec:
targets:
staticConfig:
static:
- http://192.168.40.30/
labels:
name: bobcat-miner

View File

@ -0,0 +1,18 @@
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: blackbox-exporter-bobcat-miner
labels:
app.kubernetes.io/name: blackbox-exporter
monitor: prometheus
namespace: monitoring
spec:
module: http_2xx
prober:
url: blackbox-exporter.monitoring.svc:9115
targets:
staticConfig:
static:
- http://192.168.40.30/
labels:
name: bobcat-miner