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 00000000..49704bd7 Binary files /dev/null and b/assets/rancher-blackbox-exporter/rancher-blackbox-exporter-0.0.1.tgz differ diff --git a/charts/rancher-blackbox-exporter/0.0.1/Chart.yaml b/charts/rancher-blackbox-exporter/0.0.1/Chart.yaml new file mode 100644 index 00000000..f45d742d --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.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/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..1db5919b --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/files/rancher-ssl-certificate-monitor.json @@ -0,0 +1,671 @@ +{ + "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": 17, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "prometheus" + }, + "description": "", + "fieldConfig": { + "defaults": { + "custom": { + "align": "center", + "displayMode": "auto", + "filterable": false, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "instance" + }, + "properties": [ + { + "id": "custom.width", + "value": 20 + }, + { + "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.width" + }, + { + "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" + }, + { + "id": "custom.width", + "value": 20 + } + ] + }, + { + "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": [ + { + "id": "custom.width", + "value": 289 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "HTTP Response" + }, + "properties": [ + { + "id": "custom.width", + "value": 170 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Certificate expires in" + }, + "properties": [ + { + "id": "custom.width", + "value": 285 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Processing Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 167 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "TLS Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 188 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Connect Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 184 + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Resolve Time" + }, + "properties": [ + { + "id": "custom.width", + "value": 179 + } + ] + } + ] + }, + "gridPos": { + "h": 20, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 2, + "options": { + "footer": { + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 1, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Processing Time" + } + ] + }, + "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..ad2c1e4f --- /dev/null +++ b/charts/rancher-blackbox-exporter/0.0.1/templates/configmap.yaml @@ -0,0 +1,17 @@ +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..f7ad20c3 --- /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..e813a47b 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-05-26T18:19:01.020763+08:00" + description: Blackbox Exporter for Prometheus + digest: 32eee18f9499967575c8e3335faaf8b284701c8082b4d105dab4c22822c983b4 + 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'