diff --git a/autopush/Chart.yaml b/autopush/Chart.yaml index a57c4f9..4f826d7 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.4 +version: 0.0.5 # renovate: image=docker.io/mozilla-services/autopush-rs appVersion: "1.72.2" maintainers: diff --git a/autopush/README.md b/autopush/README.md index 997d018..fcf6fc7 100644 --- a/autopush/README.md +++ b/autopush/README.md @@ -7,7 +7,7 @@ description: "A Helm chart for Kubernetes" # autopush -![Version: 0.0.4](https://img.shields.io/badge/Version-0.0.4-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.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) A Helm chart for Kubernetes @@ -123,6 +123,11 @@ helm uninstall autopush-release | prometheus.readinessProbe.httpGet.path | string | `"/"` | | | prometheus.readinessProbe.httpGet.port | string | `"metrics"` | | | prometheus.resources | object | `{}` | 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 | +| prometheus.rules.additionalRules | list | `[]` | | +| prometheus.rules.default.alertLabels | object | `{}` | | +| prometheus.rules.default.enabled | bool | `true` | | +| prometheus.rules.enabled | bool | `false` | | +| prometheus.rules.labels | object | `{}` | | | prometheus.securityContext | object | `{}` | securityContext capabilities: drop: - ALL readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 | | prometheus.servicemonitor.enabled | bool | `false` | | | prometheus.servicemonitor.labels | object | `{}` | | diff --git a/autopush/templates/prometheus-rules.yaml b/autopush/templates/prometheus-rules.yaml new file mode 100644 index 0000000..c7d1b34 --- /dev/null +++ b/autopush/templates/prometheus-rules.yaml @@ -0,0 +1,38 @@ +{{- if and .Values.prometheus.rules.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ include "autopush.fullname" . }} + labels: + {{- include "autopush.labels" . | nindent 4 }} + {{- with .Values.prometheus.rules.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + groups: + {{- if .Values.prometheus.rules.default.enabled }} + - name: {{ template "autopush.fullname" . }}-Endpoint + rules: + - alert: "autopush: No Subscription API Error" + expr: 'sum(increase(autoendpoint_api_error_no_subscription{}[1h])) without (container,endpoint,pod,instance) > 0' + for: 5m + labels: + severity: critical + {{- with .Values.prometheus.rules.default.alertLabels }} + {{- toYaml . | nindent 12 }} + {{- end }} + annotations: + {{` + summary: "autoendpoint: No Subscription API Error in {{ $labels.namespace }}/{{ $labels.job }} increate in the last hour" + `}} + {{/* + - name: {{ template "autopush.fullname" . }}-Push + rules: + */}} + {{- end }} + {{- with .Values.prometheus.rules.additionalRules }} + - name: {{ template "autopush.fullname" $ }}-Additional + rules: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} diff --git a/autopush/values.yaml b/autopush/values.yaml index ac0fabc..7ce041f 100644 --- a/autopush/values.yaml +++ b/autopush/values.yaml @@ -30,6 +30,13 @@ prometheus: servicemonitor: enabled: false labels: {} + rules: + enabled: false + labels: {} + default: + enabled: true + alertLabels: {} + additionalRules: [] image: registry: docker.io