From 479f34964ab8c9a8267d0b809f7b3ea399ab5e0e Mon Sep 17 00:00:00 2001 From: GGGitBoy <1812041288@qq.com> Date: Mon, 5 Jun 2023 17:58:50 +0800 Subject: [PATCH 1/2] PANDARIA: add rancher-blackbox-exporter chart --- .../rancher-blackbox-exporter/package.yaml | 3 + .../v0.0.1/Chart.yaml | 12 + .../v0.0.1/README.md | 1 + .../rancher-ssl-certificate-monitor.json | 621 ++++++++++++++++++ .../v0.0.1/questions.yml | 1 + .../v0.0.1/templates/_helpers.tpl | 12 + .../v0.0.1/templates/configmap-dashboard.yaml | 14 + .../v0.0.1/templates/configmap.yaml | 16 + .../v0.0.1/templates/deployment.yaml | 49 ++ .../v0.0.1/templates/probe.yaml | 20 + .../v0.0.1/templates/prometheusrule.yaml | 16 + .../v0.0.1/templates/service.yaml | 16 + .../v0.0.1/templates/servicemonitor.yaml | 22 + .../v0.0.1/values.yaml | 21 + 14 files changed, 824 insertions(+) create mode 100644 packages/rancher-blackbox-exporter/package.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/Chart.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/README.md create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/files/rancher-ssl-certificate-monitor.json create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/questions.yml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/_helpers.tpl create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/configmap-dashboard.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/configmap.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/deployment.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/probe.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/prometheusrule.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/service.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/templates/servicemonitor.yaml create mode 100644 packages/rancher-blackbox-exporter/v0.0.1/values.yaml diff --git a/packages/rancher-blackbox-exporter/package.yaml b/packages/rancher-blackbox-exporter/package.yaml new file mode 100644 index 00000000..05a2a769 --- /dev/null +++ b/packages/rancher-blackbox-exporter/package.yaml @@ -0,0 +1,3 @@ +url: local +workingDir: "v0.0.1" +version: 0.0.1 diff --git a/packages/rancher-blackbox-exporter/v0.0.1/Chart.yaml b/packages/rancher-blackbox-exporter/v0.0.1/Chart.yaml new file mode 100644 index 00000000..f45d742d --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/Chart.yaml @@ -0,0 +1,12 @@ +annotations: + catalog.cattle.io/kube-version: '>= 1.20.0-0' + catalog.cattle.io/namespace: cattle-monitoring-system + catalog.cattle.io/rancher-version: '>= 2.6.0-0' + catalog.cattle.io/release-name: rancher-blackbox-exporter + catalog.cattle.io/type: cluster-tool +apiVersion: v2 +description: Blackbox Exporter for Prometheus +keywords: +- prometheus +name: rancher-blackbox-exporter +version: 0.0.1 diff --git a/packages/rancher-blackbox-exporter/v0.0.1/README.md b/packages/rancher-blackbox-exporter/v0.0.1/README.md new file mode 100644 index 00000000..f12af664 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/README.md @@ -0,0 +1 @@ +# rancher-blackbox-exporter diff --git a/packages/rancher-blackbox-exporter/v0.0.1/files/rancher-ssl-certificate-monitor.json b/packages/rancher-blackbox-exporter/v0.0.1/files/rancher-ssl-certificate-monitor.json new file mode 100644 index 00000000..e25353c2 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/files/rancher-ssl-certificate-monitor.json @@ -0,0 +1,621 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "OpenAdvices first published Dahsboard: Just one Table Widget to display the Certificate and Connection Status from HTTPS Connections that are Monitored with Prometheus.", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 13230, + "graphTooltip": 0, + "id": 14, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": "center", + "displayMode": "auto", + "filterable": false, + "inspect": false, + "minWidth": 50 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #B" + }, + "properties": [ + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "max", + "value": 0.5 + }, + { + "id": "displayName", + "value": "Connect Time" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.2 + }, + { + "color": "red", + "value": 0.4 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #A" + }, + "properties": [ + { + "id": "decimals", + "value": 2 + }, + { + "id": "displayName", + "value": "Certificate expires in" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-red", + "value": null + }, + { + "color": "semi-dark-yellow", + "value": 12096000 + }, + { + "color": "semi-dark-green", + "value": 25920000 + } + ] + } + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "unit", + "value": "dtdurations" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #D" + }, + "properties": [ + { + "id": "displayName", + "value": "HTTP Response" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 300 + }, + { + "color": "red", + "value": 400 + } + ] + } + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "custom.align", + "value": "center" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #C" + }, + "properties": [ + { + "id": "displayName", + "value": "Transfer Time" + }, + { + "id": "max", + "value": 0.5 + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.125 + }, + { + "color": "red", + "value": 0.3 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #E" + }, + "properties": [ + { + "id": "displayName", + "value": "TLS Time" + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "max", + "value": 1 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.5 + }, + { + "color": "red", + "value": 0.9 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #F" + }, + "properties": [ + { + "id": "displayName", + "value": "Processing Time" + }, + { + "id": "max", + "value": 0.5 + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.25 + }, + { + "color": "red", + "value": 0.4 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #G" + }, + "properties": [ + { + "id": "displayName", + "value": "Resolve Time" + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "max", + "value": 0.01 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.005 + }, + { + "color": "red", + "value": 0.009 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Instance" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "HTTP Response" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Certificate expires in" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Processing Time" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "TLS Time" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Connect Time" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Resolve Time" + }, + "properties": [] + } + ] + }, + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 1, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.1.5", + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "probe_ssl_earliest_cert_expiry-time()", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_status_code", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "D" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "probe_http_duration_seconds{phase=\"resolve\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "G" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"connect\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "B" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"tls\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "E" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"processing\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "F" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"transfer\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" + } + ], + "title": "Certificate & Connection Monitoring", + "transformations": [ + { + "id": "seriesToColumns", + "options": { + "byField": "instance" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Time 1": true, + "Time 2": true, + "Time 3": true, + "Time 4": true, + "Time 5": true, + "Time 6": true, + "Time 7": true, + "__name__": true, + "__name__ 1": true, + "__name__ 2": true, + "__name__ 3": true, + "__name__ 4": true, + "__name__ 5": true, + "__name__ 6": true, + "container 1": true, + "container 2": true, + "container 3": true, + "container 4": true, + "container 5": true, + "container 6": true, + "container 7": true, + "endpoint 1": true, + "endpoint 2": true, + "endpoint 3": true, + "endpoint 4": true, + "endpoint 5": true, + "endpoint 6": true, + "endpoint 7": true, + "instance 1": false, + "job": true, + "job 1": true, + "job 2": true, + "job 3": true, + "job 4": true, + "job 5": true, + "job 6": true, + "job 7": true, + "namespace 1": true, + "namespace 2": true, + "namespace 3": true, + "namespace 4": true, + "namespace 5": true, + "namespace 6": true, + "namespace 7": true, + "phase": true, + "phase 1": true, + "phase 2": true, + "phase 3": true, + "phase 4": true, + "phase 5": true, + "pod 1": true, + "pod 2": true, + "pod 3": true, + "pod 4": true, + "pod 5": true, + "pod 6": true, + "pod 7": true, + "service 1": true, + "service 2": true, + "service 3": true, + "service 4": true, + "service 5": true, + "service 6": true, + "service 7": true + }, + "indexByName": {}, + "renameByName": { + "instance 1": "" + } + } + } + ], + "type": "table" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Rancher / SSL Certificate Monitor", + "uid": "rancher-ssl-certificate-monitor", + "version": 1, + "weekStart": "" +} diff --git a/packages/rancher-blackbox-exporter/v0.0.1/questions.yml b/packages/rancher-blackbox-exporter/v0.0.1/questions.yml new file mode 100644 index 00000000..d891df4a --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/questions.yml @@ -0,0 +1 @@ +rancher_min_version: 2.6.0-rc1 diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/_helpers.tpl b/packages/rancher-blackbox-exporter/v0.0.1/templates/_helpers.tpl new file mode 100644 index 00000000..3f5120c4 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/_helpers.tpl @@ -0,0 +1,12 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} + +{{- define "system_default_registry" -}} +{{- if .Values.global.systemDefaultRegistry -}} +{{- printf "%s/" .Values.global.systemDefaultRegistry -}} +{{- else -}} +{{- "" -}} +{{- end -}} +{{- end -}} diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/configmap-dashboard.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/configmap-dashboard.yaml new file mode 100644 index 00000000..8ca0a2aa --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/configmap-dashboard.yaml @@ -0,0 +1,14 @@ +{{- $files := .Files.Glob "files/rancher-ssl-certificate-monitor.json" }} +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: cattle-dashboards + name: rancher-blackbox-exporter-dashboards + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + grafana_dashboard: "1" +data: +{{- range $path, $fileContents := $files }} + ssl-certificate-monitor.json: {{ $.Files.Get $path | toJson }} +{{- end }} diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/configmap.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/configmap.yaml new file mode 100644 index 00000000..89cfda21 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/configmap.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: blackbox-exporter + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} +data: + config.yml: |- + modules: + http_2xx: + prober: http + http: + preferred_ip_protocol: "ip4" + tls_config: + insecure_skip_verify: true diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/deployment.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/deployment.yaml new file mode 100644 index 00000000..ef92017b --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + name: {{ .Chart.Name }} +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + template: + metadata: + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + spec: + containers: + - name: blackbox-exporter + image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} + ports: + - containerPort: {{ .Values.port }} + name: http + volumeMounts: + - name: config + mountPath: /etc/blackbox_exporter/ +{{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} +{{- end }} +{{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} +{{- end }} +{{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 10 }} +{{- end }} +{{- if .Values.resources }} + resources: +{{ toYaml .Values.resources | indent 12 }} +{{- end }} + volumes: + - name: config + configMap: + name: blackbox-exporter + defaultMode: 420 diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/probe.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/probe.yaml new file mode 100644 index 00000000..c63189f2 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/probe.yaml @@ -0,0 +1,20 @@ +apiVersion: monitoring.coreos.com/v1 +kind: Probe +metadata: + name: {{ .Chart.Name }} + labels: + chart: {{ .Chart.Name }} + release: rancher-monitoring +spec: + jobName: {{ .Chart.Name }}-probe + module: http_2xx + prober: + path: /probe + scheme: http + url: {{ .Chart.Name }}.{{ .Release.Namespace }}.svc:{{ .Values.port }} + targets: + staticConfig: + static: + {{- range .Values.staticUrl }} + - {{ . }} + {{- end }} diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/prometheusrule.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/prometheusrule.yaml new file mode 100644 index 00000000..aa47f013 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/prometheusrule.yaml @@ -0,0 +1,16 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ .Chart.Name }} +spec: + groups: + - name: ssl_expiry + rules: + - alert: Ssl Cert Will Expire in 30 days + annotations: + summary: "SSL certificate will expire soon on (instance {{`{{`}} $labels.instance {{`}}`}})" + description: "SSL certificate expires in 30 days\n VALUE = {{`{{`}} $value {{`}}`}}\n LABELS: {{`{{`}} $labels {{`}}`}}" + expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 30 + for: 300s + labels: + severity: warning diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/service.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/service.yaml new file mode 100644 index 00000000..7df4dc72 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }} + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + ports: + - name: http + port: {{ .Values.port }} + targetPort: {{ .Values.port }} diff --git a/packages/rancher-blackbox-exporter/v0.0.1/templates/servicemonitor.yaml b/packages/rancher-blackbox-exporter/v0.0.1/templates/servicemonitor.yaml new file mode 100644 index 00000000..975c00cb --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/templates/servicemonitor.yaml @@ -0,0 +1,22 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Chart.Name }} + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} +spec: + selector: + matchLabels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + endpoints: + - interval: 30s + params: + module: + - http_2xx + target: + - prometheus.io + path: /probe + port: http + scheme: http diff --git a/packages/rancher-blackbox-exporter/v0.0.1/values.yaml b/packages/rancher-blackbox-exporter/v0.0.1/values.yaml new file mode 100644 index 00000000..67f62d12 --- /dev/null +++ b/packages/rancher-blackbox-exporter/v0.0.1/values.yaml @@ -0,0 +1,21 @@ +enabled: false +image: + repository: "cnrancher/mirrored-prom-blackbox-exporter" + tag: v0.24.0 +replicas: 1 +resources: + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 100m + memory: 128Mi +nodeSelector: {} +tolerations: {} +affinity: {} +port: 9115 +staticUrl: +- https://kubernetes.default.svc:443 + +global: + systemDefaultRegistry: "" From b0282c018b7dddd6dd3563b7d4a3e77c67ae297d Mon Sep 17 00:00:00 2001 From: GGGitBoy <1812041288@qq.com> Date: Mon, 5 Jun 2023 17:59:10 +0800 Subject: [PATCH 2/2] PANDARIA: make charts --- .../rancher-blackbox-exporter-0.0.1.tgz | Bin 0 -> 3932 bytes .../0.0.1/Chart.yaml | 12 + .../rancher-blackbox-exporter/0.0.1/README.md | 1 + .../rancher-ssl-certificate-monitor.json | 621 ++++++++++++++++++ .../0.0.1/questions.yml | 1 + .../0.0.1/templates/_helpers.tpl | 12 + .../0.0.1/templates/configmap-dashboard.yaml | 14 + .../0.0.1/templates/configmap.yaml | 16 + .../0.0.1/templates/deployment.yaml | 49 ++ .../0.0.1/templates/probe.yaml | 20 + .../0.0.1/templates/prometheusrule.yaml | 16 + .../0.0.1/templates/service.yaml | 16 + .../0.0.1/templates/servicemonitor.yaml | 22 + .../0.0.1/values.yaml | 21 + index.yaml | 17 + 15 files changed, 838 insertions(+) create mode 100644 assets/rancher-blackbox-exporter/rancher-blackbox-exporter-0.0.1.tgz create mode 100644 charts/rancher-blackbox-exporter/0.0.1/Chart.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/README.md create mode 100644 charts/rancher-blackbox-exporter/0.0.1/files/rancher-ssl-certificate-monitor.json create mode 100644 charts/rancher-blackbox-exporter/0.0.1/questions.yml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/_helpers.tpl create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/configmap-dashboard.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/configmap.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/deployment.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/probe.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/prometheusrule.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/service.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/templates/servicemonitor.yaml create mode 100644 charts/rancher-blackbox-exporter/0.0.1/values.yaml diff --git a/assets/rancher-blackbox-exporter/rancher-blackbox-exporter-0.0.1.tgz b/assets/rancher-blackbox-exporter/rancher-blackbox-exporter-0.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..b72a50faf52fca20d01083a799a383128ff479c8 GIT binary patch literal 3932 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 1.20.0-0' + catalog.cattle.io/namespace: cattle-monitoring-system + catalog.cattle.io/rancher-version: '>= 2.6.0-0' + catalog.cattle.io/release-name: rancher-blackbox-exporter + catalog.cattle.io/type: cluster-tool +apiVersion: v2 +description: Blackbox Exporter for Prometheus +keywords: +- prometheus +name: rancher-blackbox-exporter +version: 0.0.1 diff --git a/charts/rancher-blackbox-exporter/0.0.1/README.md b/charts/rancher-blackbox-exporter/0.0.1/README.md new file mode 100644 index 00000000..f12af664 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/README.md @@ -0,0 +1 @@ +# rancher-blackbox-exporter diff --git a/charts/rancher-blackbox-exporter/0.0.1/files/rancher-ssl-certificate-monitor.json b/charts/rancher-blackbox-exporter/0.0.1/files/rancher-ssl-certificate-monitor.json new file mode 100644 index 00000000..e25353c2 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/files/rancher-ssl-certificate-monitor.json @@ -0,0 +1,621 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "target": { + "limit": 100, + "matchAny": false, + "tags": [], + "type": "dashboard" + }, + "type": "dashboard" + } + ] + }, + "description": "OpenAdvices first published Dahsboard: Just one Table Widget to display the Certificate and Connection Status from HTTPS Connections that are Monitored with Prometheus.", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 13230, + "graphTooltip": 0, + "id": 14, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": "center", + "displayMode": "auto", + "filterable": false, + "inspect": false, + "minWidth": 50 + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "displayName", + "value": "Instance" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #B" + }, + "properties": [ + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "max", + "value": 0.5 + }, + { + "id": "displayName", + "value": "Connect Time" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.2 + }, + { + "color": "red", + "value": 0.4 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #A" + }, + "properties": [ + { + "id": "decimals", + "value": 2 + }, + { + "id": "displayName", + "value": "Certificate expires in" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "semi-dark-red", + "value": null + }, + { + "color": "semi-dark-yellow", + "value": 12096000 + }, + { + "color": "semi-dark-green", + "value": 25920000 + } + ] + } + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "custom.align", + "value": "center" + }, + { + "id": "unit", + "value": "dtdurations" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #D" + }, + "properties": [ + { + "id": "displayName", + "value": "HTTP Response" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 300 + }, + { + "color": "red", + "value": 400 + } + ] + } + }, + { + "id": "custom.displayMode", + "value": "color-background" + }, + { + "id": "custom.align", + "value": "center" + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #C" + }, + "properties": [ + { + "id": "displayName", + "value": "Transfer Time" + }, + { + "id": "max", + "value": 0.5 + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.125 + }, + { + "color": "red", + "value": 0.3 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #E" + }, + "properties": [ + { + "id": "displayName", + "value": "TLS Time" + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "max", + "value": 1 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.5 + }, + { + "color": "red", + "value": 0.9 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #F" + }, + "properties": [ + { + "id": "displayName", + "value": "Processing Time" + }, + { + "id": "max", + "value": 0.5 + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.25 + }, + { + "color": "red", + "value": 0.4 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Value #G" + }, + "properties": [ + { + "id": "displayName", + "value": "Resolve Time" + }, + { + "id": "custom.displayMode", + "value": "lcd-gauge" + }, + { + "id": "max", + "value": 0.01 + }, + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "#EAB839", + "value": 0.005 + }, + { + "color": "red", + "value": 0.009 + } + ] + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Instance" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "HTTP Response" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Certificate expires in" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Processing Time" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "TLS Time" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Connect Time" + }, + "properties": [] + }, + { + "matcher": { + "id": "byName", + "options": "Resolve Time" + }, + "properties": [] + } + ] + }, + "gridPos": { + "h": 22, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 1, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "9.1.5", + "targets": [ + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "probe_ssl_earliest_cert_expiry-time()", + "format": "table", + "hide": false, + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "A" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_status_code", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "D" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "probe_http_duration_seconds{phase=\"resolve\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "G" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"connect\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "B" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"tls\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "E" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"processing\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "F" + }, + { + "datasource": { + "uid": "${DS_PROMETHEUS}" + }, + "expr": "probe_http_duration_seconds{phase=\"transfer\"}", + "format": "table", + "instant": true, + "interval": "", + "legendFormat": "", + "refId": "C" + } + ], + "title": "Certificate & Connection Monitoring", + "transformations": [ + { + "id": "seriesToColumns", + "options": { + "byField": "instance" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Time 1": true, + "Time 2": true, + "Time 3": true, + "Time 4": true, + "Time 5": true, + "Time 6": true, + "Time 7": true, + "__name__": true, + "__name__ 1": true, + "__name__ 2": true, + "__name__ 3": true, + "__name__ 4": true, + "__name__ 5": true, + "__name__ 6": true, + "container 1": true, + "container 2": true, + "container 3": true, + "container 4": true, + "container 5": true, + "container 6": true, + "container 7": true, + "endpoint 1": true, + "endpoint 2": true, + "endpoint 3": true, + "endpoint 4": true, + "endpoint 5": true, + "endpoint 6": true, + "endpoint 7": true, + "instance 1": false, + "job": true, + "job 1": true, + "job 2": true, + "job 3": true, + "job 4": true, + "job 5": true, + "job 6": true, + "job 7": true, + "namespace 1": true, + "namespace 2": true, + "namespace 3": true, + "namespace 4": true, + "namespace 5": true, + "namespace 6": true, + "namespace 7": true, + "phase": true, + "phase 1": true, + "phase 2": true, + "phase 3": true, + "phase 4": true, + "phase 5": true, + "pod 1": true, + "pod 2": true, + "pod 3": true, + "pod 4": true, + "pod 5": true, + "pod 6": true, + "pod 7": true, + "service 1": true, + "service 2": true, + "service 3": true, + "service 4": true, + "service 5": true, + "service 6": true, + "service 7": true + }, + "indexByName": {}, + "renameByName": { + "instance 1": "" + } + } + } + ], + "type": "table" + } + ], + "schemaVersion": 37, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-6h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Rancher / SSL Certificate Monitor", + "uid": "rancher-ssl-certificate-monitor", + "version": 1, + "weekStart": "" +} diff --git a/charts/rancher-blackbox-exporter/0.0.1/questions.yml b/charts/rancher-blackbox-exporter/0.0.1/questions.yml new file mode 100644 index 00000000..d891df4a --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/questions.yml @@ -0,0 +1 @@ +rancher_min_version: 2.6.0-rc1 diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/_helpers.tpl b/charts/rancher-blackbox-exporter/0.0.1/templates/_helpers.tpl new file mode 100644 index 00000000..3f5120c4 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/_helpers.tpl @@ -0,0 +1,12 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} + +{{- define "system_default_registry" -}} +{{- if .Values.global.systemDefaultRegistry -}} +{{- printf "%s/" .Values.global.systemDefaultRegistry -}} +{{- else -}} +{{- "" -}} +{{- end -}} +{{- end -}} diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/configmap-dashboard.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/configmap-dashboard.yaml new file mode 100644 index 00000000..8ca0a2aa --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/configmap-dashboard.yaml @@ -0,0 +1,14 @@ +{{- $files := .Files.Glob "files/rancher-ssl-certificate-monitor.json" }} +apiVersion: v1 +kind: ConfigMap +metadata: + namespace: cattle-dashboards + name: rancher-blackbox-exporter-dashboards + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + grafana_dashboard: "1" +data: +{{- range $path, $fileContents := $files }} + ssl-certificate-monitor.json: {{ $.Files.Get $path | toJson }} +{{- end }} diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/configmap.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/configmap.yaml new file mode 100644 index 00000000..89cfda21 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/configmap.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: blackbox-exporter + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} +data: + config.yml: |- + modules: + http_2xx: + prober: http + http: + preferred_ip_protocol: "ip4" + tls_config: + insecure_skip_verify: true diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/deployment.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/deployment.yaml new file mode 100644 index 00000000..ef92017b --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/deployment.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + name: {{ .Chart.Name }} +spec: + replicas: {{ .Values.replicas }} + selector: + matchLabels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + template: + metadata: + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + spec: + containers: + - name: blackbox-exporter + image: {{ template "system_default_registry" . }}{{ .Values.image.repository }}:{{ .Values.image.tag }} + ports: + - containerPort: {{ .Values.port }} + name: http + volumeMounts: + - name: config + mountPath: /etc/blackbox_exporter/ +{{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 10 }} +{{- end }} +{{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 10 }} +{{- end }} +{{- if .Values.tolerations }} + tolerations: +{{ toYaml .Values.tolerations | indent 10 }} +{{- end }} +{{- if .Values.resources }} + resources: +{{ toYaml .Values.resources | indent 12 }} +{{- end }} + volumes: + - name: config + configMap: + name: blackbox-exporter + defaultMode: 420 diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/probe.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/probe.yaml new file mode 100644 index 00000000..c63189f2 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/probe.yaml @@ -0,0 +1,20 @@ +apiVersion: monitoring.coreos.com/v1 +kind: Probe +metadata: + name: {{ .Chart.Name }} + labels: + chart: {{ .Chart.Name }} + release: rancher-monitoring +spec: + jobName: {{ .Chart.Name }}-probe + module: http_2xx + prober: + path: /probe + scheme: http + url: {{ .Chart.Name }}.{{ .Release.Namespace }}.svc:{{ .Values.port }} + targets: + staticConfig: + static: + {{- range .Values.staticUrl }} + - {{ . }} + {{- end }} diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/prometheusrule.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/prometheusrule.yaml new file mode 100644 index 00000000..aa47f013 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/prometheusrule.yaml @@ -0,0 +1,16 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ .Chart.Name }} +spec: + groups: + - name: ssl_expiry + rules: + - alert: Ssl Cert Will Expire in 30 days + annotations: + summary: "SSL certificate will expire soon on (instance {{`{{`}} $labels.instance {{`}}`}})" + description: "SSL certificate expires in 30 days\n VALUE = {{`{{`}} $value {{`}}`}}\n LABELS: {{`{{`}} $labels {{`}}`}}" + expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 30 + for: 300s + labels: + severity: warning diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/service.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/service.yaml new file mode 100644 index 00000000..7df4dc72 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/service.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Chart.Name }} + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} +spec: + type: ClusterIP + selector: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + ports: + - name: http + port: {{ .Values.port }} + targetPort: {{ .Values.port }} diff --git a/charts/rancher-blackbox-exporter/0.0.1/templates/servicemonitor.yaml b/charts/rancher-blackbox-exporter/0.0.1/templates/servicemonitor.yaml new file mode 100644 index 00000000..975c00cb --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/servicemonitor.yaml @@ -0,0 +1,22 @@ +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ .Chart.Name }} + labels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} +spec: + selector: + matchLabels: + chart: {{ .Chart.Name }} + release: {{ .Release.Name }} + endpoints: + - interval: 30s + params: + module: + - http_2xx + target: + - prometheus.io + path: /probe + port: http + scheme: http diff --git a/charts/rancher-blackbox-exporter/0.0.1/values.yaml b/charts/rancher-blackbox-exporter/0.0.1/values.yaml new file mode 100644 index 00000000..67f62d12 --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/values.yaml @@ -0,0 +1,21 @@ +enabled: false +image: + repository: "cnrancher/mirrored-prom-blackbox-exporter" + tag: v0.24.0 +replicas: 1 +resources: + limits: + cpu: 200m + memory: 256Mi + requests: + cpu: 100m + memory: 128Mi +nodeSelector: {} +tolerations: {} +affinity: {} +port: 9115 +staticUrl: +- https://kubernetes.default.svc:443 + +global: + systemDefaultRegistry: "" diff --git a/index.yaml b/index.yaml index f0a4bcd0..6c40f363 100755 --- a/index.yaml +++ b/index.yaml @@ -299,6 +299,23 @@ entries: urls: - assets/rancher-aks-operator-crd/rancher-aks-operator-crd-100.0.5+up1.0.6.tgz version: 100.0.5+up1.0.6 + rancher-blackbox-exporter: + - annotations: + catalog.cattle.io/kube-version: '>= 1.20.0-0' + catalog.cattle.io/namespace: cattle-monitoring-system + catalog.cattle.io/rancher-version: '>= 2.6.0-0' + catalog.cattle.io/release-name: rancher-blackbox-exporter + catalog.cattle.io/type: cluster-tool + apiVersion: v2 + created: "2023-06-05T17:58:57.575928+08:00" + description: Blackbox Exporter for Prometheus + digest: f047f7c1c04e7f632033dc1982218dd67712f85d9acb4bcaf79f4a718dcd2e67 + keywords: + - prometheus + name: rancher-blackbox-exporter + urls: + - assets/rancher-blackbox-exporter/rancher-blackbox-exporter-0.0.1.tgz + version: 0.0.1 rancher-gpu-management: - annotations: catalog.cattle.io/kube-version: '>= 1.18.0-0'