Skip to content

Commit

Permalink
Update from Tricentis-qTest/qtest-chart
Browse files Browse the repository at this point in the history
  • Loading branch information
byangtri committed Sep 21, 2023
1 parent c9e7304 commit 19148ff
Show file tree
Hide file tree
Showing 6 changed files with 185 additions and 30 deletions.
4 changes: 2 additions & 2 deletions Charts/qtest-pulse/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ 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.0.9
version: 1.0.10
# 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: "9.3.10"
appVersion: "2023.5.0"
14 changes: 12 additions & 2 deletions Charts/qtest-pulse/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- $sslCert := printf "%s/tls.crt" .Values.qTestPulse.qTestPulseSSLMountPath -}}
{{- $sslKey := printf "%s/tls.key" .Values.qTestPulse.qTestPulseSSLMountPath -}}
apiVersion: v1
kind: ConfigMap
metadata:
Expand All @@ -9,12 +11,20 @@ data:
qTestPulseDBName: "{{ .Values.qTestPulse.qTestPulseDBName }}"
qTestPulseDBUserName: "{{ .Values.qTestPulse.qTestPulseDBUserName }}"
qTestPulseDBHostName: "{{ .Values.qTestPulse.qTestPulseDBHostName }}"
qTestPulseDBPort: "{{ .Values.qTestPulse.qTestPulseDBPort }}"
qTestPulseRootURL: "{{ .Values.qTestPulse.qTestPulseRootURL }}"
qTestPulseQTestURL: "{{ .Values.qTestPulse.qTestPulseQTestURL }}"
qTestPulseScenarioURL: "{{ .Values.qTestPulse.qTestPulseScenarioURL }}"
qTestPulseNodeTLSRejectUnAuthorized: "{{ .Values.qTestPulse.qTestPulseNodeTLSRejectUnAuthorized }}"
qTestPulsePort: "{{ .Values.qTestPulse.qTestPulsePort }}"
qTestPulseNodeEnv: "{{ .Values.qTestPulse.qTestPulseNodeEnv }}"
qTestPulseType: "{{ .Values.qTestPulse.qTestPulseType }}"
qtestPulseExecutorUrl: "{{ .Values.qTestPulse.qtestPulseExecutorUrl }}"
swaggerUrl: "{{ .Values.qTestPulse.swaggerUrl }}"
swaggerUrl: "{{ .Values.qTestPulse.swaggerUrl }}"
qTestPulseIsSSLRequired: "{{ .Values.qTestPulse.qTestPulseSSLRequired }}"
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
qTestPulseSSLCert: "{{ $sslCert }}"
qTestPulseSSLKey: "{{ $sslKey }}"
qTestPulsePort: "{{ .Values.service.targetHttpsPort }}"
{{- else }}
qTestPulsePort: "{{ .Values.service.targetPort }}"
{{- end -}}
102 changes: 79 additions & 23 deletions Charts/qtest-pulse/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ spec:
app: qtest-pulse
template:
metadata:
annotations:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
app: qtest-pulse
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
Expand Down Expand Up @@ -59,26 +64,33 @@ spec:
{{- end }}
{{- end }}
livenessProbe:
httpGet:
path: {{ .Values.autoscaling.healthApiPath }}
port: {{ .Values.service.targetPort }}
periodSeconds: {{ .Values.autoscaling.periodSeconds }}
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
{{ .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.qTestPulse.qTestPulseSSLRequired }}
{{ .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.qTestPulse.qTestPulseSSLRequired }}
{{ .Values.startupSslProbe | toYaml | indent 12 | trim }}
{{- else }}
{{ .Values.startupProbe | toYaml | indent 12 | trim }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
ports:
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
- containerPort: {{ .Values.service.targetHttpsPort }}
name: https
{{- else }}
- containerPort: {{ .Values.service.targetPort }}
name: http
{{- end }}
env:
- name: NODE_ENV
valueFrom:
Expand All @@ -105,12 +117,17 @@ spec:
configMapKeyRef:
name: {{ include "qtest-pulse.fullname" . }}-configmap
key: qTestPulseDBHostName
- name: PULSE_DB_PORT
valueFrom:
configMapKeyRef:
name: {{ include "qtest-pulse.fullname" . }}-configmap
key: qTestPulseDBPort
- name: PG_URL
{{- if .Values.qTestPulse.qTestPulseDBSSLEnable }}
value: {{ printf "postgresql://$(PULSE_DB_USERNAME):$(PULSE_DB_PWD)@$(PULSE_DB_HOSTNAME)/$(PULSE_DB_NAME)%s" .Values.qTestPulse.qTestPulseDBSSL }}
value: {{ printf "postgresql://$(PULSE_DB_USERNAME):$(PULSE_DB_PWD)@$(PULSE_DB_HOSTNAME):$(PULSE_DB_PORT)/$(PULSE_DB_NAME)%s" .Values.qTestPulse.qTestPulseDBSSL }}
{{- end }}
{{- if not .Values.qTestPulse.qTestPulseDBSSLEnable }}
value: {{ printf "postgresql://$(PULSE_DB_USERNAME):$(PULSE_DB_PWD)@$(PULSE_DB_HOSTNAME)/$(PULSE_DB_NAME)" }}
value: {{ printf "postgresql://$(PULSE_DB_USERNAME):$(PULSE_DB_PWD)@$(PULSE_DB_HOSTNAME):$(PULSE_DB_PORT)/$(PULSE_DB_NAME)" }}
{{- end }}
- name: PORT
valueFrom:
Expand Down Expand Up @@ -152,16 +169,40 @@ spec:
configMapKeyRef:
name: {{ include "qtest-pulse.fullname" . }}-configmap
key: swaggerUrl
- name: SSL_ENABLED
valueFrom:
configMapKeyRef:
name: {{ include "qtest-pulse.fullname" . }}-configmap
key: qTestPulseIsSSLRequired
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
- name: SSL_CERT
valueFrom:
configMapKeyRef:
name: {{ include "qtest-pulse.fullname" . }}-configmap
key: qTestPulseSSLCert
- name: SSL_KEY
valueFrom:
configMapKeyRef:
name: {{ include "qtest-pulse.fullname" . }}-configmap
key: qTestPulseSSLKey
{{- end -}}
{{- with .Values.extraEnv }}
{{ toYaml . | indent 12 }}
{{- end }}
{{- if .Values.qTestPulse.qTestPulseDBSSLEnable }}
volumeMounts:
- name: qtest-pulse-logs
mountPath: /root/.pm2/logs
{{- if .Values.qTestPulse.qTestPulseDBSSLEnable }}
- name: qtest-db-secret-volume
mountPath: {{ .Values.qTestPulse.qTestPulseDBSSLMountPath }}
{{- end }}
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
- name: qtest-pulse-secret-ssl-volume
mountPath: {{ .Values.qTestPulse.qTestPulseSSLMountPath }}
readOnly: true
{{- end }}
{{- with .Values.extraVolumeMounts }}
{{ toYaml . | indent 10 }}
{{- end }}
{{- end }}
{{- if .Values.extraContainers }}
# Currently some extra blocks accept strings
Expand All @@ -173,12 +214,27 @@ spec:
{{ toYaml .Values.extraContainers | indent 8 }}
{{- end }}
{{- end }}
{{- if .Values.qTestPulse.qTestPulseDBSSLEnable }}
volumes:
- name: qtest-db-secret-volume
secret:
secretName: qtest-db-root-secret
- name: qtest-pulse-logs
{{- if .Values.persistence.existingClaim }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim }}
{{- else if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ template "qtest-pulse.fullname" . }}
{{- else }}
emptyDir: {}
{{- end }}
{{- if .Values.qTestPulse.qTestPulseDBSSLEnable }}
- name: qtest-db-secret-volume
secret:
secretName: qtest-db-root-secret
{{- end }}
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
- name: qtest-pulse-secret-ssl-volume
secret:
secretName: qtest-ssl-root-secret
{{- end }}
{{- with .Values.extraVolumes }}
{{ toYaml . | indent 8 }}
{{ toYaml . | indent 6 }}
{{- end }}
{{- end -}}
25 changes: 25 additions & 0 deletions Charts/qtest-pulse/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "qtest-pulse.fullname" . }}
namespace: {{ .Values.namespace.name }}
labels:
app: qtest-pulse
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
{{ if .Values.persistence.annotations}}
annotations:
{{- range $key, $value := .Values.persistence.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
accessModes:
- {{ .Values.persistence.accessMode | quote }}
resources:
requests:
storage: {{ .Values.persistence.size | quote }}
{{ include "common.storage.class" (dict "persistence" .Values.persistence) }}
{{- end }}
14 changes: 14 additions & 0 deletions Charts/qtest-pulse/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.qTestPulse.qTestPulseSSLRequired }}
- 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-pulse
release: {{ .Release.Name }}
Expand All @@ -31,9 +38,16 @@ metadata:
heritage: "{{ .Release.Service }}"
spec:
ports:
{{- if .Values.qTestPulse.qTestPulseSSLRequired }}
- 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-pulse
release: {{ .Release.Name }}
Expand Down
56 changes: 53 additions & 3 deletions Charts/qtest-pulse/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ secrets:
image:
repository: qasymphony/pulse
pullPolicy: IfNotPresent
tag: "9.3.10"
tag: "2023.5.0"
imageCredentials:
enabled: false
# name: ""
Expand All @@ -26,6 +26,7 @@ serviceAccount:
name: "qtest-pulse-sa"
deployment:
annotations: {}
podAnnotations: {}
rollouts:
enabled: false
ingressClassName: alb
Expand All @@ -48,6 +49,7 @@ service:
type: LoadBalancer
port: 4080
targetPort: 4080
targetHttpsPort: 4443
serviceName: qtest-pulse-service
extraInitContainers: []
extraContainers: []
Expand All @@ -59,14 +61,16 @@ qTestPulse:
qTestPulseDBName: pulse
qTestPulseDBUserName: postgres
qTestPulseDBHostName: host.docker.internal
qTestPulsePort: "4080"
qTestPulseDBPort: "5432"
qTestPulseNodeEnv: production
qTestPulseRootURL: https://pulse.qtest.local
qTestPulseQTestURL: https://nephele.qtest.local
qTestPulseScenarioURL: https://scenario.local
qTestPulseNodeTLSRejectUnAuthorized: "0"
qTestPulseDBSSLEnable: false
qTestPulseDBSSLMountPath: ""
qTestPulseSSLRequired: false
qTestPulseSSLMountPath: "/mnt/secrets/tls"
qTestPulseDBSSLMountPath: "/etc/ssl"
qTestPulseDBSSL: ""
qTestPulseDBCRT: ""
qTestPulseType: "qtest-pulse"
Expand Down Expand Up @@ -104,6 +108,17 @@ ingress:
# hosts:
# - pulse.qtest.local
https: false
persistence:
enabled: false
## Set annotations on pvc
annotations: {}
storageClass:
accessMode: ReadWriteOnce
size: 5Gi
## Specify extra volumes. Refer to ".spec.volumes" specification : https://kubernetes.io/fr/docs/concepts/storage/volumes/
volumes: []
## Specify extra mounts. Refer to ".spec.containers.volumeMounts" specification : https://kubernetes.io/fr/docs/concepts/storage/volumes/
mounts: []
# VPA values
vpaAutoscaling:
enabled: false
Expand Down Expand Up @@ -134,3 +149,38 @@ limitRange:
enabled: false
resourceQuota:
enabled: false
livenessProbe:
httpGet:
path: /
port: 4080
periodSeconds: 30
livenessSslProbe:
httpGet:
path: /
scheme: HTTPS
port: 4443
periodSeconds: 30
readinessProbe:
httpGet:
path: /
port: 4080
periodSeconds: 30
readinessSslProbe:
httpGet:
path: /
scheme: HTTPS
port: 4443
periodSeconds: 30
startupProbe:
httpGet:
path: /
port: 4080
failureThreshold: 4
periodSeconds: 30
startupSslProbe:
httpGet:
path: /
scheme: HTTPS
port: 4443
failureThreshold: 4
periodSeconds: 30

0 comments on commit 19148ff

Please sign in to comment.