Skip to content

Commit

Permalink
Merge branch 'main' into add-s3-default-configs
Browse files Browse the repository at this point in the history
Signed-off-by: JesseBot <[email protected]>
  • Loading branch information
jessebot authored Apr 30, 2024
2 parents f272e15 + 30c69c1 commit c888bdb
Show file tree
Hide file tree
Showing 23 changed files with 566 additions and 409 deletions.
18 changes: 13 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,21 @@ Thanks for considering a contribution to this Nextcloud repository run by the co

# Pull Requests

Before submitting a feature or fix PR, please make sure the following are done:
Before submitting a feature or fix PR, please make sure your changes are targetted to one feature or fix, and all your commits are signed off. (Learn more the DCO [here](https://probot.github.io/apps/dco))

1. Make sure all your commits are signed off. (Learn more the DCO [here](https://probot.github.io/apps/dco))
2. Any new or changed values are updated in the [values.yaml](./charts/nextcloud/values.yaml) and the [README.md](./charts/nextcloud/README.md)
3. Bump the `version` in the [Chart.yaml](./charts/nextcloud/Chart.yaml) according to [Semantic Versioning](https://semver.org) which uses the format `major.minor.patch`.
If you're making a change to the chart templates or `values.yaml`, please also do the following:

1. Ensure the chart is linted using [`helm lint`](https://helm.sh/docs/helm/helm_lint/)
2. Test rendering the helm templates from the chart root dir (`charts/nextcloud`) using `helm template .`
- If you're making a change to a non-default value, please also test that value change locally. You can pass in a custom values file to `helm template` with `--values mycustomvalues.yaml`
3. Test installing the chart. A great tool for this is [`ct`](https://github.com/helm/chart-testing/tree/main) using [`ct install`](https://github.com/helm/chart-testing/blob/main/doc/ct_install.md) on a test cluster like [kind](https://kind.sigs.k8s.io/)
4. Make sure new or changed values are updated in the [values.yaml](./charts/nextcloud/values.yaml) and the [README.md](./charts/nextcloud/README.md)
5. Bump the `version` in the [Chart.yaml](./charts/nextcloud/Chart.yaml) according to [Semantic Versioning](https://semver.org) which uses the format `major.minor.patch`.

Then, please make sure you follow the [pull request template](.github/pull_request_template.md), so we can more quickly review. In order to move your PR forward faster (for instance, bumping the helm chart version for you), please also check the "Allow edits and access to secrets by maintainers" box next to the "Create pull request" button:

![screenshot of the allow edits by maintainers check box to the left of the Create pull request button on GitHub](https://github.com/nextcloud/helm/assets/2389292/3a8044a9-583d-496a-b3d2-4dd699c56ed4)

Then, please make sure you follow the [pull request template](.github/pull_request_template.md), so we can more quickly review.

# Issues

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ helm repo update
For more information, please checkout the chart level [README.md](./charts/nextcloud/README.md).

### Support and Contribution
This helm chart is community maintained, and not supported by Nextcloud GmbH. Please also review the official [NextCloud Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/) before contributing.
This helm chart is community maintained, and not supported by Nextcloud GmbH. Please also review the official [NextCloud Code of Conduct](https://nextcloud.com/contribute/code-of-conduct/) and this repo's [contributing doc](./CONTRIBUTING.md) before contributing.

#### Questions and Discussions
[GitHub Discussion](https://github.com/nextcloud/helm/discussions)
Expand Down
4 changes: 2 additions & 2 deletions charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: nextcloud
version: 4.5.3
appVersion: 27.1.3
version: 4.7.7
appVersion: 29.0.0
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
- nextcloud
Expand Down
192 changes: 147 additions & 45 deletions charts/nextcloud/README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion charts/nextcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Create image name that is used in the deployment
{{- if .Values.image.tag -}}
{{- printf "%s:%s" .Values.image.repository .Values.image.tag -}}
{{- else -}}
{{- printf "%s:%s-%s" .Values.image.repository .Chart.AppVersion (default "apache" .Values.image.flavor) -}}
{{- printf "%s:%s-%s" .Values.image.repository .Chart.AppVersion .Values.image.flavor -}}
{{- end -}}
{{- end -}}

Expand Down
18 changes: 18 additions & 0 deletions charts/nextcloud/templates/configmap-hooks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if not (values .Values.nextcloud.hooks | compact | empty) }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "nextcloud.fullname" . }}-hooks
labels:
app.kubernetes.io/name: {{ include "nextcloud.name" . }}
helm.sh/chart: {{ include "nextcloud.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
data:
{{- range $hook, $shell := .Values.nextcloud.hooks }}
{{- if $shell }}
{{ $hook }}.sh: {{ $shell | quote }}
{{- end }}
{{- end }}
{{- end }}
1 change: 1 addition & 0 deletions charts/nextcloud/templates/db-secret.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{{- if or .Values.mariadb.enabled .Values.externalDatabase.enabled .Values.postgresql.enabled }}
{{- if not .Values.externalDatabase.existingSecret.enabled }}
---
apiVersion: v1
kind: Secret
metadata:
Expand Down
44 changes: 29 additions & 15 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ spec:
{{- if .Values.nginx.enabled }}
nginx-config-hash: {{ print .Values.nginx.config.default "-" .Values.nginx.config.custom | sha256sum }}
{{- end }}
hooks-hash: {{ toYaml .Values.nextcloud.hooks | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand All @@ -63,13 +64,13 @@ spec:
postStart:
exec:
command:
{{- toYaml . | nindent 18 -}}
{{- toYaml . | nindent 18 }}
{{- end }}
{{- with .preStopCommand }}
preStop:
exec:
command:
{{- toYaml . | nindent 18 -}}
{{- toYaml . | nindent 18 }}
{{- end }}
{{- end }}
env:
Expand Down Expand Up @@ -136,6 +137,14 @@ spec:
{{- end }}
volumeMounts:
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
{{- range $hook, $shell := .Values.nextcloud.hooks }}
{{- if $shell }}
- name: nextcloud-hooks
mountPath: /docker-entrypoint-hooks.d/{{ $hook }}/helm.sh
subPath: {{ $hook }}.sh
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.nginx.enabled }}
- name: {{ .Chart.Name }}-nginx
image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}"
Expand All @@ -151,8 +160,8 @@ spec:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
Expand All @@ -167,8 +176,8 @@ spec:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
Expand All @@ -183,8 +192,8 @@ spec:
path: /status.php
port: {{ $.Values.nextcloud.containerPort }}
httpHeaders:
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
- name: Host
value: {{ $.Values.nextcloud.host | quote }}
initialDelaySeconds: {{ .initialDelaySeconds }}
periodSeconds: {{ .periodSeconds }}
timeoutSeconds: {{ .timeoutSeconds }}
Expand Down Expand Up @@ -228,8 +237,7 @@ spec:
mountPath: /var/www/html/themes
subPath: {{ ternary "themes" (printf "%s/themes" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) }}
- name: nextcloud-nginx-config
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
mountPath: /etc/nginx/conf.d/
{{- with .Values.nextcloud.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -239,20 +247,20 @@ spec:
image: {{ include "nextcloud.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /cron.sh
- /cron.sh
{{- with .Values.cronjob.lifecycle }}
lifecycle:
{{- with .postStartCommand }}
postStart:
exec:
command:
{{- toYaml . | nindent 18 -}}
{{- toYaml . | nindent 18 }}
{{- end }}
{{- with .preStopCommand }}
preStop:
exec:
command:
{{- toYaml . | nindent 18 -}}
{{- toYaml . | nindent 18 }}
{{- end }}
{{- end }}
env:
Expand Down Expand Up @@ -280,7 +288,7 @@ spec:
{{- end }}
{{- if .Values.mariadb.enabled }}
- name: mariadb-isalive
image: {{ .Values.mariadb.image.registry }}/{{ .Values.mariadb.image.repository }}:{{ .Values.mariadb.image.tag }}
image: {{ .Values.mariadb.image.registry | default "docker.io" }}/{{ .Values.mariadb.image.repository }}:{{ .Values.mariadb.image.tag }}
env:
- name: MYSQL_USER
valueFrom:
Expand All @@ -298,7 +306,7 @@ spec:
- {{ printf "until mysql --host=%s-mariadb --user=${MYSQL_USER} --password=${MYSQL_PASSWORD} --execute=\"SELECT 1;\"; do echo waiting for mysql; sleep 2; done;" .Release.Name }}
{{- else if .Values.postgresql.enabled }}
- name: postgresql-isready
image: {{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
image: {{ .Values.postgresql.image.registry | default "docker.io" }}/{{ .Values.postgresql.image.repository }}:{{ .Values.postgresql.image.tag }}
env:
- name: POSTGRES_USER
valueFrom:
Expand Down Expand Up @@ -349,6 +357,12 @@ spec:
configMap:
name: {{ template "nextcloud.fullname" . }}-nginxconfig
{{- end }}
{{- if not (values .Values.nextcloud.hooks | compact | empty) }}
- name: nextcloud-hooks
configMap:
name: {{ template "nextcloud.fullname" . }}-hooks
defaultMode: 0o755
{{- end }}
{{- with .Values.nextcloud.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
13 changes: 8 additions & 5 deletions charts/nextcloud/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.hpa.enabled -}}
{{- if .Values.hpa.enabled }}
---
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
Expand All @@ -14,7 +15,9 @@ spec:
kind: Deployment
apiVersion: apps/v1
name: {{ template "nextcloud.fullname" . }}
minReplicas: {{ .Values.hpa.minPods }}
maxReplicas: {{ .Values.hpa.maxPods }}
targetCPUUtilizationPercentage: {{ .Values.hpa.cputhreshold }}
{{- end }}
{{- with .Values.hpa }}
minReplicas: {{ .minPods }}
maxReplicas: {{ .maxPods }}
targetCPUUtilizationPercentage: {{ .cputhreshold }}
{{- end }}{{/* end-with .hpa */}}
{{- end }}
57 changes: 29 additions & 28 deletions charts/nextcloud/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{{- if .Values.ingress.enabled }}
---
apiVersion: {{ include "nextcloud.ingress.apiVersion" . }}
kind: Ingress
metadata:
Expand All @@ -9,37 +10,37 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: app
{{- if .Values.ingress.labels }}
{{ toYaml .Values.ingress.labels | indent 4 }}
{{- end }}
{{- if .Values.ingress.annotations }}
{{- with .Values.ingress.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml .Values.ingress.annotations | indent 4 }}
{{- end }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.className }}
ingressClassName: {{ .Values.ingress.className }}
{{- with .Values.ingress.className }}
ingressClassName: {{ . }}
{{- end }}
rules:
- host: {{ .Values.nextcloud.host }}
http:
paths:
- path: {{ .Values.ingress.path }}
{{- if eq (include "nextcloud.ingress.apiVersion" $) "networking.k8s.io/v1" }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend:
{{- if eq (include "nextcloud.ingress.apiVersion" $) "networking.k8s.io/v1" }}
service:
name: {{ template "nextcloud.fullname" . }}
port:
number: {{ .Values.service.port }}
{{- else }}
serviceName: {{ template "nextcloud.fullname" . }}
servicePort: {{ .Values.service.port }}
{{- end }}
{{- if .Values.ingress.tls }}
- host: {{ .Values.nextcloud.host }}
http:
paths:
- path: {{ .Values.ingress.path }}
{{- if (eq (include "nextcloud.ingress.apiVersion" $) "networking.k8s.io/v1") }}
pathType: {{ .Values.ingress.pathType }}
{{- end }}
backend:
{{- if (eq (include "nextcloud.ingress.apiVersion" $) "networking.k8s.io/v1") }}
service:
name: {{ template "nextcloud.fullname" . }}
port:
number: {{ .Values.service.port }}
{{- else }}
serviceName: {{ template "nextcloud.fullname" . }}
servicePort: {{ .Values.service.port }}
{{- end }}
{{- with .Values.ingress.tls }}
tls:
{{ toYaml .Values.ingress.tls | indent 4 }}
{{- end -}}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
75 changes: 0 additions & 75 deletions charts/nextcloud/templates/metrics-deployment.yaml

This file was deleted.

Loading

0 comments on commit c888bdb

Please sign in to comment.