diff --git a/stable/nextcloud/Chart.yaml b/stable/nextcloud/Chart.yaml index e4eec43a31..2bc27717ae 100644 --- a/stable/nextcloud/Chart.yaml +++ b/stable/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: nextcloud -version: 1.8.0 +version: 1.8.1 appVersion: 17.0.0 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/stable/nextcloud/README.md b/stable/nextcloud/README.md index 074f8f6989..f51b396354 100644 --- a/stable/nextcloud/README.md +++ b/stable/nextcloud/README.md @@ -54,7 +54,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `ingress.enabled` | Enable use of ingress controllers | `false` | | `ingress.servicePort` | Ingress' backend servicePort | `http` | | `ingress.annotations` | An array of service annotations | `nil` | -| `ingress.labels` | An array of service labels | `nil` | +| `ingress.labels` | An array of service labels | `nil` | | `ingress.tls` | Ingress TLS configuration | `[]` | | `nextcloud.host` | nextcloud host to create application URLs | `nextcloud.kube.home` | | `nextcloud.username` | User of the application | `admin` | @@ -80,6 +80,9 @@ The following table lists the configurable parameters of the nextcloud chart and | `nextcloud.defaultConfigs.\.apps\.config\.php` | Default configuration for apps | `true` | | `nextcloud.defaultConfigs.\.autoconfig\.php` | Default auto-configuration for databases | `true` | | `nextcloud.defaultConfigs.\.smtp\.config\.php` | Default configuration for smtp | `true` | +| `nextcloud.extraEnv` | specify additional environment variables | `{}` | +| `lifecycle.postStartCommand` | Specify deployment lifecycle hook postStartCommand | `nil` | +| `lifecycle.preStopCommand` | Specify deployment lifecycle hook preStopCommand | `nil` | | `internalDatabase.enabled` | Whether to use internal sqlite database | `true` | | `internalDatabase.database` | Name of the existing database | `nextcloud` | | `externalDatabase.enabled` | Whether to use external database | `false` | diff --git a/stable/nextcloud/templates/deployment.yaml b/stable/nextcloud/templates/deployment.yaml index b75992c7f9..2c8fd6069f 100644 --- a/stable/nextcloud/templates/deployment.yaml +++ b/stable/nextcloud/templates/deployment.yaml @@ -34,6 +34,21 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.lifecycle }} + lifecycle: + {{- if .Values.lifecycle.postStartCommand }} + postStart: + exec: + command: + {{- toYaml .Values.lifecycle.postStartCommand | nindent 16 -}} + {{- end }} + {{- if .Values.lifecycle.preStopCommand }} + preStop: + exec: + command: + {{- toYaml .Values.lifecycle.preStopCommand | nindent 16 -}} + {{- end }} + {{- end }} env: {{- if .Values.internalDatabase.enabled }} - name: SQLITE_DATABASE @@ -138,6 +153,9 @@ spec: - name: REDIS_HOST_PORT value: {{ .Values.redis.redisPort | quote }} {{- end }} + {{- if .Values.nextcloud.extraEnv }} +{{ toYaml .Values.nextcloud.extraEnv | indent 8 }} + {{- end }} ports: - name: http containerPort: 80 diff --git a/stable/nextcloud/values.yaml b/stable/nextcloud/values.yaml index 781fa59228..b21e39f02b 100644 --- a/stable/nextcloud/values.yaml +++ b/stable/nextcloud/values.yaml @@ -58,6 +58,13 @@ ingress: # - nextcloud.kube.home labels: {} + +# Allow configuration of lifecycle hooks +# ref: https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/ +lifecycle: {} + # postStartCommand: [] + # preStopCommand: [] + nextcloud: host: nextcloud.kube.home username: admin @@ -121,6 +128,16 @@ nextcloud: # ) # ); + ## + ## Extra environment variables + extraEnv: + # - name: SOME_SECRET_ENV + # valueFrom: + # secretKeyRef: + # name: nextcloud + # key: secret_key + + internalDatabase: enabled: true name: nextcloud