diff --git a/.github/workflows/helm-release.yaml b/.github/workflows/helm-release.yaml index 3812602..0640b00 100644 --- a/.github/workflows/helm-release.yaml +++ b/.github/workflows/helm-release.yaml @@ -7,12 +7,17 @@ on: paths: - 'charts/**' - '.github/workflows/helm-release.yaml' + pull_request: + branches: + - main + paths: + - 'charts/**' permissions: contents: write jobs: - release: + build: runs-on: ubuntu-latest steps: - name: Checkout repository @@ -38,6 +43,27 @@ jobs: run: | helm repo index docs/ --url "https://freuds.github.io/custom-charts/" + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: helm-charts + path: docs/ + retention-days: 1 + + publish: + needs: build + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + name: helm-charts + path: docs/ + - name: Commit and push changes uses: stefanzweifel/git-auto-commit-action@v6 with: diff --git a/README.md b/README.md index 2e98fb8..7ddbbf1 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,10 @@ Ce dépôt contient des charts Helm personnalisés, packagés et publiés automa - `charts/` : Contient les charts Helm - `cronjob/` : Chart Helm pour déployer des CronJobs Kubernetes + - `gatus/` : Chart Helm pour déployer [Gatus](https://github.com/TwiN/gatus) webservice + - `grafana-dashboards/` : Chart Helm pour déployer des dashboards Grafana en tant que ConfigMaps + - `ihm/` : Chart Helm pour des webservices génériques + - `openvpn-exporter/` : Chart Helm pour exporter les métriques OpenVPN à Prometheus - `proxy/` : Chart Helm pour déployer un Ingress multi-ProxyPass - `ct.yaml` : Configuration Chart Testing (lint, validation) - `lintconf.yaml` : Règles de lint YAML diff --git a/charts/grafana-dashboards/Chart.yaml b/charts/grafana-dashboards/Chart.yaml index 5fcf438..c75e3c6 100644 --- a/charts/grafana-dashboards/Chart.yaml +++ b/charts/grafana-dashboards/Chart.yaml @@ -4,7 +4,7 @@ description: A Helm chart for deploying Grafana Dashboars as configMap in Kubern name: grafana-dashboards icon: https://freuds.github.io/custom-charts/imgs/grafana-dashboards.png type: application -version: 1.1.4 +version: 1.1.5 home: https://freuds.github.io/custom-charts sources: - https://freuds.github.io/custom-charts diff --git a/charts/grafana-dashboards/dashboards/gatus.json b/charts/grafana-dashboards/dashboards/gatus.json new file mode 100644 index 0000000..6aee1a4 --- /dev/null +++ b/charts/grafana-dashboards/dashboards/gatus.json @@ -0,0 +1,882 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Monitoring dashboard for service uptime monitoring using Gatus metrics", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 566, + "links": [], + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Services with certificate expiration warnings", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "noValue": "0", + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "yellow", + "value": 30 + }, + { + "color": "red", + "value": 7 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 0, + "y": 0 + }, + "id": 8, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "count(gatus_results_certificate_expiration_seconds < 2592000)", + "hide": false, + "legendFormat": "Expiring < 30 days", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "count(gatus_results_certificate_expiration_seconds < 604800)", + "legendFormat": "Expiring < 7 days", + "refId": "B" + } + ], + "title": "Certificate Warnings", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Overall service availability", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "max": 100, + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red" + }, + { + "color": "yellow", + "value": 95 + }, + { + "color": "green", + "value": 99 + } + ] + }, + "unit": "percent" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 4, + "y": 0 + }, + "id": 9, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "(sum(gatus_results_endpoint_success) / count(gatus_results_endpoint_success)) * 100", + "legendFormat": "Overall Availability", + "refId": "A" + } + ], + "title": "Overall Availability", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Number of services being monitored", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 8, + "y": 0 + }, + "id": 10, + "options": { + "colorMode": "background", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "count(gatus_results_endpoint_success)", + "legendFormat": "Total Services", + "refId": "A" + } + ], + "title": "Monitored Services", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Overview of service health status across all groups", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "vis": false, + "viz": false + } + }, + "mappings": [], + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 1, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "values": [] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "sum(gatus_results_endpoint_success) by (group)", + "legendFormat": "{{group}} - UP", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "sum(1 - gatus_results_endpoint_success) by (group)", + "legendFormat": "{{group}} - DOWN", + "refId": "B" + } + ], + "title": "Service Health by Group", + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "SSL certificate expiration times for all services", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red" + }, + { + "color": "#EAB839", + "value": 172800 + }, + { + "color": "green", + "value": 604800 + } + ] + }, + "unit": "dtdurations" + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Time Until Expiry" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "applyToRow": false, + "type": "color-background" + } + }, + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [] + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "gatus_results_certificate_expiration_seconds", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "refId": "A" + } + ], + "title": "SSL Certificate Expiration", + "transformations": [ + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "Value": false, + "__name__": true, + "app_kubernetes_io_instance": true, + "app_kubernetes_io_managed_by": true, + "app_kubernetes_io_name": true, + "app_kubernetes_io_service": true, + "helm_sh_chart": true, + "instance": true, + "job": true, + "key": true, + "type": true + }, + "includeByName": {}, + "indexByName": { + "Value": 2, + "group": 0, + "name": 1 + }, + "renameByName": { + "Value": "Time Until Expiry", + "group": "Group", + "name": "Service" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Current status of all monitored services", + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [ + { + "options": { + "0": { + "color": "red", + "index": 0, + "text": "DOWN" + }, + "1": { + "color": "green", + "index": 1, + "text": "UP" + } + }, + "type": "value" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "red" + }, + { + "color": "green", + "value": 1 + } + ] + } + }, + "overrides": [ + { + "matcher": { + "id": "byName", + "options": "Status" + }, + "properties": [ + { + "id": "custom.cellOptions", + "value": { + "type": "color-background" + } + } + ] + }, + { + "matcher": { + "id": "byName", + "options": "Response Time" + }, + "properties": [ + { + "id": "unit", + "value": "s" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 2, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": false, + "displayName": "Status" + } + ] + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "gatus_results_endpoint_success", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "gatus_results_duration_seconds", + "format": "table", + "instant": true, + "legendFormat": "__auto", + "refId": "B" + } + ], + "title": "Service Status Overview", + "transformations": [ + { + "id": "joinByField", + "options": { + "byField": "name", + "mode": "outer" + } + }, + { + "id": "organize", + "options": { + "excludeByName": { + "Time": true, + "__name__": true, + "app_kubernetes_io_instance": true, + "app_kubernetes_io_managed_by": true, + "app_kubernetes_io_name": true, + "app_kubernetes_io_service": true, + "group 2": true, + "helm_sh_chart": true, + "instance": true, + "job": true, + "key": true, + "type": true + }, + "includeByName": {}, + "indexByName": { + "Time 1": 4, + "Time 2": 15, + "Value #A": 2, + "Value #B": 3, + "__name__ 1": 5, + "__name__ 2": 16, + "app_kubernetes_io_instance 1": 6, + "app_kubernetes_io_instance 2": 17, + "app_kubernetes_io_managed_by 1": 7, + "app_kubernetes_io_managed_by 2": 18, + "app_kubernetes_io_name 1": 8, + "app_kubernetes_io_name 2": 19, + "app_kubernetes_io_service 1": 9, + "app_kubernetes_io_service 2": 20, + "group 1": 0, + "group 2": 21, + "helm_sh_chart 1": 10, + "helm_sh_chart 2": 22, + "instance 1": 11, + "instance 2": 23, + "job 1": 12, + "job 2": 24, + "key 1": 13, + "key 2": 25, + "name": 1, + "type 1": 14, + "type 2": 26 + }, + "renameByName": { + "Value #A": "Status", + "Value #B": "Response Time", + "group": "Group", + "group 1": "Group", + "name": "Service" + } + } + } + ], + "type": "table" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Response times for all monitored services", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "vis": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 16 + }, + "id": 4, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "gatus_results_duration_seconds", + "legendFormat": "{{name}} ({{group}})", + "refId": "A" + } + ], + "title": "Response Times", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "description": "Current status distribution across all services", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "barWidthFactor": 0.6, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "vis": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 16 + }, + "id": 5, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "hideZeros": false, + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "12.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "sum(gatus_results_endpoint_success)", + "legendFormat": "Services UP", + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "$datasource" + }, + "expr": "sum(1 - gatus_results_endpoint_success)", + "legendFormat": "Services DOWN", + "refId": "B" + } + ], + "title": "Service Status Distribution", + "type": "timeseries" + } + ], + "preload": false, + "refresh": "30s", + "schemaVersion": 41, + "tags": [ + "gatus", + "monitoring", + "uptime" + ], + "templating": { + "list": [ + { + "current": { + "text": "myprom", + "value": "PA04845DA3A4B088E" + }, + "description": "Select your Prometheus datasource", + "includeAll": false, + "label": "Datasource", + "name": "datasource", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + } + ] + }, + "time": { + "from": "now-1h", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Gatus - Service Monitoring Dashboard", + "uid": "gatus-monitoring2", + "version": 10 +}