Skip to content

Commit

Permalink
Merge pull request #43 from GDATASoftwareAG/grace_period
Browse files Browse the repository at this point in the history
Grace period
  • Loading branch information
pstadermann authored Feb 27, 2024
2 parents bdccd23 + b0c37c1 commit fb2c60f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ helm upgrade gdscan gdscan/gdscan -f values.yaml

# Options

| Name | Description | Value |
| ---------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `service.type` | service type | `ClusterIP` |
| `service.ports.api` | API service port | `8080` |
| `service.annotations` | service annotations | `{}` |
| `replicaCount` | number of pods | `1` |
| `autoscaling.enabled` | enable auto scaling | `false` |
| `autoscaling.maxReplicas` | maximum number of replicas | `20` |
| `autoscaling.metrics` | custom metrics for auto scaling | |
| Name | Description | Value |
| ------------------------------- | --------------------------------------------------------------------------------------------------------------------- | ------------------------ |
| `service.type` | service type | `ClusterIP` |
| `service.ports.api` | API service port | `8080` |
| `service.annotations` | service annotations | `{}` |
| `replicaCount` | number of pods | `1` |
| `autoscaling.enabled` | enable auto scaling | `false` |
| `autoscaling.maxReplicas` | maximum number of replicas | `20` |
| `autoscaling.metrics` | custom metrics for auto scaling | |
| `terminationGracePeriodSeconds` | max time in seconds for scans to complete | `30` |
2 changes: 1 addition & 1 deletion charts/gdscan/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ maintainers:
- name: G DATA CyberDefense AG
email: [email protected]
type: application
version: 1.6.0
version: 1.7.0
9 changes: 9 additions & 0 deletions charts/gdscan/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,12 @@ app.kubernetes.io/namespace: {{ .Release.Namespace }}
{{- end -}}

{{- 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 -}}
3 changes: 3 additions & 0 deletions charts/gdscan/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ spec:
port: api
initialDelaySeconds: 15
periodSeconds: 5
env:
- name: HostOptions__ShutdownTimeout
value: {{ include "common.secondsToHHMMSS" .Values.terminationGracePeriodSeconds | quote }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down
3 changes: 3 additions & 0 deletions charts/gdscan/templates/stateful-set.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ spec:
port: api
initialDelaySeconds: 15
periodSeconds: 5
env:
- name: HostOptions__ShutdownTimeout
value: {{ include "common.secondsToHHMMSS" .Values.terminationGracePeriodSeconds | quote }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- with .Values.nodeSelector }}
nodeSelector:
Expand Down

0 comments on commit fb2c60f

Please sign in to comment.