From 1d7670cb15cee10536e08db48609ed7aeb6b8d54 Mon Sep 17 00:00:00 2001 From: Jesse Hitch Date: Mon, 22 Jul 2024 12:03:31 +0200 Subject: [PATCH 1/7] Update pull_request_template.md - remove top header + add link to contributing docs Signed-off-by: Jesse Hitch --- .github/pull_request_template.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 7c2e3576..fa20f093 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,3 @@ -# Pull Request - ## Description of the change @@ -23,6 +21,7 @@ ## Checklist +- [ ] I have read the [CONTRIBUTING.md](https://github.com/nextcloud/helm/blob/main/CONTRIBUTING.md#pull-requests) doc. - [ ] DCO has been [signed off on the commit](https://docs.github.com/en/github/authenticating-to-github/signing-commits). - [ ] Chart version bumped in `Chart.yaml` according to [semver](http://semver.org/). -- [ ] (optional) Variables are documented in the README.md +- [ ] (optional) Parameters are documented in the README.md From e47fc0cf9a0fd198ee9d487b486492b00a596d4d Mon Sep 17 00:00:00 2001 From: Niklas Liechti Date: Tue, 23 Jul 2024 11:16:24 +0200 Subject: [PATCH 2/7] Add possibility to configure custom dnsConfig on the nextcloud images. Signed-off-by: Niklas Liechti --- charts/nextcloud/README.md | 1 + charts/nextcloud/templates/deployment.yaml | 4 ++++ charts/nextcloud/values.yaml | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index cc569c37..a6c0349e 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -202,6 +202,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `deploymentAnnotations` | Annotations to be added at 'deployment' level | not set | | `podLabels` | Labels to be added at 'pod' level | not set | | `podAnnotations` | Annotations to be added at 'pod' level | not set | +| `dnsConfig` | Custom dnsConfig for nextcloud containers | `{}` | ### Database Configurations diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 51a79d67..db73a64d 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -396,3 +396,7 @@ spec: {{- if .Values.rbac.enabled }} serviceAccountName: {{ .Values.rbac.serviceaccount.name }} {{- end }} + {{- with .Values.dnsConfig }} + dnsConfig: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 82de3596..6184a711 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -502,6 +502,12 @@ tolerations: [] affinity: {} +dnsConfig: {} +# Custom dns config for Nextcloud containers. +# You can for example configure ndots. This may be needed in some clusters with alpine images. +# options: +# - name: ndots +# value: "1" ## Prometheus Exporter / Metrics ## From b197057b439a225da083cf0bd399501aaff58373 Mon Sep 17 00:00:00 2001 From: Jesse Hitch Date: Tue, 23 Jul 2024 11:56:18 +0200 Subject: [PATCH 3/7] add documentation section on adjusting php.ini values (#595) Signed-off-by: jessebot --- charts/nextcloud/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index cc569c37..a10e1917 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -22,15 +22,24 @@ helm install my-release nextcloud/nextcloud * [Cron jobs](#cron-jobs) * [Multiple config.php file](#multiple-configphp-file) * [Using nginx](#using-nginx) + * [Service discovery with nginx and ingress](#service-discovery-with-nginx-and-ingress) * [Preserving Source IP](#preserving-source-ip) * [Hugepages](#hugepages) * [HPA (Clustering)](#hpa-clustering) +* [Adjusting PHP ini values](#adjusting-php-ini-values) * [Running `occ` commands](#running-occ-commands) * [Putting Nextcloud into maintanence mode](#putting-nextcloud-into-maintanence-mode) * [Downloading models for recognize](#downloading-models-for-recognize) * [Backups](#backups) * [Upgrades](#upgrades) * [Troubleshooting](#troubleshooting) + * [Logging](#logging) + * [Changing the logging behavior](#changing-the-logging-behavior) + * [Viewing the logs](#viewing-the-logs) + * [Exec into the kubernetes pod:](#exec-into-the-kubernetes-pod) + * [Then look for the `nextcloud.log` file with tail or cat:](#then-look-for-the-nextcloudlog-file-with-tail-or-cat) + * [Copy the log file to your local machine:](#copy-the-log-file-to-your-local-machine) + * [Sharing the logs](#sharing-the-logs) ## Introduction @@ -494,6 +503,20 @@ persistence: accessMode: ReadWriteMany ``` +## Adjusting PHP ini values + +Sometimes you may need special [`php.ini`](https://www.php.net/manual/en/ini.list.php) values. For instance, perhaps your setup requires a bit more memory. You can add additional `php.ini` files in the values.yaml by providing `nextcloud.phpConfigs.NAME_OF_FILE`. Here's an examples: + +```yaml +nextcloud: + phpConfigs: + zz-memory_limit.ini: |- + memory_limit=512M +``` + +> [!Note] +> Be sure to prefix your file name with `zz` to ensure it is loaded at the end. + ## Running `occ` commands Sometimes you need to run an [occ](https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/occ_command.html) command on the Nextcloud container directly. You can do that by running commands as the user `www-data` via the `kubectl exec` command. From d09707317cb391cd8f0eea00cd9952361d0006b1 Mon Sep 17 00:00:00 2001 From: Niklas Liechti Date: Tue, 23 Jul 2024 12:39:21 +0200 Subject: [PATCH 4/7] Bump chart Version to 5.3.0 Signed-off-by: Niklas Liechti --- charts/nextcloud/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index a81e7869..3b051a66 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 5.2.2 +version: 5.3.0 appVersion: 29.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: From addc0ead853f738b3a241bf139415bd621b1de6b Mon Sep 17 00:00:00 2001 From: Tero Paloheimo Date: Tue, 23 Jul 2024 16:32:07 +0300 Subject: [PATCH 5/7] update: 29.0.4 Signed-off-by: Tero Paloheimo --- charts/nextcloud/Chart.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index a81e7869..1be2f6c8 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 name: nextcloud -version: 5.2.2 -appVersion: 29.0.3 +version: 5.2.3 +appVersion: 29.0.4 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: - nextcloud From 5709ed0fcd2650f4f3a4924c81d567b66894b75f Mon Sep 17 00:00:00 2001 From: Jesse Hitch Date: Wed, 24 Jul 2024 07:55:36 +0200 Subject: [PATCH 6/7] Refactor .github/workflows/lint-test.yaml to use a matrix for generating jobs for each test case (#598) Signed-off-by: jessebot Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> --- .github/workflows/lint-test.yaml | 75 ++++++++++++++------------------ 1 file changed, 32 insertions(+), 43 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index ded95bf8..d7b760fc 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -22,7 +22,7 @@ jobs: - 'charts/nextcloud/templates/**' lint: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest-low needs: changes if: needs.changes.outputs.src != 'false' steps: @@ -56,10 +56,32 @@ jobs: if: steps.list-changed.outputs.changed == 'true' run: ct lint --target-branch ${{ github.event.repository.default_branch }} - test-internal-database: + run-tests: runs-on: ubuntu-22.04 needs: [changes, lint] + # only run this job if there are helm chart file changes if: needs.changes.outputs.src != 'false' + strategy: + # continue with all the other jobs even if one fails + fail-fast: false + matrix: + # each item in this list is a job with an isolated test VM + test_cases: + # test the plain helm chart with nothing changed + - name: 'Default - no custom values' + + # test the helm chart with postgresql subchart enabled + - name: PostgreSQL Enabled + helm_args: '--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=testing12345"' + + # test the helm chart with nginx container enabled + - name: Nginx Enabled + helm_args: '--helm-extra-set-args "--set=image.flavor=fpm --set=nginx.enabled=true"' + + # test the helm chart with horizontal pod autoscaling enabled + - name: Horizontal Pod Autoscaling Enabled + helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=1 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' + steps: - name: Checkout uses: actions/checkout@v4 @@ -90,48 +112,15 @@ jobs: uses: helm/kind-action@v1.10.0 if: steps.list-changed.outputs.changed == 'true' - - name: Run chart-testing (install) + - name: Run chart-testing (install ${{ matrix.test_cases.name }}) id: install if: steps.list-changed.outputs.changed == 'true' - run: ct install --target-branch ${{ github.event.repository.default_branch }} + run: ct install --target-branch ${{ github.event.repository.default_branch }} ${{ matrix.test_cases.helm_args }} - test-postgresql-database: - runs-on: ubuntu-22.04 - needs: [changes, lint] - if: needs.changes.outputs.src != 'false' + summary: + runs-on: ubuntu-latest-low + needs: [changes, run-tests] + if: always() 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/chart-testing-action@v2.6.1 - - - 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.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 }} \ - --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" + - name: Summary + run: if ${{ needs.changes.outputs.src != 'false' && needs.run-tests.result != 'success' }}; then exit 1; fi From 34fc2dfad665712bf379c84150f4b93cdbcea0f4 Mon Sep 17 00:00:00 2001 From: Jesse Hitch Date: Wed, 24 Jul 2024 08:39:00 +0200 Subject: [PATCH 7/7] only set spec.replicas in Nextcloud deployment if .Values.hpa.enabled is set to false (#596) update hpa ci test to use a minimum of 2 pods Signed-off-by: jessebot Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com> --- .github/workflows/lint-test.yaml | 2 +- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 2 +- charts/nextcloud/templates/deployment.yaml | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-test.yaml b/.github/workflows/lint-test.yaml index d7b760fc..a6205de0 100644 --- a/.github/workflows/lint-test.yaml +++ b/.github/workflows/lint-test.yaml @@ -80,7 +80,7 @@ jobs: # test the helm chart with horizontal pod autoscaling enabled - name: Horizontal Pod Autoscaling Enabled - helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=1 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' + helm_args: '--helm-extra-set-args "--set=hpa.enabled=true --set=hpa.minPods=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"' steps: - name: Checkout diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index a729d32c..c39f46ac 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 5.3.0 +version: 5.3.1 appVersion: 29.0.4 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 8f8cbfaa..d50338d5 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -203,7 +203,7 @@ The following table lists the configurable parameters of the nextcloud chart and | `startupProbe.timeoutSeconds` | When the probe times out | `5` | | `startupProbe.failureThreshold` | Minimum consecutive failures for the probe | `30` | | `startupProbe.successThreshold` | Minimum consecutive successes for the probe | `1` | -| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler | `false` | +| `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler. If set to `true`, ignores `replicaCount`. | `false` | | `hpa.cputhreshold` | CPU threshold percent for the HorizontalPodAutoscale | `60` | | `hpa.minPods` | Min. pods for the Nextcloud HorizontalPodAutoscaler | `1` | | `hpa.maxPods` | Max. pods for the Nextcloud HorizontalPodAutoscaler | `10` | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index db73a64d..6f601963 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -17,7 +17,9 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if not .Values.hpa.enabled }} replicas: {{ .Values.replicaCount }} + {{- end }} strategy: {{- toYaml .Values.nextcloud.strategy | nindent 4 }} selector: