Skip to content

Commit

Permalink
Merge pull request #22 from GDATASoftwareAG/termination_grace_period
Browse files Browse the repository at this point in the history
Grace peroid for scan node updates is configurable #3
  • Loading branch information
lennartdohmann authored Mar 11, 2024
2 parents b2416a5 + f47443f commit da17940
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion charts/vaas/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions charts/vaas/templates/gateway/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
2 changes: 2 additions & 0 deletions charts/vaas/templates/gateway/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/vaas/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ gateway:
clientsecret:
value: ""

terminationGracePeriodSeconds: 30

podAnnotations: {}
nodeSelector: {}
tolerations: []
Expand All @@ -145,7 +147,6 @@ gateway:
enabled: false
gdscanUrl: "http://gdscan:8080/scan/body"


gdscan:
replicaCount: 1
deploymentStrategy: "Recreate"
Expand Down

0 comments on commit da17940

Please sign in to comment.