Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/nextcloud/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ This Helm-Chart increase there major version on every breaking change (or major

Here we list all major versions and their breaking changes for migration.

## v9
- upgrade to v33 major version
- move `metrics.serviceMonitor` to `prometheus.serviceMonitor`: It us used for nextcloud-exporter and notify-push
- move `metrics.rules` to `prometheus.rules`: It us used for nextcloud-exporter and notify-push

## v8
- `cronjob.command` was renamed to `cronjob.sidecar.command` to avoid confusion with the cronjob command. Please update your `values.yaml` accordingly.

Expand Down
4 changes: 2 additions & 2 deletions charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apiVersion: v2
name: nextcloud
version: 8.9.1
version: 9.0.0
# renovate: image=docker.io/library/nextcloud
appVersion: 32.0.6
appVersion: 33.0.0
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
- nextcloud
Expand Down
6 changes: 6 additions & 0 deletions charts/nextcloud/files/defaultConfigs/helm-metrics.php.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

$openmetricsAllowedClients = getenv('OPENMETRICS_ALLOWED_CLIENTS');
if ($openmetricsAllowedClients) {
$CONFIG['openmetrics_allowed_clients'] = array_filter(array_map('trim', explode(',', $openmetricsAllowedClients)));
}
4 changes: 4 additions & 0 deletions charts/nextcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ Create environment variables used to configure the nextcloud container as well a
{{- else }}
value: {{ .Values.nextcloud.host }}{{ if .Values.metrics.enabled }} {{ template "nextcloud.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local{{ end }}
{{- end }}
{{- with .Values.nextcloud.openmetrics.allowedClients }}
- name: OPENMETRICS_ALLOWED_CLIENTS
value: {{ join "," . | quote }}
{{- end }}
{{- if ne (int .Values.nextcloud.update) 0 }}
- name: NEXTCLOUD_UPDATE
value: {{ .Values.nextcloud.update | quote }}
Expand Down
23 changes: 13 additions & 10 deletions charts/nextcloud/templates/metrics/service.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
{{- if .Values.metrics.enabled }}
{{- with .Values.metrics.service }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ template "nextcloud.fullname" . }}-metrics
name: {{ template "nextcloud.fullname" $ }}-metrics
labels:
{{- include "nextcloud.labels" ( dict "component" "metrics" "rootContext" $ ) | nindent 4 }}
{{- with .Values.metrics.service.labels }}
app.kubernetes.io/monitor: enabled
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.metrics.service.annotations }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
type: {{ .Values.metrics.service.type }}
{{- if eq .Values.metrics.service.type "LoadBalancer" }}
{{- with .Values.metrics.service.loadBalancerIP }}
type: {{ .type }}
{{- if eq .type "LoadBalancer" }}
{{- with .loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- end }}
ports:
- name: metrics
port: 9205
targetPort: metrics
selector:
{{- include "nextcloud.selectorLabels" ( dict "component" "metrics" "rootContext" $ ) | nindent 4 }}
ports:
- name: http
port: 9100
targetPort: metrics
{{- end }}
{{- end }}
34 changes: 0 additions & 34 deletions charts/nextcloud/templates/metrics/servicemonitor.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{{- if .Values.metrics.rules.enabled }}
{{- if .Values.prometheus.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 }}
{{- with .Values.prometheus.rules.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
groups:
{{- with .Values.metrics.rules.defaults }}
{{- with .Values.prometheus.rules.defaults }}
{{- if .enabled }}
{{- $filter := .filter | default (printf `namespace="%s",job=~"^%s.*"` $.Release.Namespace $fullname) }}
- name: {{ $fullname }}-Defaults
Expand Down Expand Up @@ -52,7 +52,7 @@ spec:
`}}
{{- end }}
{{- end }}{{/* end-with prometheus.rules.default */}}
{{- with .Values.metrics.rules.additionalRules }}
{{- with .Values.prometheus.rules.additionalRules }}
- name: {{ $fullname }}-Additional
rules:
{{- toYaml . | nindent 8 }}
Expand Down
9 changes: 4 additions & 5 deletions charts/nextcloud/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ metadata:
{{- end }}
labels:
{{- include "nextcloud.labels" ( dict "component" "app" "rootContext" $ ) | nindent 4 }}
app.kubernetes.io/monitor: enabled
spec:
type: {{ .Values.service.type }}
{{- if (eq .Values.service.type "LoadBalancer") }}
Expand All @@ -31,14 +32,12 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
ports:
- port: {{ .Values.service.port }}
- name: http
port: {{ .Values.service.port }}
targetPort: {{ .Values.nextcloud.containerPort }}
protocol: TCP
name: http
{{- with .Values.service.nodePort }}
nodePort: {{ . }}
{{- end }}
selector:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: app
{{- include "nextcloud.selectorLabels" ( dict "component" "app" "rootContext" $ ) | nindent 4 }}
37 changes: 37 additions & 0 deletions charts/nextcloud/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- with .Values.prometheus.serviceMonitor }}
{{- if .enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "nextcloud.fullname" $ }}
namespace: {{ .namespace | default $.Release.Namespace | quote }}
labels:
{{- include "nextcloud.labels" ( dict "rootContext" $ ) | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
jobLabel: {{ .jobLabel | quote }}
selector:
matchLabels:
{{- include "nextcloud.selectorLabels" ( dict "rootContext" $ ) | nindent 6 }}
app.kubernetes.io/monitor: enabled
namespaceSelector:
{{- with .namespaceSelector }}
{{- toYaml . | nindent 4 }}
{{- else }}
matchNames:
- {{ $.Release.Namespace | quote }}
{{- end }}
endpoints:
- port: http
path: "/metrics"
{{- with .interval }}
interval: {{ . }}
{{- end }}
{{- with .scrapeTimeout }}
scrapeTimeout: {{ . }}
{{- end }}
{{- end }}
{{- end }}
10 changes: 9 additions & 1 deletion charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ nextcloud:
container: ""
# autocreate container
autoCreate: false
openmetrics:
allowedClients:
- "127.0.0.1"
- "10.42.0.0/16"
- "10.43.0.0/16"

## PHP Configuration files
# Will be injected in /usr/local/etc/php/conf.d for apache image and in /usr/local/etc/php-fpm.d when nginx.enabled: true
Expand Down Expand Up @@ -256,6 +261,8 @@ nextcloud:
swift.config.php: true
# disables the web based updater as the default nextcloud docker image does not support it
upgrade-disable-web.config.php: true
# -- adjust openmetrics
helm-metrics.php: true
# -- imaginary support config
imaginary.config.php: false

Expand Down Expand Up @@ -1017,8 +1024,9 @@ metrics:
# seccompProfile:
# type: RuntimeDefault

prometheus:
## Prometheus Operator ServiceMonitor configuration
##
## collects data from nextcloud openmetrics and nextcloud-exporter if enabled
serviceMonitor:
## @param metrics.serviceMonitor.enabled Create ServiceMonitor Resource for scraping metrics using PrometheusOperator
##
Expand Down
Loading