Add helm tests for applications

This commit is contained in:
M. Rehan
2022-03-22 00:43:31 +05:00
parent 4567145db1
commit acf55a6397
201 changed files with 241 additions and 117 deletions

View File

@@ -19,4 +19,4 @@ sources:
- https://github.com/nextcloud/docker
- https://github.com/nextcloud/helm
upstream_version: 2.3.2
version: 1.3.13
version: 1.4.0

View File

@@ -7,3 +7,4 @@ nginx:
pullPolicy: IfNotPresent
repository: nginx
tag: 1.21.3
useServiceNameForHost: false

View File

@@ -40,7 +40,11 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
{{ $envList = mustAppend $envList (dict "name" "OVERWRITEPROTOCOL" "value" "https") }}
{{ $envList = mustAppend $envList (dict "name" "TRUSTED_PROXIES" "value" "127.0.0.1") }}
{{ end }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_TRUSTED_DOMAINS" "value" .Values.nextcloud.host) }}
{{ $hostName := .Values.nextcloud.host }}
{{ if .Values.useServiceNameForHost }}
{{ $hostName = (include "common.names.fullname" .) }}
{{ end }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_TRUSTED_DOMAINS" "value" $hostName) }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-username") }}
{{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-password") }}
{{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}

View File

@@ -0,0 +1,21 @@
{{- $serviceName := (include "common.names.fullname" .) -}}
apiVersion: v1
kind: Pod
metadata:
name: "{{ .Release.Name }}-nextcloud-test"
labels:
app: {{ .Release.Name }}
release: {{ .Release.Name }}
annotations:
"helm.sh/hook": test
spec:
containers:
- name: test-curl
image: alpine/curl
imagePullPolicy: "IfNotPresent"
command:
- /bin/sh
- -ec
- |
curl --connect-timeout 5 --max-time 10 --retry 5 --retry-delay 15 --retry-max-time 90 --retry-all-errors -ksf http://{{ $serviceName }}/login
restartPolicy: Never

View File

@@ -38,3 +38,4 @@ postgresql:
service:
nodePort: 31000
updateStrategy: Recreate
useServiceNameForHost: true