diff --git a/clusters/homelab/apps/monitoring/configmap-dashboards.yaml b/clusters/homelab/apps/monitoring/configmap-dashboards.yaml new file mode 100644 index 0000000..74bc129 --- /dev/null +++ b/clusters/homelab/apps/monitoring/configmap-dashboards.yaml @@ -0,0 +1,338 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: grafana-dashboard-sportmetrics + namespace: monitoring + labels: + grafana_dashboard: "1" +data: + sportmetrics.json: | + { + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, + "id": 5, + "panels": [], + "title": "Fitness", + "type": "row" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 25, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": 0 }, + { "color": "red", "value": 80 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 7, "w": 12, "x": 0, "y": 1 }, + "id": 2, + "options": { + "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } + }, + "pluginVersion": "12.4.1", + "targets": [ + { + "dataset": "garmin", + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n start_time AS time,\n (duration_seconds / 60) / (distance_meters / 1000) AS \"Pace (min/km)\"\nFROM activities\nWHERE type = 'running'\n AND distance_meters > 0\nORDER BY start_time", + "refId": "A", + "sql": { + "columns": [{ "parameters": [], "type": "function" }], + "groupBy": [{ "property": { "type": "string" }, "type": "groupBy" }], + "limit": 50 + } + } + ], + "title": "pace", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": 0 }, + { "color": "red", "value": 80 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 7, "w": 12, "x": 12, "y": 1 }, + "id": 4, + "options": { + "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, + "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } + }, + "pluginVersion": "12.4.1", + "targets": [ + { + "dataset": "garmin", + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n start_time AS time,\n max_hr AS \"Max HR\"\nFROM activities\nWHERE type = 'running'\n AND max_hr IS NOT NULL\nORDER BY start_time", + "refId": "A", + "sql": { + "columns": [{ "parameters": [], "type": "function" }], + "groupBy": [{ "property": { "type": "string" }, "type": "groupBy" }], + "limit": 50 + } + } + ], + "title": "max hr", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisGridShow": false, + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "bars", + "fillOpacity": 100, + "gradientMode": "hue", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": 0 }, + { "color": "red", "value": 80 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 7, "w": 12, "x": 0, "y": 8 }, + "id": 1, + "options": { + "legend": { "calcs": [], "displayMode": "list", "placement": "right", "showLegend": true }, + "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } + }, + "pluginVersion": "12.4.1", + "targets": [ + { + "dataset": "garmin", + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n start_time AS time,\n distance_meters / 1000 AS \"Distanz (km)\"\nFROM activities\nWHERE type = 'running'\nORDER BY start_time", + "refId": "A", + "sql": { + "columns": [{ "parameters": [], "type": "function" }], + "groupBy": [{ "property": { "type": "string" }, "type": "groupBy" }], + "limit": 50 + } + } + ], + "title": "distance", + "type": "timeseries" + }, + { + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "fieldConfig": { + "defaults": { + "color": { "mode": "palette-classic" }, + "custom": { + "axisBorderShow": true, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisGridShow": false, + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "bars", + "fillOpacity": 100, + "gradientMode": "hue", + "hideFrom": { "legend": false, "tooltip": false, "viz": false }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { "type": "linear" }, + "showPoints": "auto", + "showValues": false, + "spanNulls": false, + "stacking": { "group": "A", "mode": "none" }, + "thresholdsStyle": { "mode": "off" } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { "color": "green", "value": 0 }, + { "color": "red", "value": 80 } + ] + } + }, + "overrides": [] + }, + "gridPos": { "h": 7, "w": 12, "x": 12, "y": 8 }, + "id": 3, + "options": { + "legend": { "calcs": [], "displayMode": "list", "placement": "right", "showLegend": true }, + "tooltip": { "hideZeros": false, "mode": "single", "sort": "none" } + }, + "pluginVersion": "12.4.1", + "targets": [ + { + "dataset": "garmin", + "datasource": { + "type": "grafana-postgresql-datasource", + "uid": "bfgdydx75ju2of" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT\n start_time AS time,\n vo2max\nFROM activities\nWHERE type = 'running'\n AND vo2max IS NOT NULL\nORDER BY start_time", + "refId": "A", + "sql": { + "columns": [{ "parameters": [], "type": "function" }], + "groupBy": [{ "property": { "type": "string" }, "type": "groupBy" }], + "limit": 50 + } + } + ], + "title": "vo2max", + "type": "timeseries" + } + ], + "preload": false, + "schemaVersion": 42, + "tags": [], + "templating": { "list": [] }, + "time": { "from": "now-6h", "to": "now" }, + "timepicker": {}, + "timezone": "browser", + "title": "sportmetrics", + "uid": "adgxbg7", + "version": 18, + "weekStart": "" + } diff --git a/clusters/homelab/apps/monitoring/helmrelease.yaml b/clusters/homelab/apps/monitoring/helmrelease.yaml index 710b23a..b4c1473 100644 --- a/clusters/homelab/apps/monitoring/helmrelease.yaml +++ b/clusters/homelab/apps/monitoring/helmrelease.yaml @@ -16,13 +16,11 @@ spec: values: grafana: enabled: true - deploymentStrategy: - type: Recreate admin: existingSecret: alertmanager-telegram passwordKey: grafana_admin_password persistence: - enabled: true + enabled: false storageClassName: longhorn size: 1Gi alertmanager: diff --git a/clusters/homelab/apps/monitoring/kustomization.yaml b/clusters/homelab/apps/monitoring/kustomization.yaml index d39f759..47c493a 100644 --- a/clusters/homelab/apps/monitoring/kustomization.yaml +++ b/clusters/homelab/apps/monitoring/kustomization.yaml @@ -5,3 +5,4 @@ resources: - secret.sops.yaml - helmrepository.yaml - helmrelease.yaml + - configmap-dashboard.yaml diff --git a/clusters/homelab/apps/monitoring/secret.sops.yaml b/clusters/homelab/apps/monitoring/secret.sops.yaml index c541d82..59edd52 100644 --- a/clusters/homelab/apps/monitoring/secret.sops.yaml +++ b/clusters/homelab/apps/monitoring/secret.sops.yaml @@ -1,13 +1,13 @@ -apiVersion: ENC[AES256_GCM,data:2jI=,iv:2ZZpklehmjCSHy2CHTUungxXRhN/hfP3y1sXbdlpg6k=,tag:MjcYDwXU3b8VN1YzrGqEAA==,type:str] -kind: ENC[AES256_GCM,data:age5bkIi,iv:V9GcXs4/QRv5ZlrbZMG12N43TfkhCYVxsu8nBLwNqow=,tag:HQHR6PoJKFam0dJwWkSpEA==,type:str] +apiVersion: ENC[AES256_GCM,data:CCQ=,iv:UEkV+zqP5svl3EjRoedjfW22jqdAkFlGo35yfSQ5snE=,tag:Wim3cn/qMVAH4GY/opqsVg==,type:str] +kind: ENC[AES256_GCM,data:LNCyyb3i,iv:NQJYGC0VJg+J0kxtW+Hg685SnOL/ltN3xVKE1ncReW0=,tag:LIb/YE12p5Ov1E94WaGWHg==,type:str] metadata: - name: ENC[AES256_GCM,data:7qJFhd6J5jLCcOMH+AYf9eBpLAIU,iv:35hI2YbRLH5ODyAGGUBQZfyLDjw0vhVEiJXKfHxEnpM=,tag:sj3SST3blpt2baxMbtVcaw==,type:str] - namespace: ENC[AES256_GCM,data:EiMi4z5XbjtTzg==,iv:5F8Ez2kxHV0cvDjM9UEymV7bu6pUl/vsCfLT0pkisEo=,tag:eE/ohHVoC/lOpP+3bnPWqg==,type:str] + name: ENC[AES256_GCM,data:wKxOHms7qD2TGdbbJWYPu2rHT6Vs,iv:9nKQjNF0YQoTiBSOAn40JslvKInSkh3z2ZnGMV0UaG4=,tag:aOYVr9VZ7qWXEmMCMjR1+w==,type:str] + namespace: ENC[AES256_GCM,data:gkNTFxccRyhppg==,iv:Jri+itgHBKaCuGTM9fWTywlIC2YL+d/snD0xUBMkW6w=,tag:6lpNiA6WuHvoUihTD14sxw==,type:str] stringData: - telegram_bot_token: ENC[AES256_GCM,data:Pu8AwKPSJR0egNA7eMKkB6G1ZWcrJGUqsw5p+5DDn4F/MfUSebrwsjpVJYrOtw==,iv:TsPF3kySxICXywOUzdJ3q+IHw5BPbfPryfZPGmdDwB8=,tag:Of1hPcJXVJvLcVQn1Wlonw==,type:str] - telegram_chat_id: ENC[AES256_GCM,data:HMCLfilM/J76mg==,iv:8/zCSLYebB5P8zKFiiSznfszxTrGbcgkVLtB6O1Q+cU=,tag:zx/LrJ2QOwQ5mRTMZd4sNg==,type:str] - grafana_admin_password: ENC[AES256_GCM,data:sTRcPNOvjE0=,iv:0Eqxrf1FqjoufUuLoNqj1pXl4RzXZgKHqN7CZvO364M=,tag:5RXSpBsdQ4EKTqZ1wOJ+UA==,type:str] - admin-user: ENC[AES256_GCM,data:N85Pbns=,iv:PNK2RxMjCRrkabmvorbmLKa0vQ8WID5A3v1nfpkh0nE=,tag:zFBiwyKWPeWTiqJaPFn65Q==,type:str] + telegram_bot_token: ENC[AES256_GCM,data:0EXNBLsMLrchQBSpqP3cxgKYrQYtEo4RznrnuFZ8DcTvCLTTVor18BDcvpwmoA==,iv:9dAXbzfUeXofmm1FVOv13R2MxTGsuoa4YkX7HGXTj04=,tag:8wOByv0Jn7fcASAOvCLNDg==,type:str] + telegram_chat_id: ENC[AES256_GCM,data:eiGNYW+ZLs0wdw==,iv:vh9woopx6KbHnwop6LAQ5iVb4JcANhvpPkrSjjLS+uI=,tag:KmK0rUVILJ+uOcma4QRZZw==,type:str] + grafana_admin_password: ENC[AES256_GCM,data:xDyLV6SiPBA=,iv:6dMmJ3DD3NTcpEY91SlqMbXy91lxWpNZ6sr2hIbXgSE=,tag:+8vhndBsKIwF6/BIK5IhpQ==,type:str] + admin-user: ENC[AES256_GCM,data:SB12lC8=,iv:yTITKYAzIIeOi3qboaLgtK6PhDViBeuQ9iRpR5AcjXk=,tag:Ek6dvVOwMyaPYo4bg6Aitw==,type:str] sops: kms: [] gcp_kms: [] @@ -17,14 +17,14 @@ sops: - recipient: age1rydfcalt7pu4jnmh298lgjlasxyjldyaz3xyssk7v54lpu30fv0qna96ea enc: | -----BEGIN AGE ENCRYPTED FILE----- - YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBsNXBsSzc3TFVmV1JxK2NM - UGlRM3RtZkJuWU9DYThEYmg4K2UweWxTekFnClE1cSticFRYMGhpbTZEeVRxUFB0 - Ly9hWmVlOUtFWmJrblpremhjeTZFelkKLS0tIHZSODFMaTNUcldHanE1UStLek9I - VGFXcytqMWgvZE8rNWZZbTVBVm82ZWcK02uJ72SLyaUG0q4i62Fz0kGirh+AVfxd - ZAmaEDDgiO2g/mOPul+S9+w0xjfQ1o6KvAueC+b8V0N8orPnkKeRJw== + YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSBzblJuMHVROFpKQUdqbW1L + Z050alhuL2kzeFpUdS95N3orSlBxNFpCSUJjCmFEdEwvZy9NdGR4T0Ewc2JpZG0y + QzdiTWFJWkw2NjF5TDZjUVdtdnhnODQKLS0tIGNtYVl0cThVdlBhN2hxbyt4T1Jh + T0tLZzJjWHFEZzc1NDN3M1JyMmZBeFkK1j9WyP/Vl9TB08zNYEPcCiBNmBwJo9wa + JvwYLO5fNqzVF0/LZv5cN66/VVASiT45g5SCYEQwPknJ5I2y8GreOw== -----END AGE ENCRYPTED FILE----- - lastmodified: "2026-03-16T21:48:40Z" - mac: ENC[AES256_GCM,data:2erZGl60YkV4xyM9FyWP8B+GLmR7gqjJqQf+AdqE4yEPCev+JGadSuO/j95GdW9oUP/6MgfZsJkzatfm/ikNH2VSj0/vh2WIL2dfTic+TPWqAEI2WWewMGAw+i/MCq1Gm3ziY1wQqHSVGGTRkQ36zB7A0Wf65p6KsgayE4RIzXk=,iv:b+uXFZHvykiIOVZY+3lNyDy+ViiyZVWTsMBdQCiF960=,tag:ASV1c8WVvpwiXJdMAvQXBw==,type:str] + lastmodified: "2026-03-22T09:46:00Z" + mac: ENC[AES256_GCM,data:wFCplZFlywxWu/xTjcNS7awv5TnuygFmqdzZEk70F6N1De3DpYSVI4xNPZ4y5sS52hcGAJxE6gMmCaVhDUkk2YEL5mYAKPgypRs1NiRzoMkU5/flTHuB7sRjp/2+mckpz71bVA5r0qxOYmimMIcv+kvI8LGDSFgGGmfcim4a/EY=,iv:6HEb4Ln/EGkZl0K2glC98xeTefAlDeS3dY8gZcFusRE=,tag:tdzwBfduYf5gBd96WrrKKA==,type:str] pgp: [] unencrypted_suffix: _unencrypted version: 3.9.4