Skip to content

Commit

Permalink
Merge pull request #134 from Tricentis/update-session
Browse files Browse the repository at this point in the history
Update Session Helm Chart
  • Loading branch information
byangtri authored Aug 18, 2023
2 parents 147b538 + c8bed2b commit 2ecc7df
Show file tree
Hide file tree
Showing 6 changed files with 137 additions and 42 deletions.
6 changes: 3 additions & 3 deletions Charts/qtest-session/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ maintainers:
email: [email protected]
- name: tomasw
email: [email protected]
home: https://github.com/QAS-Labs/qtest-chart.git
home: https://github.com/Tricentis-qTest/qtest-chart.git
kubeVersion: ">=1.18.0-0"
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.1.6
version: 1.1.7
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "4.3.13"
appVersion: "4.3.17"
12 changes: 11 additions & 1 deletion Charts/qtest-session/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $sslCert := printf "%s/tls.crt" .Values.qTestSession.qTestSessionSSLMountPath -}}
{{- $sslKey := printf "%s/tls.key" .Values.qTestSession.qTestSessionSSLMountPath -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -8,10 +10,10 @@ metadata:
data:
qTestSessionJSHome: "{{ .Values.qTestSession.qTestSessionJSHome }}"
qTestSessionNodeEnvironment: "{{ .Values.qTestSession.qTestSessionNodeEnvironment }}"
qTestSessionPort: "{{ .Values.qTestSession.qTestSessionPort }}"
qTestSessionDBName: "{{ .Values.qTestSession.qTestSessionDBName }}"
qTestSessionDBUserName: "{{ .Values.qTestSession.qTestSessionDBUserName }}"
qTestSessionDBHostName: "{{ .Values.qTestSession.qTestSessionDBHostName }}"
qTestSessionDBPort: "{{ .Values.qTestSession.qTestSessionDBPort }}"
QTestManagerHost: "{{ .Values.qTestSession.qTestManagerHost }}"
qTestSessionMasterToken: "{{ .Values.qTestSession.qTestSessionMasterToken }}"
qTestSessionStorageRootPath: "{{ .Values.qTestSession.qTestSessionStorageRootPath }}"
Expand All @@ -20,3 +22,11 @@ data:
qTestSessionStorageType : "{{ .Values.qTestSession.qTestSessionStorageType }}"
qTestSessionCustomSchemaEnable : "{{ .Values.qTestSession.qTestSessionCustomSchemaEnable }}"
qTestSessionCustomSchemaName : "{{ .Values.qTestSession.qTestSessionCustomSchemaName }}"
qTestSessionIsSSLRequired: "{{ .Values.qTestSession.qTestSessionSSLRequired }}"
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
qTestSessionSSLCert: "{{ $sslCert }}"
qTestSessionSSLKey: "{{ $sslKey }}"
qTestSessionPort: "{{ .Values.service.targetHttpsPort }}"
{{- else }}
qTestSessionPort: "{{ .Values.service.targetPort }}"
{{- end -}}
89 changes: 67 additions & 22 deletions Charts/qtest-session/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ kind: Deployment
metadata:
name: {{ include "qtest-session.fullname" . }}
namespace: {{ .Values.namespace.name }}
{{- with .Values.deployment.annotations }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.deployment.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand All @@ -21,6 +22,11 @@ spec:
app: qtest-session
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: qtest-session
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Expand Down Expand Up @@ -60,26 +66,33 @@ spec:
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: {{ .Values.autoscaling.healthApiPath }}
port: {{ .Values.service.targetPort }}
periodSeconds: {{ .Values.autoscaling.periodSeconds }}
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
{{ .Values.livenessSslProbe | toYaml | indent 12 | trim }}
{{- else }}
{{ .Values.livenessProbe | toYaml | indent 12 | trim }}
{{- end }}
readinessProbe:
httpGet:
path: {{ .Values.autoscaling.healthApiPath }}
port: {{ .Values.service.targetPort }}
periodSeconds: {{ .Values.autoscaling.periodSeconds }}
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
{{ .Values.readinessSslProbe | toYaml | indent 12 | trim }}
{{- else }}
{{ .Values.readinessProbe | toYaml | indent 12 | trim }}
{{- end }}
startupProbe:
httpGet:
path: {{ .Values.autoscaling.healthApiPath }}
port: {{ .Values.service.targetPort }}
failureThreshold: {{ .Values.autoscaling.failureThreshold }}
periodSeconds: {{ .Values.autoscaling.periodSeconds }}
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
{{ .Values.startupSslProbe | toYaml | indent 12 | trim }}
{{- else }}
{{ .Values.startupProbe | toYaml | indent 12 | trim }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
- containerPort: {{ .Values.service.targetHttpsPort }}
name: https
{{- else }}
- containerPort: {{ .Values.service.targetPort }}
name: http
{{- end }}
env:
- name: SESSION_JS_HOME
valueFrom:
Expand Down Expand Up @@ -116,6 +129,11 @@ spec:
configMapKeyRef:
name: qtest-session-configmap
key: qTestSessionDBHostName
- name: DB_PORT
valueFrom:
configMapKeyRef:
name: qtest-session-configmap
key: qTestSessionDBPort
{{- if .Values.qTestSession.qTestSessionCustomSchemaEnable }}
- name: DATABASE_SCHEMA_SESSION
valueFrom:
Expand All @@ -125,29 +143,29 @@ spec:
{{- end }}
- name: DB_CONNECTION
{{- if and (.Values.qTestSession.qTestSessionDBSSLEnable) (.Values.qTestSession.qTestSessionCustomSchemaEnable) }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)%s" .Values.qTestSession.qTestSessionDBSSL }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)%s" .Values.qTestSession.qTestSessionDBSSL }}
{{- end }}
{{- if and (.Values.qTestSession.qTestSessionDBSSLEnable) (not .Values.qTestSession.qTestSessionCustomSchemaEnable) }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)%s" .Values.qTestSession.qTestSessionDBSSL }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)%s" .Values.qTestSession.qTestSessionDBSSL }}
{{- end }}
{{- if and (not .Values.qTestSession.qTestSessionDBSSLEnable) (.Values.qTestSession.qTestSessionCustomSchemaEnable) }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)" }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)" }}
{{- end }}
{{- if and (not .Values.qTestSession.qTestSessionDBSSLEnable) (not .Values.qTestSession.qTestSessionCustomSchemaEnable)}}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)" }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)" }}
{{- end }}
- name: DATABASE_URL
{{- if and (.Values.qTestSession.qTestSessionDBSSLEnable) (.Values.qTestSession.qTestSessionCustomSchemaEnable) }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)%s" .Values.qTestSession.qTestSessionDBSSL }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)%s" .Values.qTestSession.qTestSessionDBSSL }}
{{- end }}
{{- if and (.Values.qTestSession.qTestSessionDBSSLEnable) (not .Values.qTestSession.qTestSessionCustomSchemaEnable) }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)%s" .Values.qTestSession.qTestSessionDBSSL }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)%s" .Values.qTestSession.qTestSessionDBSSL }}
{{- end }}
{{- if and (not .Values.qTestSession.qTestSessionDBSSLEnable) (.Values.qTestSession.qTestSessionCustomSchemaEnable) }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)" }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)?schema=$(DATABASE_SCHEMA_SESSION)" }}
{{- end }}
{{- if and (not .Values.qTestSession.qTestSessionDBSSLEnable) (not .Values.qTestSession.qTestSessionCustomSchemaEnable)}}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST)/$(DB_NAME)" }}
value: {{ printf "postgresql://$(DB_USER):$(DB_PASS)@$(DB_HOST):$(DB_PORT)/$(DB_NAME)" }}
{{- end }}
- name: QTEST_HOST
valueFrom:
Expand Down Expand Up @@ -184,6 +202,23 @@ spec:
secretKeyRef:
name: {{ .Values.secrets.name }}
key: {{ .Values.secrets.sessionsSecretKey }}
- name: SSL_ENABLED
valueFrom:
configMapKeyRef:
name: qtest-session-configmap
key: qTestSessionIsSSLRequired
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
- name: SSL_CERT
valueFrom:
configMapKeyRef:
name: qtest-session-configmap
key: qTestSessionSSLCert
- name: SSL_KEY
valueFrom:
configMapKeyRef:
name: qtest-session-configmap
key: qTestSessionSSLKey
{{- end -}}
{{- with .Values.extraEnv }}
{{ toYaml . | indent 12 }}
{{- end }}
Expand All @@ -195,6 +230,11 @@ spec:
mountPath: {{ .Values.qTestSession.qTestSessionDBSSLMountPath }}
readOnly: true
{{- end }}
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
- name: qtest-session-secret-ssl-volume
mountPath: {{ .Values.qTestSession.qTestSessionSSLMountPath }}
readOnly: true
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{ toYaml . | indent 10 }}
{{- end }}
Expand Down Expand Up @@ -224,6 +264,11 @@ spec:
secret:
secretName: qtest-db-root-secret
{{- end -}}
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
- name: qtest-session-secret-ssl-volume
secret:
secretName: qtest-ssl-root-secret
{{- end }}
{{- with .Values.extraVolumes }}
{{ toYaml . | indent 8 }}
{{- end }}
13 changes: 0 additions & 13 deletions Charts/qtest-session/templates/qtest-session-sa.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions Charts/qtest-session/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,16 @@ metadata:
heritage: "{{ .Release.Service }}"
spec:
ports:
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
- name: https
protocol: TCP
port: {{ .Values.service.targetHttpsPort }}
targetPort: {{ .Values.service.targetHttpsPort }}
{{- else }}
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
{{- end }}
selector:
app: qtest-session
release: {{ .Release.Name }}
Expand All @@ -31,9 +38,16 @@ metadata:
heritage: "{{ .Release.Service }}"
spec:
ports:
{{- if .Values.qTestSession.qTestSessionSSLRequired }}
- name: https
protocol: TCP
port: {{ .Values.service.targetHttpsPort }}
targetPort: {{ .Values.service.targetHttpsPort }}
{{- else }}
- protocol: TCP
port: {{ .Values.service.port }}
targetPort: {{ .Values.service.targetPort }}
{{- end }}
selector:
app: qtest-session
release: {{ .Release.Name }}
Expand Down
45 changes: 42 additions & 3 deletions Charts/qtest-session/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ secrets:
image:
repository: qasymphony/sessions
pullPolicy: IfNotPresent
tag: "4.3.13"
tag: "4.3.17"
imageCredentials:
enabled: false
# name: ""
Expand All @@ -20,6 +20,7 @@ imageCredentials:
# existingImageCredentials: ""
deployment:
annotations: {}
podAnnotations: {}
rollouts:
enabled: false
ingressClassName: alb
Expand Down Expand Up @@ -50,6 +51,7 @@ service:
type: LoadBalancer
port: 8080
targetPort: 8080
targetHttpsPort: 8443
serviceName: qtest-session-service
extraInitContainers: []
extraContainers: []
Expand All @@ -60,10 +62,10 @@ extraVolumes: []
qTestSession:
qTestSessionJSHome: /usr/local/sessions-js
qTestSessionNodeEnvironment: production
qTestSessionPort: "8080"
qTestSessionDBName: sessions
qTestSessionDBUserName: postgres
qTestSessionDBHostName: host.docker.internal
qTestSessionDBPort: "5432"
qTestManagerHost: https://nephele.qtest.local
qTestSessionMasterToken: Qtoy
qTestSessionStorageRootPath: /data
Expand All @@ -72,7 +74,9 @@ qTestSession:
qTestSessionClamavURL: http://clam.qtest.local
qTestSessionStorageType: amazon_s3
qTestSessionDBSSLEnable: false
qTestSessionDBSSLMountPath: ""
qTestSessionSSLRequired: false
qTestSessionSSLMountPath: "/mnt/secrets/tls"
qTestSessionDBSSLMountPath: "/etc/ssl"
qTestSessionDBSSL: ""
qTestSessionDBCRT: ""
qTestSessionCustomSchemaEnable: false
Expand Down Expand Up @@ -158,3 +162,38 @@ limitRange:
enabled: false
resourceQuota:
enabled: false
livenessProbe:
httpGet:
path: /health-check
port: 8080
periodSeconds: 30
livenessSslProbe:
httpGet:
path: /health-check
scheme: HTTPS
port: 8443
periodSeconds: 30
readinessProbe:
httpGet:
path: /health-check
port: 8080
periodSeconds: 30
readinessSslProbe:
httpGet:
path: /health-check
scheme: HTTPS
port: 8443
periodSeconds: 30
startupProbe:
httpGet:
path: /health-check
port: 8080
failureThreshold: 4
periodSeconds: 30
startupSslProbe:
httpGet:
path: /health-check
scheme: HTTPS
port: 8443
failureThreshold: 4
periodSeconds: 30

0 comments on commit 2ecc7df

Please sign in to comment.