Skip to content

Commit 729cdc2

Browse files
committed
chore(charts): add diagnostic mode
1 parent ab75e3c commit 729cdc2

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

charts/database/templates/database-statefulset.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,18 @@ spec:
2929
- name: drycc-database
3030
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/database:{{.Values.imageTag}}
3131
imagePullPolicy: {{.Values.imagePullPolicy}}
32+
{{- if .Values.diagnosticMode.enabled }}
33+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 10 }}
34+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 10 }}
35+
{{- end }}
3236
ports:
3337
- containerPort: 8008
3438
protocol: TCP
3539
- containerPort: 5432
3640
protocol: TCP
3741
{{- include "database.limits" . | indent 8 }}
3842
{{- include "database.envs" . | indent 8 }}
43+
{{- if not .Values.diagnosticMode.enabled }}
3944
lifecycle:
4045
preStop:
4146
exec:
@@ -67,6 +72,7 @@ spec:
6772
initialDelaySeconds: 10
6873
timeoutSeconds: 5
6974
failureThreshold: 3
75+
{{- end }}
7076
volumeMounts:
7177
- name: database-data
7278
mountPath: /data

charts/database/values.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ imageRegistry: "registry.drycc.cc"
99

1010
replicas: 3
1111

12+
## Enable diagnostic mode
13+
##
14+
diagnosticMode:
15+
## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden)
16+
##
17+
enabled: false
18+
## @param diagnosticMode.command Command to override all containers
19+
##
20+
command:
21+
- sleep
22+
## @param diagnosticMode.args Args to override all containers
23+
##
24+
args:
25+
- infinity
26+
1227
nodeAffinityPreset:
1328
key: "drycc.cc/node"
1429
type: "soft"

0 commit comments

Comments
 (0)