diff --git a/README.md b/README.md index 3f61881..073aabd 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,8 @@ export TOKEN_URL=http://vaas/auth/protocol/openid-connect/token | `mini-identity-provider.nodeSelector` | mini-identity-provider Node labels for pod assignment | `{}` | | `tolerations` | Tolerations for pods | `[]` | | `affinity` | Affinity settings for pods | `{}` | - +| `gateway.terminationGracePeriodSeconds` | Max time in seconds for scans to complete | `30` | +| `gdscan.terminationGracePeriodSeconds` | Max time in seconds for scans to complete. Set to same value as ```gateway.terminationGracePeriodSeconds``` | `30` | ### Production environment diff --git a/charts/vaas/Chart.yaml b/charts/vaas/Chart.yaml index d340ee1..3c19fc0 100644 --- a/charts/vaas/Chart.yaml +++ b/charts/vaas/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: vaas -version: 1.1.0 +version: 1.2.0 description: Deployment of a Verdict-as-a-Service on-premise instance maintainers: - name: G DATA CyberDefense AG diff --git a/charts/vaas/templates/gateway/_helpers.tpl b/charts/vaas/templates/gateway/_helpers.tpl index 231af8e..ed1de22 100644 --- a/charts/vaas/templates/gateway/_helpers.tpl +++ b/charts/vaas/templates/gateway/_helpers.tpl @@ -60,3 +60,12 @@ app.kubernetes.io/name: {{ include "gateway.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/namespace: {{ .Release.Namespace }} {{- end }} + +{{- define "common.secondsToHHMMSS" -}} +{{- $totalSeconds := . -}} +{{- $hours := div $totalSeconds 3600 | printf "%02d" -}} +{{- $totalSeconds = mod $totalSeconds 3600 -}} +{{- $minutes := div $totalSeconds 60 | printf "%02d" -}} +{{- $seconds := mod $totalSeconds 60 | printf "%02d" -}} +{{- printf "%s:%s:%s" $hours $minutes $seconds -}} +{{- end -}} diff --git a/charts/vaas/templates/gateway/statefulset.yaml b/charts/vaas/templates/gateway/statefulset.yaml index ca00e73..422c1d6 100644 --- a/charts/vaas/templates/gateway/statefulset.yaml +++ b/charts/vaas/templates/gateway/statefulset.yaml @@ -70,6 +70,8 @@ spec: value: {{ .Release.Name }} - name: Sentry__Environment value: {{ .Release.Name }} + - name: HostOptions__ShutdownTimeout + value: {{ include "common.secondsToHHMMSS" .Values.gateway.terminationGracePeriodSeconds | quote }} ports: - name: http containerPort: {{ .Values.gateway.service.http.port }} diff --git a/charts/vaas/values.yaml b/charts/vaas/values.yaml index dadc745..aa7871c 100644 --- a/charts/vaas/values.yaml +++ b/charts/vaas/values.yaml @@ -129,6 +129,8 @@ gateway: clientsecret: value: "" + terminationGracePeriodSeconds: 30 + podAnnotations: {} nodeSelector: {} tolerations: [] @@ -145,7 +147,6 @@ gateway: enabled: false gdscanUrl: "http://gdscan:8080/scan/body" - gdscan: replicaCount: 1 deploymentStrategy: "Recreate"