diff --git a/autopush/Chart.yaml b/autopush/Chart.yaml index 4f826d7..23c3d26 100644 --- a/autopush/Chart.yaml +++ b/autopush/Chart.yaml @@ -3,7 +3,7 @@ name: autopush description: A Helm chart for Kubernetes icon: type: application -version: 0.0.5 +version: 0.0.6 # renovate: image=docker.io/mozilla-services/autopush-rs appVersion: "1.72.2" maintainers: diff --git a/autopush/README.md b/autopush/README.md index fcf6fc7..a92269b 100644 --- a/autopush/README.md +++ b/autopush/README.md @@ -7,7 +7,7 @@ description: "A Helm chart for Kubernetes" # autopush -![Version: 0.0.5](https://img.shields.io/badge/Version-0.0.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.72.2](https://img.shields.io/badge/AppVersion-1.72.2-informational?style=flat-square) +![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.72.2](https://img.shields.io/badge/AppVersion-1.72.2-informational?style=flat-square) A Helm chart for Kubernetes @@ -70,7 +70,7 @@ helm uninstall autopush-release | autoconnect.image.tag | string | `"latest"` | | | autoconnect.livenessProbe | object | `{"httpGet":{"path":"/health","port":"http"}}` | This is to setup the liveness and readiness probes more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ | | autoconnect.nodeSelector | object | `{}` | | -| autoconnect.podAnnotations | object | `{}` | This is for setting Kubernetes Annotations to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ | +| autoconnect.podAnnotations | object | `{}` | This is for setting Kubernetes Annotations to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ | | autoconnect.podLabels | object | `{}` | This is for setting Kubernetes Labels to a Pod. For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ | | autoconnect.podSecurityContext | object | `{}` | | | autoconnect.readinessProbe.httpGet.path | string | `"/health"` | | @@ -107,6 +107,9 @@ helm uninstall autopush-release | fullnameOverride | string | `""` | | | global.image.pullPolicy | string | `nil` | if set it will overwrite all pullPolicy | | global.image.registry | string | `nil` | if set it will overwrite all registry entries | +| grafana.dashboards.annotations | object | `{}` | | +| grafana.dashboards.enabled | bool | `false` | | +| grafana.dashboards.labels.grafana_dashboard | string | `"1"` | | | imagePullSecrets | list | `[]` | This is for the secretes for pulling an image from a private repository more information can be found here: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ | | ingress.annotations | object | `{}` | | | ingress.className | string | `""` | | diff --git a/autopush/grafana_dashboards/overview.json b/autopush/grafana_dashboards/overview.json new file mode 100644 index 0000000..f0c0390 --- /dev/null +++ b/autopush/grafana_dashboards/overview.json @@ -0,0 +1,355 @@ +{ + "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": 4, + "panels": [], + "title": "Push", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 9, + "x": 0, + "y": 1 + }, + "id": 1, + "options": { + "legend": { + "displayMode": "list", + "placement": "bottom", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum(increase(autopush_notification_message_retrieved{namespace=~\"$namespace\"}[$__range])) without (container,endpoint,instance,pod,job,service)", + "legendFormat": "Retrieved: {{namespace}}", + "range": true, + "refId": "A" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum(increase(autopush_notification_message_deleted{namespace=~\"$namespace\"}[$__range])) without (container,endpoint,instance,pod,job,service)", + "hide": false, + "instant": false, + "legendFormat": "Deleted: {{namespace}}", + "range": true, + "refId": "B" + } + ], + "title": "Notification Message", + "transparent": true, + "type": "piechart" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + } + }, + "mappings": [] + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 8, + "x": 10, + "y": 1 + }, + "id": 2, + "options": { + "legend": { + "displayMode": "list", + "placement": "right", + "showLegend": true, + "values": [ + "percent" + ] + }, + "pieType": "pie", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum(increase(autopush_ua_notification_sent{namespace=~\"$namespace\"}[$__range])) without (container,endpoint,instance,pod,job,service)", + "hide": false, + "instant": false, + "legendFormat": "OS: {{namespace}}/{{os}}", + "range": true, + "refId": "A" + } + ], + "title": "UA Notify Send", + "transparent": true, + "type": "piechart" + }, + { + "collapsed": false, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 5, + "panels": [], + "title": "Endpoint", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "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", + "spanNulls": false, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 10 + }, + "id": 3, + "options": { + "legend": { + "calcs": [], + "displayMode": "list", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "single", + "sort": "none" + } + }, + "pluginVersion": "11.4.0", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "expr": "sum(increase(autoendpoint_api_error_no_subscription{namespace=~\"$namespace\"}[$__range])) without(container,endpoint,instance,pod,service,job)", + "legendFormat": "__auto", + "range": true, + "refId": "A" + } + ], + "title": "No Subscription API Error", + "transparent": true, + "type": "timeseries" + } + ], + "preload": false, + "refresh": "", + "schemaVersion": 40, + "tags": [], + "templating": { + "list": [ + { + "current": { + "text": "Prometheus", + "value": "prometheus" + }, + "label": "datasource", + "name": "DS_PROMETHEUS", + "options": [], + "query": "prometheus", + "refresh": 1, + "regex": "", + "type": "datasource" + }, + { + "current": { + "text": [ + "chaos-autopush" + ], + "value": [ + "chaos-autopush" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "definition": "label_values(statsd_exporter_build_info,namespace)", + "includeAll": true, + "multi": true, + "name": "namespace", + "options": [], + "query": { + "qryType": 1, + "query": "label_values(statsd_exporter_build_info,namespace)", + "refId": "PrometheusVariableQueryEditor-VariableQuery" + }, + "refresh": 1, + "regex": "", + "type": "query" + } + ] + }, + "time": { + "from": "now-24h", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "Autopush: Overview", + "version": 0, + "weekStart": "" +} diff --git a/autopush/templates/configmap_grafana_dashboards.yaml b/autopush/templates/configmap_grafana_dashboards.yaml new file mode 100644 index 0000000..0b8850c --- /dev/null +++ b/autopush/templates/configmap_grafana_dashboards.yaml @@ -0,0 +1,14 @@ +{{- if .Values.grafana.dashboards.enabled }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "autopush.fullname" . }}-grafana-dashboards + labels: + {{- include "autopush.labels" . | nindent 4 }} + {{- toYaml .Values.grafana.dashboards.labels | nindent 4 }} + annotations: + {{- toYaml .Values.grafana.dashboards.annotations | nindent 4 }} +data: + {{- (.Files.Glob "grafana_dashboards/*.json" ).AsConfig | nindent 2 }} +{{- end }} diff --git a/autopush/values.yaml b/autopush/values.yaml index 7ce041f..11e251a 100644 --- a/autopush/values.yaml +++ b/autopush/values.yaml @@ -12,8 +12,6 @@ nameOverride: "" fullnameOverride: "" - - config: logs: # -- set log level of autopush @@ -81,6 +79,13 @@ prometheus: # readOnly: true volumeMounts: [] +grafana: + dashboards: + enabled: false + labels: + grafana_dashboard: "1" + annotations: {} + ## This configuration is for the internal Redis that's deployed for use with ## workers/sharding, for an external Redis server you want to set enabled to ## false and configure the externalRedis block. @@ -96,7 +101,7 @@ redis: password: autopush # -- Or use existing secret with "redis-password" key instead of static password - existingSecret: + existingSecret: external: host: redis port: 6379 @@ -114,7 +119,6 @@ redis: port: 6379 - autoconnect: # -- This will set the replicaset count more information can be found here: https://kubernetes.io/docs/concepts/workloads/controllers/replicaset/ replicaCount: 1 @@ -124,7 +128,7 @@ autoconnect: pullPolicy: IfNotPresent tag: latest # -- This is for setting Kubernetes Annotations to a Pod. - # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ podAnnotations: {} # -- This is for setting Kubernetes Labels to a Pod. # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -193,7 +197,7 @@ autoendpoint: tag: latest # This is for setting Kubernetes Annotations to a Pod. - # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ + # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ podAnnotations: {} # This is for setting Kubernetes Labels to a Pod. # For more information checkout: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ @@ -252,7 +256,7 @@ autoendpoint: volumeMounts: [] -#This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ +# This section builds out the service account more information can be found here: https://kubernetes.io/docs/concepts/security/service-accounts/ serviceAccount: # Specifies whether a service account should be created create: true