From 57b38069d658bd8ae61168db5876eb158cc43f72 Mon Sep 17 00:00:00 2001 From: WrenIX <133280015+wrenix@users.noreply.github.com> Date: Fri, 3 Jan 2025 18:18:14 +0100 Subject: [PATCH] fix(notify_push): improve after review Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> --- charts/nextcloud/CHANGELOG.md | 6 +-- charts/nextcloud/README.md | 33 +++++++++++++++ charts/nextcloud/files/notify_push.sh.tpl | 4 +- charts/nextcloud/values.yaml | 51 ++++++++++++++++++++--- 4 files changed, 83 insertions(+), 11 deletions(-) diff --git a/charts/nextcloud/CHANGELOG.md b/charts/nextcloud/CHANGELOG.md index 0ce7fb8e..d241c30a 100644 --- a/charts/nextcloud/CHANGELOG.md +++ b/charts/nextcloud/CHANGELOG.md @@ -1,10 +1,10 @@ # Changelog -This Helm-Chart use semantic-releases, so only major version contains breaking changes. +This Helm-Chart increase there major version on every breaking change (or major version of Nextcloud itself) inspired by semantic releases. -Here we list, what is changed. +Here we list all major versions and their breaking changes for migration. ## v7 -- move `metrics.serviceMonitor` to `prometheus.serviceMonitor`: It us used for nextcloud-exporter and notify-push +- move `metrics.serviceMonitor` to `prometheus.serviceMonitor`: It is used for nextcloud-exporter and notify-push diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 6031ea4c..85191e0d 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -28,6 +28,7 @@ helm install my-release nextcloud/nextcloud * [Headers set on NGINX](#headers-set-on-nginx) * [Probes Configurations](#probes-configurations) * [Collabora Configuration](#collabora-configuration) + * [Notify Push](#notify-push) * [Imaginary](#imaginary) * [Cron jobs](#cron-jobs) * [Using the nextcloud docker image auto-configuration via env vars](#using-the-nextcloud-docker-image-auto-configuration-via-env-vars) @@ -500,6 +501,38 @@ The nextcloud deployment includes a series of different probes you can use to de > [!Note] > If you are getting errors on initialization (such as `Fatal error: require_once(): Failed opening required '/var/www/html/lib/versioncheck.php'`, but you can get other errors as well), a good first step is to try and enable the startupProbe and/or increase the `initialDelaySeconds` for the `livenessProbe` and `readinessProbe` to something much greater (consider using `120` seconds instead of `10`. This is an especially good idea if your cluster is running on older hardware, has a slow internet connection, or you're using a slower storage class, such as NFS that's running with older disks or a slow connection. +### Notify Push + +We include an optional Client Push [nextcloud/notify_push](https://github.com/nextcloud/notify_push). + + +| Parameter | Description | Default | +|----------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------|------------------------| +| `notifyPush.enabled` | Enable another deployment to handle notify_push (sometimes called ClientPush) | `false` | +| `notifyPush.autoSetup` | Setup notify_push on nextcloud per docker-entrypoint-hooks before start | `false` | +| `notifyPush.replicaCount` | Number of notify-push pod replicas to deploy | `1` | +| `notifyPush.image.registry` | notify-push image registry | `docker.io` | +| `notifyPush.image.repository` | notify-push image name | `miles170/notify_push` | +| `notifyPush.image.tag` | notify-push image tag | `v0.7.0` | +| `notifyPush.image.pullPolicy` | notify-push image pull policy | `IfNotPresent` | +| `notifyPush.image.pullSecrets` | notify-push image pull secrets | `[]` | +| `notifyPush.redisURLEnv` | option to set the redis_url per env (if a external redis is used) e.g.: `value: ""` or `valueFrom: {secretKeyRef:{name:"",key:""}}` | `""` | +| `notifyPush.podAnnotations` | Additional annotations for notify-push pods | `{}` | +| `notifyPush.podLabels` | Additional labels for notify-push pods | `{}` | +| `notifyPush.podSecurityContext` | Optional security context for the notify-push pod | `nil` | +| `notifyPush.securityContext` | Optional security context for the notify-push container | `nil` | +| `notifyPush.resources` | notify-push resources | `{}` | +| `notifyPush.service.type` | notify-push: Kubernetes Service type | `ClusterIP` | +| `notifyPush.service.loadBalancerIP` | Use serviceLoadBalancerIP to request a specific static IP, otherwise leave blank | `nil` | +| `notifyPush.service.nodePort` | notify-push: NodePort for service type NodePort | `nil` | +| `notifyPush.service.annotations` | Additional annotations for service notify-push | `{}` | +| `notifyPush.service.labels` | Additional labels for service notify-push | `{}` | +| `notifyPush.ingress.path` | Add path in default ingress to notify_push service | `/push` | +| `notifyPush.ingress.pathType` | PathType for additional path in default ingress for notify-push path | `Prefix` | + +> [!Note] +> notify-push needs an redis (redis.enabled=true or notifyPush.redisURLEnv={...}) + ### Collabora Configuration This section provides options to enable and configure the Collabora Online server within your deployment. Please ensure to review the [Collabora Online Helm chart documentation](https://github.com/CollaboraOnline/online/tree/master/kubernetes/helm/collabora-online) for additional details and recommended values. diff --git a/charts/nextcloud/files/notify_push.sh.tpl b/charts/nextcloud/files/notify_push.sh.tpl index 9d6675d9..7835d0ef 100644 --- a/charts/nextcloud/files/notify_push.sh.tpl +++ b/charts/nextcloud/files/notify_push.sh.tpl @@ -1,4 +1,4 @@ #!/bin/sh /var/www/html/occ app:install notify_push -/var/www/html/occ config:app:set notify_push base_endpoint --value="https://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" -# /var/www/html/occ notify_push:setup "https://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" +/var/www/html/occ config:app:set notify_push base_endpoint --value="http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" +# /var/www/html/occ notify_push:setup "http{{ if .Values.ingress.tls }}s{{ end }}://{{ .Values.nextcloud.host }}{{ .Values.notifyPush.ingress.path }}" diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index baa9a6f2..97b55f31 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -694,38 +694,77 @@ dnsConfig: # Notify Push (Clientpush) notifyPush: - # -- enable another deployment to handle notify_push (sometimes called ClientPush) + # -- Enable another deployment to handle notify_push (sometimes called ClientPush) + # @section -- Notify Push (Clientpush) enabled: false + # -- Setup notify_push on nextcloud per docker-entrypoint-hooks before start + # @section -- Notify Push (Clientpush) autoSetup: false + # -- Number of notify-push pod replicas to deploy + # @section -- Notify Push (Clientpush) replicaCount: 1 image: + # -- notify-push image registry + # @section -- Notify Push (Clientpush) registry: docker.io - # -- image of notify_push (there is no official image yet: https://github.com/nextcloud/notify_push/issues/106) + # -- notify-push image name (there is no official image yet: https://github.com/nextcloud/notify_push/issues/106) + # @section -- Notify Push (Clientpush) repository: miles170/notify_push + # -- notify-push image tag + # @section -- Notify Push (Clientpush) tag: v0.7.0 + # -- notify-push image pull policy + # @section -- Notify Push (Clientpush) pullPolicy: IfNotPresent - pullSecrets: + # -- notify-push image pull secrets + # e.g. # - myRegistrKeySecretName + # @section -- Notify Push (Clientpush) + pullSecrets: [] + # -- option to set the redis_url per env (if a external redis is used) e.g.: `value: ""` or `valueFrom: {secretKeyRef:{name:"",key:""}}` + # @section -- Notify Push (Clientpush) redisURLEnv: - resources: {} - + # -- Additional annotations for notify-push pods + # @section -- Notify Push (Clientpush) podAnnotations: {} + # -- Additional labels for notify-push pods + # @section -- Notify Push (Clientpush) podLabels: {} + # -- Optional security context for the notify-push pod + # @section -- Notify Push (Clientpush) + podSecurityContext: {} + + # -- Optional security context for the notify-push container + # @section -- Notify Push (Clientpush) + securityContext: {} + # -- notify-push resources + # @section -- Notify Push (Clientpush) + resources: {} service: + # -- notify-push: Kubernetes Service type + # @section -- Notify Push (Clientpush) type: ClusterIP # -- Use serviceLoadBalancerIP to request a specific static IP, otherwise leave blank + # @section -- Notify Push (Clientpush) loadBalancerIP: + # -- Additional annotations for service notify-push + # @section -- Notify Push (Clientpush) annotations: {} + # -- Additional labels for service notify-push + # @section -- Notify Push (Clientpush) labels: {} ingress: - # -- patch default ingress to forward following path to notify_push service + # -- Add path in default ingress to notify_push service + # @section -- Notify Push (Clientpush) path: /push + # -- PathType for additional path in default ingress for notify-push path + # @section -- Notify Push (Clientpush) pathType: Prefix imaginary: