Skip to content

Commit

Permalink
Merge branch 'main' into add-metrics-affinity-toleration-nodeselector
Browse files Browse the repository at this point in the history
Signed-off-by: JesseBot <[email protected]>
  • Loading branch information
jessebot authored Jun 9, 2024
2 parents 88fcff8 + 3dfd22e commit 9efec16
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 31 deletions.
107 changes: 95 additions & 12 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,39 @@ name: Lint and Test Charts

on:
pull_request:
paths-ignore:
- '.github/**'
- 'charts/**/README.md'
- 'CODE_OF_CONDUCT.md'
- 'CONTRIBUTING.md'
- 'LICENSE'
- 'README.md'

paths:
jobs:
lint-test:
changes:
runs-on: ubuntu-latest-low

outputs:
src: ${{ steps.changes.outputs.src}}

steps:
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
continue-on-error: true
with:
filters: |
src:
- 'charts/nextcloud/Chart.yaml'
- 'charts/nextcloud/values.yaml'
- 'charts/nextcloud/templates/**'
lint:
runs-on: ubuntu-22.04
needs: changes
if: needs.changes.outputs.src != 'false'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v3.5
uses: azure/setup-helm@v4
with:
version: v3.11.1
version: v3.14.4

- name: Add dependency chart repos
run: |
Expand All @@ -44,11 +56,82 @@ jobs:
if: steps.list-changed.outputs.changed == 'true'
run: ct lint --target-branch ${{ github.event.repository.default_branch }}

test-internal-database:
runs-on: ubuntu-22.04
needs: [changes, lint]
if: needs.changes.outputs.src != 'false'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4

- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create kind cluster
uses: helm/kind-action@v1.8.0
uses: helm/kind-action@v1.10.0
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
id: install
if: steps.list-changed.outputs.changed == 'true'
run: ct install --target-branch ${{ github.event.repository.default_branch }}

test-postgresql-database:
runs-on: ubuntu-22.04
needs: [changes, lint]
if: needs.changes.outputs.src != 'false'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.4

- name: Add dependency chart repos
run: |
helm repo add bitnami https://charts.bitnami.com/bitnami
- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --target-branch ${{ github.event.repository.default_branch }})
if [[ -n "$changed" ]]; then
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
- name: Create kind cluster
uses: helm/[email protected]
if: steps.list-changed.outputs.changed == 'true'

- name: Run chart-testing (install)
id: install
if: steps.list-changed.outputs.changed == 'true'
run: |
ct install --target-branch ${{ github.event.repository.default_branch }} \
--helm-extra-set-args "--set=postgresql.enabled=true --set=postgresql.global.postgresql.auth.password=testing123456 --set=internalDatabase.enabled=false --set=externalDatabase.enabled=True --set=externalDatabase.type=postgresql --set=externalDatabase.password=testing123456"
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ jobs:
# See https://github.com/helm/chart-releaser-action/issues/6
- name: Set up Helm
uses: azure/setup-helm@v3.5
uses: azure/setup-helm@v4
with:
version: v3.11.1
version: v3.14.4

- name: Add dependency chart repos
run: |
Expand Down
10 changes: 5 additions & 5 deletions charts/nextcloud/Chart.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
dependencies:
- name: postgresql
repository: oci://registry-1.docker.io/bitnamicharts
version: 12.12.10
version: 15.5.0
- name: mariadb
repository: oci://registry-1.docker.io/bitnamicharts
version: 12.2.9
version: 18.2.0
- name: redis
repository: oci://registry-1.docker.io/bitnamicharts
version: 17.13.2
digest: sha256:92fe0891c35c2586cfe3b76154412c188bb75cc0a687e1d771fc4c1cf0f8973d
generated: "2023-11-11T19:19:38.983179104+01:00"
version: 19.5.0
digest: sha256:4efc098feeb7f4486b7166f1c71b9c54bfee0797663a3339f379d397297303c7
generated: "2024-06-03T09:51:56.321676+02:00"
10 changes: 5 additions & 5 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.6.3
appVersion: 28.0.2
version: 5.1.0
appVersion: 29.0.1
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
- nextcloud
Expand All @@ -23,14 +23,14 @@ maintainers:
email: [email protected]
dependencies:
- name: postgresql
version: 12.12.*
version: 15.5.0
repository: oci://registry-1.docker.io/bitnamicharts
condition: postgresql.enabled
- name: mariadb
version: 12.2.*
version: 18.2.0
repository: oci://registry-1.docker.io/bitnamicharts
condition: mariadb.enabled
- name: redis
version: 17.13.*
version: 19.5.0
repository: oci://registry-1.docker.io/bitnamicharts
condition: redis.enabled
2 changes: 2 additions & 0 deletions charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ The following table lists the configurable parameters of the nextcloud chart and
| `nginx.config.custom` | Specify a custom config for nginx | `{}` |
| `nginx.resources` | nginx resources | `{}` |
| `nginx.securityContext` | Optional security context for the nginx container | `nil` |
| `nginx.extraEnv` | Optional environment variables for the nginx container | `nil` |
| `lifecycle.postStartCommand` | Specify deployment lifecycle hook postStartCommand | `nil` |
| `lifecycle.preStopCommand` | Specify deployment lifecycle hook preStopCommand | `nil` |
| `redis.enabled` | Whether to install/use redis for locking | `false` |
Expand Down Expand Up @@ -257,6 +258,7 @@ Is there a missing parameter for one of the Bitnami helm charts listed above? Pl

The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud data and configurations at the `/var/www/html` paths of the container.
Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube.
Nextcloud will *not* delete the PVCs when uninstalling the helm chart.


| Parameter | Description | Default |
Expand Down
2 changes: 1 addition & 1 deletion charts/nextcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Create environment variables used to configure the nextcloud container as well a
name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }}
key: {{ .Values.nextcloud.existingSecret.passwordKey }}
- name: NEXTCLOUD_TRUSTED_DOMAINS
value: {{ .Values.nextcloud.host }}
value: {{ .Values.nextcloud.host }}{{ if .Values.metrics.enabled }} {{ template "nextcloud.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local{{ end }}
{{- if ne (int .Values.nextcloud.update) 0 }}
- name: NEXTCLOUD_UPDATE
value: {{ .Values.nextcloud.update | quote }}
Expand Down
4 changes: 4 additions & 0 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ spec:
- name: {{ .Chart.Name }}-nginx
image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}"
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
{{- with .Values.nginx.extraEnv }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
protocol: TCP
Expand Down
3 changes: 2 additions & 1 deletion charts/nextcloud/templates/nextcloud-data-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: app
{{- with .Values.persistence.nextcloudData.annotations }}
annotations:
helm.sh/resource-policy: keep
{{- with .Values.persistence.nextcloudData.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand Down
3 changes: 2 additions & 1 deletion charts/nextcloud/templates/nextcloud-pvc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ metadata:
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/component: app
{{- with .Values.persistence.annotations }}
annotations:
helm.sh/resource-policy: keep
{{- with .Values.persistence.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand Down
2 changes: 1 addition & 1 deletion charts/nextcloud/templates/nginx-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
# to the URI, resulting in a HTTP 500 error response.
location ~ \.php(?:$|/) {
# Required for legacy support
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode\/proxy) /index.php$request_uri;
rewrite ^/(?!index|remote|public|cron|core\/ajax\/update|status|ocs\/v[12]|updater\/.+|oc[ms]-provider\/.+|.+\/richdocumentscode(_arm64)?\/proxy) /index.php$request_uri;

fastcgi_split_path_info ^(.+?\.php)(/.*)$;
set $path_info $fastcgi_path_info;
Expand Down
6 changes: 3 additions & 3 deletions charts/nextcloud/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ data:
{{- else }}
nextcloud-password: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- with .Values.metrics.token }}
nextcloud-token: {{ . | b64enc | quote }}
{{- else }}
{{- if and .Values.metrics.enabled .Values.metrics.token }}
nextcloud-token: {{ .Values.metrics.token | b64enc | quote }}
{{- else if and .Values.metrics.enabled (not .Values.metrics.token) }}
nextcloud-token: {{ randAlphaNum 10 | b64enc | quote }}
{{- end }}
{{- if .Values.nextcloud.mail.enabled }}
Expand Down
5 changes: 5 additions & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,11 @@ nginx:
# runAsNonRoot: true
# readOnlyRootFilesystem: true

## Extra environment variables
extraEnv: []
# - name: SOME_ENV
# value: ENV_VALUE

internalDatabase:
enabled: true
name: nextcloud
Expand Down

0 comments on commit 9efec16

Please sign in to comment.