diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 18e222c7..a39d7dcc 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 6.6.10 +version: 6.7.0 # renovate: image=docker.io/library/nextcloud appVersion: 30.0.10 description: A file sharing server that puts the control and security of your own data back into your hands. diff --git a/charts/nextcloud/templates/metrics/deployment.yaml b/charts/nextcloud/templates/metrics/deployment.yaml index 7b114a87..d2cde3c0 100644 --- a/charts/nextcloud/templates/metrics/deployment.yaml +++ b/charts/nextcloud/templates/metrics/deployment.yaml @@ -64,6 +64,8 @@ spec: value: {{ .Values.metrics.tlsSkipVerify | quote }} - name: NEXTCLOUD_INFO_APPS value: {{ .Values.metrics.info.apps | quote }} + - name: NEXTCLOUD_INFO_UPDATE + value: {{ .Values.metrics.info.update | quote }} ports: - name: metrics containerPort: 9205 diff --git a/charts/nextcloud/templates/metrics/prometheus-rules.yaml b/charts/nextcloud/templates/metrics/prometheus-rules.yaml new file mode 100644 index 00000000..5f4c040e --- /dev/null +++ b/charts/nextcloud/templates/metrics/prometheus-rules.yaml @@ -0,0 +1,61 @@ +{{- if .Values.metrics.rules.enabled }} +{{- $fullname := include "nextcloud.fullname" . }} +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: {{ $fullname }} + labels: + {{- include "nextcloud.labels" ( dict "rootContext" $ ) | nindent 4 }} + {{- with .Values.metrics.rules.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + groups: + {{- with .Values.metrics.rules.defaults }} + {{- if .enabled }} + {{- $filter := .filter | default (printf `namespace="%s",job="%s"` $.Release.Namespace $fullname) }} + - name: {{ $fullname }}-Defaults + rules: + - alert: "nextcloud: not reachable" + expr: 'avg(nextcloud_up{ {{ $filter }} }) without(endpoint,container,pod,instance) < 1' + for: 5m + labels: + severity: "critical" + {{- with .labels }} + {{- toYaml . | nindent 12 }} + {{- end }} + annotations: + {{` + summary: "Nextcloud in {{ $labels.namespace }} is not reachable by exporter" + `}} + - alert: "nextcloud: outdated version" + expr: 'sum(nextcloud_system_update_available{ {{ $filter }} }) without(endpoint,container,pod,instance) > 0' + labels: + severity: "warning" + {{- with .labels }} + {{- toYaml . | nindent 12 }} + {{- end }} + annotations: + {{` + summary: "Nextcloud in {{ $labels.namespace }} is outdated" + `}} + - alert: "nextcloud: outdated apps" + expr: 'sum(nextcloud_apps_updates_available_total{ {{ $filter }} }) without(endpoint,container,pod,instance) > 0' + labels: + severity: "warning" + {{- with .labels }} + {{- toYaml . | nindent 12 }} + {{- end }} + annotations: + {{` + summary: "Nextcloud in {{ $labels.namespace }} has {{ $value }} outdated Apps" + `}} + {{- end }} + {{- end }}{{/* end-with prometheus.rules.default */}} + {{- with .Values.metrics.rules.additionalRules }} + - name: {{ $fullname }}-Additional + rules: + {{- toYaml . | nindent 8 }} + {{- end }} +{{- end }} + diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index e8e374aa..3910d207 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -778,10 +778,11 @@ metrics: # Optional: becomes NEXTCLOUD_INFO_APPS env var in the nextcloud-exporter container. # Enables gathering of apps-related metrics. Defaults to false apps: false + update: false image: repository: xperimental/nextcloud-exporter - tag: 0.6.2 + tag: 0.8.0 pullPolicy: IfNotPresent # pullSecrets: # - myRegistrKeySecretName @@ -863,6 +864,27 @@ metrics: ## labels: {} + rules: + # -- Deploy Prometheus Rules (Alerts) for the exporter + # @section -- Metrics + enabled: false + # -- Label on Prometheus Rules CRD Manifest + # @section -- Metrics + labels: {} + defaults: + # -- Add Default Rules + # @section -- Metrics + enabled: true + # -- Label on the rules (the severity is already set) + # @section -- Metrics + labels: {} + # -- Filter on metrics on alerts (default just for this helm-chart) + # @section -- Metrics + filter: "" + # -- Add own Rules to Prometheus Rules + # @section -- Metrics + additionalRules: [] + rbac: enabled: false