Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use values files instead of set parameters for ci test values #7

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
paths:
jobs:
changes:
runs-on: ubuntu-latest-low
runs-on: ubuntu-latest

outputs:
src: ${{ steps.changes.outputs.src}}
Expand All @@ -22,7 +22,7 @@ jobs:
- 'charts/nextcloud/templates/**'

lint:
runs-on: ubuntu-latest-low
runs-on: ubuntu-latest
needs: changes
if: needs.changes.outputs.src != 'false'
steps:
Expand Down Expand Up @@ -72,21 +72,24 @@ jobs:

# 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"'
# helm_args: '--helm-extra-args "--values values.yaml --values test_values/postgresql_enabled_values.yaml"'
helm_args: "--helm-extra-args '--values charts/nextcloud/test_values/postgresql_enabled_values.yaml'"

# 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"'
# - name: Nginx Enabled
# helm_args: '--helm-extra-args "--values values.yaml --values test_values/nginx_enabled_values.yaml"'

# 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"'
# # test the helm chart with horizontal pod autoscaling enabled
# - name: Horizontal Pod Autoscaling Enabled
# helm_args: '--helm-extra-args "--values values.yaml --values test_values/hpa_enabled_values.yaml"'

# test the helm chart with s3 as the primary storage
- name: S3 Enabled as Primary Storage
# we need to skip the clean up so we can test adding a file
helm_args: |
--namespace nextcloud --skip-clean-up --helm-extra-set-args "--set=fullnameOverride=nextcloud --set=nextcloud.objectStore.s3.enabled=true --set=nextcloud.objectStore.s3.accessKey=nextcloud --set=nextcloud.objectStore.s3.secretKey=rootpass123 --set=nextcloud.objectStore.s3.host=minio.nextcloud.svc.cluster.local --set=nextcloud.objectStore.s3.port=9000 --set=nextcloud.objectStore.s3.ssl=false --set=nextcloud.objectStore.s3.bucket=nextcloud --set=nextcloud.objectStore.s3.usePathStyle=true --set=image.flavor=fpm --set=nginx.enabled=true --set=nextcloud.host=nextcloud --set=nextcloud.trustedDomains[0]='*'"
--helm-extra-args '--values charts/nextcloud/test_values/s3_enabled_values.yaml' \
--namespace nextcloud \
--skip-clean-up

steps:
- name: Checkout
Expand Down Expand Up @@ -152,7 +155,7 @@ jobs:
kubectl logs -l app.kubernetes.io/name=nextcloud

summary:
runs-on: ubuntu-latest-low
runs-on: ubuntu-latest
needs: [changes, test]
if: always()
steps:
Expand Down
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 5.5.1
version: 5.5.2
appVersion: 29.0.4
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
8 changes: 8 additions & 0 deletions charts/nextcloud/test_values/hpa_enabled_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
hpa:
enabled: true
# have the default deployment use two pods
minPods: 2
# allow up to 3 pods if cpu utilization is above 75%
maxPods: 3
# cpu utilization before scaling pods
targetCPUUtilizationPercentage: 75
7 changes: 7 additions & 0 deletions charts/nextcloud/test_values/nginx_enabled_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# use fpm image because we're using nginx
image:
flavor: fpm

nginx:
# enable nginx container in nextcloud pod
enabled: true
16 changes: 16 additions & 0 deletions charts/nextcloud/test_values/postgresql_enabled_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# disable default internal database, SQLite
internalDatabase:
enabled: false

externalDatabase:
enabled: True
type: postgresql
password: testing123456

# enable PostgreSQL as the database for Nextcloud
postgresql:
enabled: true
global:
postgresql:
auth:
password: testing123456
31 changes: 31 additions & 0 deletions charts/nextcloud/test_values/s3_enabled_values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# We override the names of every resource to have a predictable service name to query
fullnameOverride: nextcloud

# use fpm image because we're using nginx
image:
flavor: fpm

nextcloud:
host: nextcloud
# avoid any issues with domain not trusted during test
trustedDomains:
- '*'
objectStore:
s3:
enabled: true
# minio credentials are passed into the minio helm chart in the previous ci step
accessKey: nextcloud
secretKey: rootpass123
host: minio.nextcloud.svc.cluster.local
# default minio port
port: 9000
# don't use TLS during testing
ssl: false
# nextcloud auto-creates this bucket
bucket: nextcloud
# need to this to not use bucket URL like bucket.s3host.com and instead use s3host.com/bucket
usePathStyle: true

# enable nginx, because apache doesn't seem to work with these values
nginx:
enabled: true
1 change: 0 additions & 1 deletion charts/nextcloud/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
## Official nextcloud image version
## ref: https://hub.docker.com/r/library/nextcloud/tags/
##
image:
repository: nextcloud
flavor: apache
Expand Down
Loading