Skip to content

Commit 1fc9427

Browse files
committed
👐 Allow for multiline string and yaml objects
1 parent 294b525 commit 1fc9427

File tree

3 files changed

+28
-7
lines changed

3 files changed

+28
-7
lines changed

charts/nextcloud/README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ The following table lists the configurable parameters of the nextcloud chart and
228228
| `podLabels` | Labels to be added at 'pod' level | not set |
229229
| `podAnnotations` | Annotations to be added at 'pod' level | not set |
230230
| `dnsConfig` | Custom dnsConfig for nextcloud containers | `{}` |
231-
| `extraManifests` | List of additional Kubernetes manifests (YAML strings) to render with the release. Useful for custom resources like Traefik IngressRoutes, Middlewares, etc. | `[]` |
231+
| `extraManifests` | List of additional Kubernetes manifests to render with the release. Each item can be either a YAML string (multi-line block) or a YAML object. Useful for custom resources like Traefik IngressRoutes, Middlewares, etc. | `[]` |
232232

233233
### Ingress
234234
#### Ingress Sticky-Sessions
@@ -777,7 +777,13 @@ kubectl exec $NEXTCLOUD_POD -- su -s /bin/sh www-data -c "php occ recognize:down
777777

778778
## Injecting Additional Manifests (`extraManifests`)
779779

780-
You can inject additional Kubernetes manifests (such as Traefik IngressRoutes, Middlewares, or any custom resources) directly via `values.yaml` using the `extraManifests` value. This allows you to deploy custom resources alongside Nextcloud in a single Helm release.
780+
You can inject additional Kubernetes manifests (such as Traefik IngressRoutes, Middlewares, or any custom resources) directly via `values.yaml` using the `extraManifests` value.
781+
782+
Each item in the list can be either:
783+
- a string containing valid YAML (multi-line block, e.g. with `|`), or
784+
- a YAML object (inline YAML structure).
785+
786+
These manifests will be rendered as part of the Helm release.
781787

782788
**Example usage in `values.yaml`:**
783789

@@ -790,17 +796,14 @@ extraManifests:
790796
name: my-middleware
791797
spec:
792798
...
793-
- |
794-
apiVersion: traefik.containo.us/v1alpha1
799+
- apiVersion: traefik.containo.us/v1alpha1
795800
kind: IngressRoute
796801
metadata:
797802
name: my-ingressroute
798803
spec:
799804
...
800805
```
801806

802-
Each item in the list should be a string containing valid YAML. These manifests will be rendered as part of the Helm release.
803-
804807
# Backups
805808
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).
806809

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
{{- /*
22
Renders extra manifests provided by the user in values.yaml under extraManifests.
3-
Each item should be a string containing valid YAML (can be multi-document).
3+
Each item can be a string (YAML block) or a YAML object.
44
*/ -}}
55
{{- if .Values.extraManifests }}
66
{{- range $manifest := .Values.extraManifests }}
77
---
8+
{{- if kindIs "string" $manifest }}
89
{{ tpl $manifest $ }}
10+
{{- else }}
11+
{{ toYaml $manifest | nindent 0 }}
12+
{{- end }}
913
{{- end }}
1014
{{- end }}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extraManifests:
2+
- |
3+
apiVersion: v1
4+
kind: ConfigMap
5+
metadata:
6+
name: custom-config
7+
data:
8+
customKey: customValue
9+
- apiVersion: v1
10+
kind: Secret
11+
metadata:
12+
name: custom-secret
13+
data:
14+
secretKey: secretValue

0 commit comments

Comments
 (0)