From d0d62e88475f1d704953b2d7d3ccf013fdcfe9d6 Mon Sep 17 00:00:00 2001 From: klinch0 <68821526+klinch0@users.noreply.github.com> Date: Tue, 25 Feb 2025 12:08:08 +0300 Subject: [PATCH] feature/add-goldpinger (#648) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary by CodeRabbit - **New Features** - Introduced a comprehensive Grafana dashboard for Goldpinger, offering real-time insights into node health, error occurrences, and response times with intuitive filtering. - Expanded deployment configurations to include Goldpinger across environments, streamlining release management and dependency handling. - Launched a dedicated deployment package featuring customizable templates for secure, efficient Kubernetes deployments—including workloads, services, ingress, and monitoring integrations. --- dashboards/goldpinger/goldpinger.json | 1206 +++++++++++++++++ hack/download-dashboards.sh | 1 + packages/core/platform/bundles/paas-full.yaml | 7 + .../core/platform/bundles/paas-hosted.yaml | 7 + packages/extra/monitoring/dashboards.list | 1 + packages/system/goldpinger/Chart.yaml | 3 + packages/system/goldpinger/Makefile | 7 + .../goldpinger/charts/goldpinger/.helmignore | 23 + .../goldpinger/charts/goldpinger/Chart.yaml | 9 + .../charts/goldpinger/templates/_helpers.tpl | 62 + .../goldpinger/templates/clusterrole.yaml | 12 + .../templates/clusterrolebinding.yaml | 16 + .../goldpinger/templates/configmap.yaml | 8 + .../goldpinger/templates/daemonset.yaml | 103 ++ .../charts/goldpinger/templates/ingress.yaml | 61 + .../goldpinger/templates/prometheusrule.yaml | 19 + .../charts/goldpinger/templates/role.yaml | 20 + .../goldpinger/templates/rolebinding.yaml | 16 + .../charts/goldpinger/templates/service.yaml | 26 + .../goldpinger/templates/serviceaccount.yaml | 8 + .../goldpinger/templates/servicemonitor.yaml | 32 + .../goldpinger/charts/goldpinger/values.yaml | 166 +++ packages/system/goldpinger/values.yaml | 5 + 23 files changed, 1818 insertions(+) create mode 100644 dashboards/goldpinger/goldpinger.json create mode 100644 packages/system/goldpinger/Chart.yaml create mode 100644 packages/system/goldpinger/Makefile create mode 100644 packages/system/goldpinger/charts/goldpinger/.helmignore create mode 100644 packages/system/goldpinger/charts/goldpinger/Chart.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/_helpers.tpl create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/clusterrole.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/clusterrolebinding.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/configmap.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/daemonset.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/ingress.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/prometheusrule.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/role.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/rolebinding.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/service.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/serviceaccount.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/templates/servicemonitor.yaml create mode 100644 packages/system/goldpinger/charts/goldpinger/values.yaml create mode 100644 packages/system/goldpinger/values.yaml diff --git a/dashboards/goldpinger/goldpinger.json b/dashboards/goldpinger/goldpinger.json new file mode 100644 index 00000000..179e5fb0 --- /dev/null +++ b/dashboards/goldpinger/goldpinger.json @@ -0,0 +1,1206 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "goldpinger", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 224, + "links": [], + "panels": [ + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 21, + "panels": [], + "title": "Overall Health", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "fieldConfig": { + "defaults": { + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(55, 174, 50, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 31 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 32 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 0, + "y": 1 + }, + "id": 9, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "(count(goldpinger_nodes_health_total{status='healthy'}) + count(goldpinger_nodes_health_total{status='unhealthy'})) /2", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "metric": "goldpinger_nodes_health", + "refId": "A", + "step": 600 + } + ], + "title": "Goldpinger Nodes", + "type": "stat" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "fieldConfig": { + "defaults": { + "mappings": [ + { + "options": { + "match": "null", + "result": { + "text": "N/A" + } + }, + "type": "special" + } + ], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "rgba(55, 174, 50, 0.97)", + "value": null + }, + { + "color": "rgba(237, 129, 40, 0.89)", + "value": 1 + }, + { + "color": "rgba(245, 54, 54, 0.9)", + "value": 2 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 4, + "x": 4, + "y": 1 + }, + "id": 20, + "maxDataPoints": 100, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "horizontal", + "percentChangeColorMode": "standard", + "reduceOptions": { + "calcs": [ + "mean" + ], + "fields": "", + "values": false + }, + "showPercentChange": false, + "textMode": "auto", + "wideLayout": true + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "sum(increase(goldpinger_errors_total{goldpinger_instance=~\"$instance\"}[30m]))", + "format": "time_series", + "intervalFactor": 2, + "legendFormat": "", + "metric": "goldpinger_nodes_health", + "refId": "A", + "step": 600 + } + ], + "title": "Increase in # Errors [30m]", + "type": "stat" + }, + { + "columns": [ + { + "text": "Current", + "value": "current" + }, + { + "text": "Max", + "value": "max" + }, + { + "text": "Avg", + "value": "avg" + } + ], + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "editable": true, + "error": false, + "fieldConfig": { + "defaults": {}, + "overrides": [] + }, + "fontSize": "100%", + "gridPos": { + "h": 8, + "w": 16, + "x": 8, + "y": 1 + }, + "id": 11, + "options": {}, + "pluginVersion": "11.4.0", + "scroll": true, + "showHeader": true, + "sort": { + "desc": false + }, + "styles": [ + { + "align": "auto", + "dateFormat": "YYYY-MM-DD HH:mm:ss", + "pattern": "Time", + "type": "date" + }, + { + "align": "auto", + "colorMode": "value", + "colors": [ + "rgba(50, 172, 45, 0.97)", + "rgba(237, 129, 40, 0.89)", + "rgba(245, 54, 54, 0.9)" + ], + "decimals": 2, + "link": false, + "pattern": "/.*/", + "thresholds": [ + "1", + "2" + ], + "type": "number", + "unit": "short" + } + ], + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "sum(goldpinger_nodes_health_total{status='unhealthy'}) by (goldpinger_instance)", + "format": "table", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 40 + } + ], + "title": "Unhealthy seen by instance", + "transform": "table", + "type": "table-old" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 9 + }, + "id": 12, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "sum(increase(goldpinger_nodes_health_total{goldpinger_instance=~\"$instance\", status=\"unhealthy\"}[30m])) by (goldpinger_instance)", + "format": "time_series", + "interval": "5m", + "intervalFactor": 1, + "legendFormat": "{{ goldpinger_instance }}", + "metric": "goldpinger_nodes_health", + "refId": "A", + "step": 300 + } + ], + "title": "Unhealthy nodes increase [30m]", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 6, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "always", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "percentunit" + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 9 + }, + "id": 10, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "sum(increase(goldpinger_nodes_health_total{goldpinger_instance=~\"$instance\",status=\"unhealthy\"}[30m])) by (goldpinger_instance) / (sum(increase(goldpinger_nodes_health_total{goldpinger_instance=~\"$instance\",status=\"healthy\"}[30m])) by (goldpinger_instance) + sum(increase(goldpinger_nodes_health_total{goldpinger_instance=~\"$instance\",status=\"unhealthy\"}[30m])) by (goldpinger_instance))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 1, + "legendFormat": "{{ goldpinger_instance }}", + "metric": "goldpinger_nodes_health", + "refId": "A", + "step": 60 + } + ], + "title": "% Unhealthy nodes reported", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 17 + }, + "id": 22, + "panels": [], + "title": "Connections to peers", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 0, + "y": 18 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "histogram_quantile(0.99, sum(rate(goldpinger_peers_response_time_s_bucket{goldpinger_instance=~\"$instance\",call_type=~\"$call_type\"}[30m])) by (goldpinger_instance, le))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 120 + } + ], + "title": "99% response time from node [30m]", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 8, + "y": 18 + }, + "id": 16, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "histogram_quantile(0.95, sum(rate(goldpinger_peers_response_time_s_bucket{goldpinger_instance=~\"$instance\",call_type=~\"$call_type\"}[30m])) by (goldpinger_instance, le))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 120 + } + ], + "title": "95% response time from node [30m]", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 16, + "y": 18 + }, + "id": 17, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "histogram_quantile(0.50, sum(rate(goldpinger_peers_response_time_s_bucket{goldpinger_instance=~\"$instance\",call_type=~\"$call_type\"}[30m])) by (goldpinger_instance, le))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 120 + } + ], + "title": "50% response time from node [30m]", + "type": "timeseries" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 23, + "panels": [], + "title": "Connections to Kubernetes API", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 0, + "y": 29 + }, + "id": 13, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "histogram_quantile(0.99, sum(rate(goldpinger_kube_master_response_time_s_bucket{goldpinger_instance=~\"$instance\"}[30m])) by (goldpinger_instance, le))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 120 + } + ], + "title": "99% response time from k8s api [30m]", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 8, + "y": 29 + }, + "id": 18, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "histogram_quantile(0.95, sum(rate(goldpinger_kube_master_response_time_s_bucket{goldpinger_instance=~\"$instance\"}[30m])) by (goldpinger_instance, le))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 120 + } + ], + "title": "95% response time from k8s api [30m]", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "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, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "s" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 8, + "x": 16, + "y": 29 + }, + "id": 19, + "options": { + "legend": { + "calcs": [ + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "24b0d575-0cea-474c-a4eb-c225d250858d" + }, + "expr": "histogram_quantile(0.50, sum(rate(goldpinger_kube_master_response_time_s_bucket{goldpinger_instance=~\"$instance\"}[30m])) by (goldpinger_instance, le))", + "format": "time_series", + "interval": "1m", + "intervalFactor": 2, + "legendFormat": "{{ goldpinger_instance }}", + "refId": "A", + "step": 120 + } + ], + "title": "50% response time from k8s api [30m]", + "type": "timeseries" + } + ], + "preload": false, + "refresh": "5m", + "schemaVersion": 40, + "tags": [], + "templating": { + "list": [ + { + "allValue": ".*", + "current": { + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": "24b0d575-0cea-474c-a4eb-c225d250858d", + "definition": "", + "includeAll": true, + "label": "Instance", + "multi": true, + "name": "instance", + "options": [], + "query": "label_values(goldpinger_instance)", + "refresh": 1, + "regex": "", + "type": "query" + }, + { + "allValue": ".*", + "current": { + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": "24b0d575-0cea-474c-a4eb-c225d250858d", + "definition": "", + "includeAll": true, + "label": "Call Type", + "multi": true, + "name": "call_type", + "options": [], + "query": "label_values(call_type)", + "refresh": 1, + "regex": "", + "sort": 1, + "type": "query" + } + ] + }, + "time": { + "from": "now-15m", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Cluster: Goldpinger", + "uid": "8eYxJNhZk", + "version": 2, + "weekStart": "" + } diff --git a/hack/download-dashboards.sh b/hack/download-dashboards.sh index 61d2ad5d..ade7ca0b 100755 --- a/hack/download-dashboards.sh +++ b/hack/download-dashboards.sh @@ -81,6 +81,7 @@ modules/340-monitoring-kubernetes/monitoring/grafana-dashboards//main/capacity-p modules/340-monitoring-kubernetes/monitoring/grafana-dashboards//flux/flux-control-plane.json modules/340-monitoring-kubernetes/monitoring/grafana-dashboards//flux/flux-stats.json modules/340-monitoring-kubernetes/monitoring/grafana-dashboards//kafka/strimzi-kafka.json +modules/340-monitoring-kubernetes/monitoring/grafana-dashboards//goldpinger/goldpinger.json EOT diff --git a/packages/core/platform/bundles/paas-full.yaml b/packages/core/platform/bundles/paas-full.yaml index fdf0db75..13b4f0d6 100644 --- a/packages/core/platform/bundles/paas-full.yaml +++ b/packages/core/platform/bundles/paas-full.yaml @@ -364,3 +364,10 @@ releases: cozystack: configHash: {{ $cozyConfig | toJson | sha256sum }} {{- end }} + +- name: goldpinger + releaseName: goldpinger + chart: cozy-goldpinger + namespace: cozy-goldpinger + privileged: true + dependsOn: [monitoring-agents] diff --git a/packages/core/platform/bundles/paas-hosted.yaml b/packages/core/platform/bundles/paas-hosted.yaml index 4185fc16..6b54ff44 100644 --- a/packages/core/platform/bundles/paas-hosted.yaml +++ b/packages/core/platform/bundles/paas-hosted.yaml @@ -245,3 +245,10 @@ releases: cozystack: configHash: {{ $cozyConfig | toJson | sha256sum }} {{- end }} + +- name: goldpinger + releaseName: goldpinger + chart: cozy-goldpinger + namespace: cozy-goldpinger + privileged: true + dependsOn: [monitoring-agents] diff --git a/packages/extra/monitoring/dashboards.list b/packages/extra/monitoring/dashboards.list index 0de7bfd6..e84a8caa 100644 --- a/packages/extra/monitoring/dashboards.list +++ b/packages/extra/monitoring/dashboards.list @@ -35,3 +35,4 @@ kubevirt/kubevirt-control-plane flux/flux-control-plane flux/flux-stats kafka/strimzi-kafka +goldpinger/goldpinger diff --git a/packages/system/goldpinger/Chart.yaml b/packages/system/goldpinger/Chart.yaml new file mode 100644 index 00000000..db7c25e3 --- /dev/null +++ b/packages/system/goldpinger/Chart.yaml @@ -0,0 +1,3 @@ +apiVersion: v2 +name: cozy-goldpinger +version: 0.0.0 # Placeholder, the actual version will be automatically set during the build process diff --git a/packages/system/goldpinger/Makefile b/packages/system/goldpinger/Makefile new file mode 100644 index 00000000..3ddd79ba --- /dev/null +++ b/packages/system/goldpinger/Makefile @@ -0,0 +1,7 @@ +include ../../../scripts/package.mk + +update: + rm -rf charts + helm repo add goldpinger https://bloomberg.github.io/goldpinger + helm repo update goldpinger + helm pull goldpinger/goldpinger --untar --untardir charts diff --git a/packages/system/goldpinger/charts/goldpinger/.helmignore b/packages/system/goldpinger/charts/goldpinger/.helmignore new file mode 100644 index 00000000..825c0077 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj + +OWNERS diff --git a/packages/system/goldpinger/charts/goldpinger/Chart.yaml b/packages/system/goldpinger/charts/goldpinger/Chart.yaml new file mode 100644 index 00000000..932c0425 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/Chart.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +appVersion: 3.10.2 +description: Goldpinger is a tool to help debug, troubleshoot and visualize network + connectivity and slowness issues. +home: https://github.com/bloomberg/goldpinger +name: goldpinger +sources: +- https://github.com/bloomberg/goldpinger +version: 1.0.1 diff --git a/packages/system/goldpinger/charts/goldpinger/templates/_helpers.tpl b/packages/system/goldpinger/charts/goldpinger/templates/_helpers.tpl new file mode 100644 index 00000000..c9a0eb67 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/_helpers.tpl @@ -0,0 +1,62 @@ +{{/* +Expand the name of the chart. +*/}} +{{- define "goldpinger.name" -}} +{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "goldpinger.fullname" -}} +{{- if .Values.fullnameOverride }} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.nameOverride }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "goldpinger.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "goldpinger.labels" -}} +helm.sh/chart: {{ include "goldpinger.chart" . }} +{{ include "goldpinger.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "goldpinger.selectorLabels" -}} +app.kubernetes.io/name: {{ include "goldpinger.name" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Create the name of the service account to use +*/}} +{{- define "goldpinger.serviceAccountName" -}} +{{- if .Values.serviceAccount.create }} +{{- default (include "goldpinger.fullname" .) .Values.serviceAccount.name }} +{{- else }} +{{- default "default" .Values.serviceAccount.name }} +{{- end }} +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/clusterrole.yaml b/packages/system/goldpinger/charts/goldpinger/templates/clusterrole.yaml new file mode 100644 index 00000000..8404c648 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/clusterrole.yaml @@ -0,0 +1,12 @@ +{{- if and .Values.rbac.create .Values.rbac.clusterscoped }} +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ include "goldpinger.fullname" . }}-clusterrole + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: ["pods"] + verbs: ["list"] +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/clusterrolebinding.yaml b/packages/system/goldpinger/charts/goldpinger/templates/clusterrolebinding.yaml new file mode 100644 index 00000000..3ba52c35 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/clusterrolebinding.yaml @@ -0,0 +1,16 @@ +{{- if and .Values.rbac.create .Values.rbac.clusterscoped }} +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ include "goldpinger.fullname" . }}-clusterrolebinding + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +subjects: + - kind: ServiceAccount + name: {{ include "goldpinger.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: ClusterRole + name: {{ include "goldpinger.fullname" . }}-clusterrole + apiGroup: rbac.authorization.k8s.io +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/configmap.yaml b/packages/system/goldpinger/charts/goldpinger/templates/configmap.yaml new file mode 100644 index 00000000..a0a618b7 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/configmap.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "goldpinger.fullname" . }}-zap + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +data: + zap.json: {{ .Values.goldpinger.zapConfig | toJson }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/daemonset.yaml b/packages/system/goldpinger/charts/goldpinger/templates/daemonset.yaml new file mode 100644 index 00000000..54034a64 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/daemonset.yaml @@ -0,0 +1,103 @@ +apiVersion: apps/v1 +kind: DaemonSet +metadata: + name: {{ include "goldpinger.fullname" . }} + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +spec: + {{- with .Values.updateStrategy }} + updateStrategy: + {{- toYaml . | nindent 4 }} + {{- end }} + selector: + matchLabels: + {{- include "goldpinger.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{ toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "goldpinger.selectorLabels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{ toYaml . | nindent 8 }} + {{- end }} + spec: + priorityClassName: {{ .Values.priorityClassName }} + serviceAccountName: {{ include "goldpinger.serviceAccountName" . }} + {{- if .Values.image.pullSecrets }} + imagePullSecrets: + {{- range .Values.image.pullSecrets }} + - name: {{ . }} + {{- end }} + {{- end }} + containers: + - name: goldpinger-daemon + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + volumeMounts: + - name: zap + mountPath: /config + env: + - name: HOSTNAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + - name: HOST + value: "0.0.0.0" + - name: PORT + value: "{{ .Values.goldpinger.port }}" + - name: LABEL_SELECTOR + value: "app.kubernetes.io/name={{ include "goldpinger.name" . }}" + {{- if .Values.extraEnv -}} + {{ toYaml .Values.extraEnv | nindent 12 }} + {{- end }} + {{- with .Values.containerSecurityContext }} + securityContext: + {{- toYaml . | nindent 12 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.goldpinger.port }} + protocol: TCP + {{- range $k := .Values.extraEnv }} + {{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }} + hostPort: {{ $.Values.goldpinger.port }} + {{- end }} + {{- end }} + livenessProbe: + httpGet: + path: / + port: http + readinessProbe: + httpGet: + path: / + port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: zap + configMap: + name: {{ include "goldpinger.fullname" . }}-zap + {{- range $k := .Values.extraEnv }} + {{- if and (eq $k.name "USE_HOST_IP") (eq $k.value "true") }} + hostNetwork: true + {{- end }} + {{- end }} + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.podSecurityContext }} + securityContext: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/ingress.yaml b/packages/system/goldpinger/charts/goldpinger/templates/ingress.yaml new file mode 100644 index 00000000..899b2c5f --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/ingress.yaml @@ -0,0 +1,61 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "goldpinger.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} + {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} + {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} + {{- end }} +{{- end }} +{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1 +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "goldpinger.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ .path }} + {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} + pathType: {{ .pathType }} + {{- end }} + backend: + {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} + service: + name: {{ $fullName }} + port: + number: {{ $svcPort }} + {{- else }} + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/prometheusrule.yaml b/packages/system/goldpinger/charts/goldpinger/templates/prometheusrule.yaml new file mode 100644 index 00000000..54a840f5 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/prometheusrule.yaml @@ -0,0 +1,19 @@ +{{- if .Values.prometheusRule.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ template "goldpinger.fullname" . }} + {{- if .Values.prometheusRule.namespace }} + namespace: {{ .Values.prometheusRule.namespace }} + {{- else }} + namespace: {{ .Release.Namespace | quote }} + {{- end }} + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +spec: + {{- with .Values.prometheusRule.rules }} + groups: + - name: {{ template "goldpinger.name" $ }} + rules: {{- tpl (toYaml .) $ | nindent 8 }} + {{- end }} +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/role.yaml b/packages/system/goldpinger/charts/goldpinger/templates/role.yaml new file mode 100644 index 00000000..0b85f3f1 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/role.yaml @@ -0,0 +1,20 @@ +{{- if or .Values.podSecurityPolicy.enabled (not .Values.rbac.clusterscoped) }} +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ include "goldpinger.fullname" . }}-pod-security-policy + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +rules: +{{- if not .Values.rbac.clusterscoped }} + - apiGroups: [""] + resources: ["pods"] + verbs: ["list"] +{{- end }} +{{- if .Values.podSecurityPolicy.enabled }} + - apiGroups: ["extensions"] + resources: ["podsecuritypolicies"] + resourceNames: [{{ .Values.podSecurityPolicy.policyName | quote }}] + verbs: ["use"] +{{- end }} +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/rolebinding.yaml b/packages/system/goldpinger/charts/goldpinger/templates/rolebinding.yaml new file mode 100644 index 00000000..34c0bc44 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/rolebinding.yaml @@ -0,0 +1,16 @@ +{{- if or .Values.podSecurityPolicy.enabled (not .Values.rbac.clusterscoped) }} +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ include "goldpinger.fullname" . }}-pod-security-policy + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +roleRef: + kind: Role + name: {{ include "goldpinger.fullname" . }}-pod-security-policy + apiGroup: rbac.authorization.k8s.io +subjects: + - kind: ServiceAccount + name: {{ include "goldpinger.serviceAccountName" . }} + namespace: {{ .Release.Namespace }} +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/service.yaml b/packages/system/goldpinger/charts/goldpinger/templates/service.yaml new file mode 100644 index 00000000..43a3e85d --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/service.yaml @@ -0,0 +1,26 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "goldpinger.fullname" . }} + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +{{- with .Values.service.labels }} +{{ toYaml . | indent 4 }} +{{- end }} +{{- with .Values.service.annotations }} + annotations: +{{ toYaml . | indent 4 }} +{{- end }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: {{ .Values.goldpinger.port }} + protocol: TCP + name: http + selector: + {{- include "goldpinger.selectorLabels" . | nindent 4 }} + {{- if .Values.service.loadBalancerSourceRanges }} + loadBalancerSourceRanges: + {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }} + {{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/serviceaccount.yaml b/packages/system/goldpinger/charts/goldpinger/templates/serviceaccount.yaml new file mode 100644 index 00000000..55564331 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/serviceaccount.yaml @@ -0,0 +1,8 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ include "goldpinger.serviceAccountName" . }} + labels: + {{- include "goldpinger.labels" . | nindent 4 }} +{{- end }} diff --git a/packages/system/goldpinger/charts/goldpinger/templates/servicemonitor.yaml b/packages/system/goldpinger/charts/goldpinger/templates/servicemonitor.yaml new file mode 100644 index 00000000..6e2463ec --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/templates/servicemonitor.yaml @@ -0,0 +1,32 @@ +{{- if .Values.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "goldpinger.fullname" . }} + {{- if .Values.serviceMonitor.namespace }} + namespace: {{ .Values.serviceMonitor.namespace }} + {{- end }} + labels: + {{- include "goldpinger.labels" . | nindent 4 }} + {{- range $key, $value := .Values.serviceMonitor.selector }} + {{ $key }}: {{ $value | quote }} + {{- end }} +spec: + endpoints: + - port: http + interval: {{ .Values.serviceMonitor.interval }} + {{- if .Values.serviceMonitor.honorLabels }} + honorLabels: true + {{- end }} + {{- with .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: + {{- toYaml . | nindent 8 }} + {{- end }} + jobLabel: name + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} + selector: + matchLabels: + {{- include "goldpinger.selectorLabels" . | nindent 6 }} +{{- end -}} diff --git a/packages/system/goldpinger/charts/goldpinger/values.yaml b/packages/system/goldpinger/charts/goldpinger/values.yaml new file mode 100644 index 00000000..1c80a1b1 --- /dev/null +++ b/packages/system/goldpinger/charts/goldpinger/values.yaml @@ -0,0 +1,166 @@ +# Default values for goldpinger. +# This is a YAML-formatted file. +# Declare variables to be passed into your templates. +image: + repository: bloomberg/goldpinger + # Overrides the image tag whose default is the chart appVersion. + tag: "" + pullPolicy: IfNotPresent + ## Optionally specify an array of imagePullSecrets. + ## Secrets must be manually created in the namespace. + ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ + ## + # pullSecrets: + # - myRegistryKeySecretName + +rbac: + create: true + clusterscoped: true + +serviceAccount: + create: true + name: + +goldpinger: + port: 8080 + zapConfig: | + { + "level": "info", + "encoding": "json", + "outputPaths": [ + "stdout" + ], + "errorOutputPaths": [ + "stderr" + ], + "initialFields": { + }, + "encoderConfig": { + "messageKey": "message", + "levelKey": "level", + "levelEncoder": "lowercase", + "timeKey": "ts", + "timeEncoder": "ISO8601", + "callerKey": "caller", + "callerEncoder": "Short" + } + } + +extraEnv: [] + +service: + type: ClusterIP + port: 8081 + annotations: {} + labels: {} + loadBalancerSourceRanges: {} + +ingress: + enabled: false + className: "" + annotations: {} + # kubernetes.io/ingress.class: nginx + # kubernetes.io/tls-acme: "true" + hosts: + - host: chart-example.local + paths: + - path: / + pathType: ImplementationSpecific + tls: [] + # - secretName: chart-example-tls + # hosts: + # - chart-example.local + +## Set a priorityClassName for the pod. If left blank a default priority will be set. +priorityClassName: + +resources: {} + # We usually recommend not to specify default resources and to leave this as a conscious + # choice for the user. This also increases chances charts run on environments with little + # resources, such as Minikube. If you do want to specify resources, uncomment the following + # lines, adjust them as necessary, and remove the curly braces after 'resources:'. + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + +podAnnotations: {} + +podLabels: {} + +updateStrategy: {} + # type: RollingUpdate + # rollingUpdate: + # maxUnavailable: 1 + +## Node labels for pod assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + +## Tolerations for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ +## +tolerations: [] + +## Affinity for pod assignment +## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity +## +affinity: {} + +## Enable this if pod security policy enabled in your cluster +## It will bind ServiceAccount with unrestricted podSecurityPolicy +## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/ +podSecurityPolicy: + enabled: false + policyName: unrestricted-psp + +## Set security context of the goldpinger container +## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +containerSecurityContext: + capabilities: + drop: + - ALL + allowPrivilegeEscalation: false + readOnlyRootFilesystem: true + runAsNonRoot: true + +## Set security context of the pod +## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ +podSecurityContext: + runAsNonRoot: true + runAsUser: 1000 + fsGroup: 2000 + seccompProfile: + type: RuntimeDefault + +serviceMonitor: + enabled: false + selector: + prometheus: "kube-prometheus" + # namespace: monitoring + interval: 30s + # honorLabels: true + metricRelabelings: [] + # - action: drop + # source_labels: [__name__] + # regex: goldpinger_peers_response_time_s_bucket + +## Custom PrometheusRule to be defined +## ref: https://github.com/coreos/prometheus-operator#customresourcedefinitions +prometheusRule: + enabled: false + rules: + - alert: goldpinger_nodes_unhealthy + expr: | + sum(goldpinger_nodes_health_total{job="{{ template "goldpinger.fullname" . }}", status="unhealthy"}) + BY (instance, goldpinger_instance) > 0 + for: 5m + annotations: + description: | + Goldpinger instance {{ "{{ $labels.goldpinger_instance }}" }} has been reporting unhealthy nodes for at least 5 minutes. + summary: Instance {{ "{{ $labels.instance }}" }} down + labels: + severity: warning diff --git a/packages/system/goldpinger/values.yaml b/packages/system/goldpinger/values.yaml new file mode 100644 index 00000000..fb535206 --- /dev/null +++ b/packages/system/goldpinger/values.yaml @@ -0,0 +1,5 @@ +goldpinger: + serviceMonitor: + enabled: true + prometheusRule: + enabled: true