Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grace peroid for scan node updates is configurable #3 #22

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,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
Loading