Skip to content

Commit c478128

Browse files
feat(nextcloud): add support for extraManifests #745
Signed-off-by: Thomas Di Cizerone <[email protected]>
1 parent ff81735 commit c478128

File tree

7 files changed

+203
-42
lines changed

7 files changed

+203
-42
lines changed

.github/workflows/lint-test.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,14 @@ jobs:
9595
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/imaginary.yaml"
9696
test: true
9797

98+
# test the helm chart with extra manifests
99+
- name: Extra Manifests Enabled
100+
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/extra-manifests.yaml"
101+
test: true
102+
- name: Extra Manifests using a map Enabled
103+
helm_args: --namespace nextcloud --skip-clean-up --helm-extra-set-args "--create-namespace --values charts/nextcloud/test-values/extra-manifests-map.yaml"
104+
test: true
105+
98106
steps:
99107
- name: Checkout
100108
uses: actions/checkout@v6

charts/nextcloud/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: nextcloud
3-
version: 8.5.10
3+
version: 8.6.0
44
# renovate: image=docker.io/library/nextcloud
55
appVersion: 32.0.2
66
description: A file sharing server that puts the control and security of your own data back into your hands.

charts/nextcloud/README.md

Lines changed: 93 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -11,47 +11,51 @@ helm install my-release nextcloud/nextcloud
1111

1212
## Quick Links
1313

14-
* [Introduction](#introduction)
15-
* [Prerequisites](#prerequisites)
16-
* [Installing the Chart](#installing-the-chart)
17-
* [Uninstalling the Chart](#uninstalling-the-chart)
18-
* [Upgrade / Breaking Changes](#upgrade--breaking-changes)
19-
* [Configuration](#configuration)
20-
* [Ingress](#ingress)
21-
* [Ingress Sticky-Sessions](#ingress-sticky-sessions)
22-
* [NGINX Ingress-Controller](#nginx-ingress-controller)
23-
* [Traefik Ingress-Controller](#traefik-ingress-controller)
24-
* [HAProxy Ingress-Controller (Community-Version)](#haproxy-ingress-controller-community-version)
25-
* [Database Configurations](#database-configurations)
26-
* [Object Storage as Primary Storage Configuration](#object-storage-as-primary-storage-configuration)
27-
* [Persistence Configurations](#persistence-configurations)
28-
* [Metrics Configurations](#metrics-configurations)
29-
* [Headers set on NGINX](#headers-set-on-nginx)
30-
* [Probes Configurations](#probes-configurations)
31-
* [Collabora Configuration](#collabora-configuration)
32-
* [Imaginary](#imaginary)
33-
* [Cron jobs](#cron-jobs)
34-
* [Using the nextcloud docker image auto-configuration via env vars](#using-the-nextcloud-docker-image-auto-configuration-via-env-vars)
35-
* [Multiple config.php file](#multiple-configphp-file)
36-
* [Using nginx](#using-nginx)
37-
* [Service discovery with nginx and ingress](#service-discovery-with-nginx-and-ingress)
38-
* [Preserving Source IP](#preserving-source-ip)
39-
* [Hugepages](#hugepages)
40-
* [HPA (Clustering)](#hpa-clustering)
41-
* [Adjusting PHP ini values](#adjusting-php-ini-values)
42-
* [Running `occ` commands](#running-occ-commands)
43-
* [Putting Nextcloud into maintanence mode](#putting-nextcloud-into-maintanence-mode)
44-
* [Downloading models for recognize](#downloading-models-for-recognize)
45-
* [Backups](#backups)
46-
* [Upgrades](#upgrades)
47-
* [Troubleshooting](#troubleshooting)
48-
* [Logging](#logging)
49-
* [Changing the logging behavior](#changing-the-logging-behavior)
50-
* [Viewing the logs](#viewing-the-logs)
51-
* [Exec into the kubernetes pod:](#exec-into-the-kubernetes-pod)
52-
* [Then look for the `nextcloud.log` file with tail or cat:](#then-look-for-the-nextcloudlog-file-with-tail-or-cat)
53-
* [Copy the log file to your local machine:](#copy-the-log-file-to-your-local-machine)
54-
* [Sharing the logs](#sharing-the-logs)
14+
- [Nextcloud Helm Chart](#nextcloud-helm-chart)
15+
- [TL;DR;](#tldr)
16+
- [Quick Links](#quick-links)
17+
- [Introduction](#introduction)
18+
- [Prerequisites](#prerequisites)
19+
- [Installing the Chart](#installing-the-chart)
20+
- [Uninstalling the Chart](#uninstalling-the-chart)
21+
- [Upgrade / Breaking Changes](#upgrade--breaking-changes)
22+
- [Configuration](#configuration)
23+
- [Ingress](#ingress)
24+
- [Ingress Sticky-Sessions](#ingress-sticky-sessions)
25+
- [NGINX Ingress-Controller](#nginx-ingress-controller)
26+
- [Traefik Ingress-Controller](#traefik-ingress-controller)
27+
- [HAProxy Ingress-Controller (Community-Version)](#haproxy-ingress-controller-community-version)
28+
- [Database Configurations](#database-configurations)
29+
- [Object Storage as Primary Storage Configuration](#object-storage-as-primary-storage-configuration)
30+
- [Persistence Configurations](#persistence-configurations)
31+
- [Metrics Configurations](#metrics-configurations)
32+
- [Headers set on NGINX](#headers-set-on-nginx)
33+
- [Probes Configurations](#probes-configurations)
34+
- [Collabora Configuration](#collabora-configuration)
35+
- [Imaginary](#imaginary)
36+
- [Cron jobs](#cron-jobs)
37+
- [Using the nextcloud docker image auto-configuration via env vars](#using-the-nextcloud-docker-image-auto-configuration-via-env-vars)
38+
- [Multiple config.php file](#multiple-configphp-file)
39+
- [Using nginx](#using-nginx)
40+
- [Service discovery with nginx and ingress](#service-discovery-with-nginx-and-ingress)
41+
- [Preserving Source IP](#preserving-source-ip)
42+
- [Hugepages](#hugepages)
43+
- [HPA (Clustering)](#hpa-clustering)
44+
- [Adjusting PHP ini values](#adjusting-php-ini-values)
45+
- [Running `occ` commands](#running-occ-commands)
46+
- [Putting Nextcloud into maintanence mode](#putting-nextcloud-into-maintanence-mode)
47+
- [Downloading models for recognize](#downloading-models-for-recognize)
48+
- [Injecting Additional Manifests (`extraManifests`)](#injecting-additional-manifests-extramanifests)
49+
- [Backups](#backups)
50+
- [Upgrades](#upgrades)
51+
- [Troubleshooting](#troubleshooting)
52+
- [Logging](#logging)
53+
- [Changing the logging behavior](#changing-the-logging-behavior)
54+
- [Viewing the logs](#viewing-the-logs)
55+
- [Exec into the kubernetes pod:](#exec-into-the-kubernetes-pod)
56+
- [Then look for the `nextcloud.log` file with tail or cat:](#then-look-for-the-nextcloudlog-file-with-tail-or-cat)
57+
- [Copy the log file to your local machine:](#copy-the-log-file-to-your-local-machine)
58+
- [Sharing the logs](#sharing-the-logs)
5559

5660
## Introduction
5761

@@ -249,6 +253,7 @@ The following table lists the configurable parameters of the nextcloud chart and
249253
| `podAnnotations` | Annotations to be added at 'pod' level | not set |
250254
| `dnsConfig` | Custom dnsConfig for nextcloud containers | `{}` |
251255
| `topologySpreadConstraints` | TopologySpreadConstraints for nextcloud pod and cronjob pod | `{}` |
256+
| `extraManifests` | Map or List of additional Kubernetes manifests to render with the release. If a List is provided, each item can be either a YAML string (multi-line block) or a YAML object. Useful for custom resources like Traefik IngressRoutes, Middlewares, etc. | `[]` |
252257

253258
### Ingress
254259
#### Ingress Sticky-Sessions
@@ -801,6 +806,53 @@ kubectl exec $NEXTCLOUD_POD -- su -s /bin/sh www-data -c "php occ maintenance:mo
801806
kubectl exec $NEXTCLOUD_POD -- su -s /bin/sh www-data -c "php occ recognize:download-models"
802807
```
803808

809+
## Injecting Additional Manifests (`extraManifests`)
810+
811+
You can inject additional Kubernetes manifests (such as Traefik IngressRoutes, Middlewares, or any custom resources) directly via `values.yaml` using the `extraManifests` value.
812+
813+
`extraManifests` is either:
814+
- a map of manifest names to their YAML definitions
815+
- a list of YAML definitions, where each itemin the list can be either:
816+
- a string containing valid YAML (multi-line block, e.g. with `|`), or
817+
- a YAML object (inline YAML structure).
818+
819+
These manifests will be rendered as part of the Helm release.
820+
821+
**Example usage in `values.yaml`:**
822+
823+
```yaml
824+
extraManifests:
825+
- |
826+
apiVersion: traefik.containo.us/v1alpha1
827+
kind: Middleware
828+
metadata:
829+
name: my-middleware
830+
spec:
831+
...
832+
- apiVersion: traefik.containo.us/v1alpha1
833+
kind: IngressRoute
834+
metadata:
835+
name: my-ingressroute
836+
spec:
837+
...
838+
# Or as a map:
839+
extraManifests:
840+
my-middleware:
841+
apiVersion: traefik.containo.us/v1alpha1
842+
kind: Middleware
843+
metadata:
844+
name: my-middleware
845+
spec:
846+
...
847+
my-ingressroute:
848+
apiVersion: traefik.containo.us/v1alpha1
849+
kind: IngressRoute
850+
metadata:
851+
name: my-ingressroute
852+
spec:
853+
...
854+
```
855+
804856
# Backups
805857
Check out the [official Nextcloud backup docs](https://docs.nextcloud.com/server/latest/admin_manual/maintenance/backup.html). For your files, if you're using persistent volumes, and you'd like to back up to s3 backed storage (such as minio), consider using [k8up](https://github.com/k8up-io/k8up) or [velero](https://github.com/vmware-tanzu/velero).
806858

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{{- /*
2+
Renders extra manifests provided by the user in values.yaml under extraManifests.
3+
extraManifests can be a map (keyed by manifest name) or a list of manifests.
4+
If a map, each key is the name of the manifest.
5+
If an array, each item is a manifest, which can be a string (YAML block) or a YAML object.
6+
*/ -}}
7+
{{- range $manifest := .Values.extraManifests }}
8+
---
9+
{{- if kindIs "string" $manifest }}
10+
{{ tpl $manifest $ }}
11+
{{- else }}
12+
{{ tpl (toYaml $manifest) $ }}
13+
{{- end }}
14+
{{- end }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
fullnameOverride: nextcloud
2+
3+
nextcloud:
4+
host: nextcloud
5+
trustedDomains:
6+
- 'nextcloud.nextcloud.svc.cluster.local'
7+
- 'nextcloud'
8+
9+
extraManifests:
10+
my-config-map: |
11+
apiVersion: v1
12+
kind: ConfigMap
13+
metadata:
14+
name: custom-config
15+
labels:
16+
{{- include "nextcloud.labels" ( dict "component" "app" "rootContext" $ ) | nindent 4 }}
17+
data:
18+
customKey: customValue
19+
my-secret:
20+
apiVersion: v1
21+
kind: Secret
22+
metadata:
23+
name: '{{ template "nextcloud.fullname" . }}-custom-secret'
24+
data:
25+
secretKey: c2VjcmV0VmFsdWU=
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
fullnameOverride: nextcloud
2+
3+
nextcloud:
4+
host: nextcloud
5+
trustedDomains:
6+
- 'nextcloud.nextcloud.svc.cluster.local'
7+
- 'nextcloud'
8+
9+
extraManifests:
10+
- |
11+
apiVersion: v1
12+
kind: ConfigMap
13+
metadata:
14+
name: custom-config
15+
labels:
16+
{{- include "nextcloud.labels" ( dict "component" "app" "rootContext" $ ) | nindent 4 }}
17+
data:
18+
customKey: customValue
19+
- apiVersion: v1
20+
kind: Secret
21+
metadata:
22+
name: '{{ template "nextcloud.fullname" . }}-custom-secret'
23+
data:
24+
secretKey: c2VjcmV0VmFsdWU=

charts/nextcloud/values.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1035,3 +1035,41 @@ rbac:
10351035

10361036
## @param securityContext for nextcloud pod @deprecated Use `nextcloud.podSecurityContext` instead
10371037
securityContext: {}
1038+
1039+
# -- Allows users to inject additional Kubernetes manifests (YAML) to be rendered with the release.
1040+
# Could either be a list or a map
1041+
# If a map, each key is the name of the manifest.
1042+
# If an array, each item is a manifest, which can be a string (YAML block) or a YAML object.
1043+
# Each item should be a string containing valid YAML. Example:
1044+
# extraManifests:
1045+
# - |
1046+
# apiVersion: traefik.containo.us/v1alpha1
1047+
# kind: Middleware
1048+
# metadata:
1049+
# name: my-middleware
1050+
# spec:
1051+
# ...
1052+
# - |
1053+
# apiVersion: traefik.containo.us/v1alpha1
1054+
# kind: IngressRoute
1055+
# metadata:
1056+
# name: my-ingressroute
1057+
# spec:
1058+
# ...
1059+
# Or as a map:
1060+
# extraManifests:
1061+
# my-middleware:
1062+
# apiVersion: traefik.containo.us/v1alpha1
1063+
# kind: Middleware
1064+
# metadata:
1065+
# name: my-middleware
1066+
# spec:
1067+
# ...
1068+
# my-ingressroute:
1069+
# apiVersion: traefik.containo.us/v1alpha1
1070+
# kind: IngressRoute
1071+
# metadata:
1072+
# name: my-ingressroute
1073+
# spec:
1074+
# ...
1075+
extraManifests: []

0 commit comments

Comments
 (0)