Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-avoid-probes
Browse files Browse the repository at this point in the history
Signed-off-by: Jesse Hitch <[email protected]>
  • Loading branch information
jessebot authored Jul 24, 2024
2 parents e601737 + 34fc2df commit 23b861c
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 44 deletions.
75 changes: 32 additions & 43 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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=2 --set=hpa.maxPods=3 --set=hpa.targetCPUUtilizationPercentage=75"'

steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down Expand Up @@ -90,48 +112,15 @@ jobs:
uses: helm/[email protected]
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/[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"
- name: Summary
run: if ${{ needs.changes.outputs.src != 'false' && needs.run-tests.result != 'success' }}; then exit 1; fi
3 changes: 2 additions & 1 deletion charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,15 @@ 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` |
| `deploymentLabels` | Labels to be added at 'deployment' level | not set |
| `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
Expand Down
6 changes: 6 additions & 0 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -409,3 +411,7 @@ spec:
{{- if .Values.rbac.enabled }}
serviceAccountName: {{ .Values.rbac.serviceaccount.name }}
{{- end }}
{{- with .Values.dnsConfig }}
dnsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down

0 comments on commit 23b861c

Please sign in to comment.