From 6c9625e631af04f8f8f55ca58e24a985a8672b71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Lindh=C3=A9?= <7773090+lindhe@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:57:11 +0100 Subject: [PATCH] Enable setting initContainers' resources MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change adds values that lets users set the resources (requests/limits) for the initContainers in the nextcloud pod. I did also did a small refactoring to keep the code simple and also added the missing `securityContext` values to the README. Signed-off-by: Andreas Lindhé <7773090+lindhe@users.noreply.github.com> --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 4 ++++ charts/nextcloud/templates/deployment.yaml | 12 ++++++++---- charts/nextcloud/values.yaml | 2 ++ 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index e3e5534a..76322616 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 6.2.4 +version: 6.3.0 appVersion: 30.0.2 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 71e7cce8..17827c85 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -155,6 +155,10 @@ The following table lists the configurable parameters of the nextcloud chart and | `nextcloud.extraInitContainers` | specify additional init containers | `[]` | | `nextcloud.extraVolumes` | specify additional volumes for the NextCloud pod | `{}` | | `nextcloud.extraVolumeMounts` | specify additional volume mounts for the NextCloud pod | `{}` | +| `nextcloud.mariaDbInitContainer.resources` | set the `resources` field of the MariaDB init container in the Nextcloud Pod. | `{}` | +| `nextcloud.mariaDbInitContainer.securityContext` | set the `securityContext` field of the MariaDB init container in the Nextcloud Pod. | `{}` | +| `nextcloud.postgreSqlInitContainer.resources` | set the `resources` field of the PostgreSQL init container in the Nextcloud Pod. | `{}` | +| `nextcloud.postgreSqlInitContainer.securityContext` | set the `securityContext` field of the PostgreSQL init container in the Nextcloud Pod. | `{}` | | `nextcloud.securityContext` | Optional security context for the NextCloud container | `nil` | | `nextcloud.podSecurityContext` | Optional security context for the NextCloud pod (applies to all containers in the pod) | `nil` | | `nextcloud.postgreSqlInitContainer.securityContext` | Set postgresql initContainer securityContext parameters. | `{}` | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 6f601963..b3ada72e 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -295,9 +295,11 @@ spec: {{- if .Values.mariadb.enabled }} - name: mariadb-isalive image: {{ .Values.mariadb.image.registry | default "docker.io" }}/{{ .Values.mariadb.image.repository }}:{{ .Values.mariadb.image.tag }} - {{- with .Values.nextcloud.mariaDbInitContainer.securityContext }} + {{- with .Values.nextcloud.mariaDbInitContainer }} + resources: + {{- toYaml .resources | nindent 12 }} securityContext: - {{- toYaml . | nindent 12 }} + {{- toYaml .securityContext | nindent 12 }} {{- end }} env: - name: MYSQL_USER @@ -317,9 +319,11 @@ spec: {{- else if .Values.postgresql.enabled }} - name: postgresql-isready image: {{ .Values.postgresql.image.registry | default "docker.io" }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }} - {{- with .Values.nextcloud.postgreSqlInitContainer.securityContext }} + {{- with .Values.nextcloud.postgreSqlInitContainer }} + resources: + {{- toYaml .resources | nindent 12 }} securityContext: - {{- toYaml . | nindent 12 }} + {{- toYaml .securityContext | nindent 12 }} {{- end }} env: - name: POSTGRES_USER diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 586361eb..cd656ffd 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -305,11 +305,13 @@ nextcloud: # Settings for the MariaDB init container mariaDbInitContainer: + resources: {} # Set mariadb initContainer securityContext parameters. For example, you may need to define runAsNonRoot directive securityContext: {} # Settings for the PostgreSQL init container postgreSqlInitContainer: + resources: {} # Set postgresql initContainer securityContext parameters. For example, you may need to define runAsNonRoot directive securityContext: {}