Skip to content

Commit cff1e92

Browse files
committed
chore(charts): add diagnostic mode
1 parent 5d2787d commit cff1e92

3 files changed

Lines changed: 27 additions & 0 deletions

File tree

charts/registry/templates/registry-cronjob-daily.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,16 @@ spec:
3232
- image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/registry:{{.Values.imageTag}}
3333
imagePullPolicy: {{.Values.imagePullPolicy}}
3434
name: drycc-registry-garbage-collect
35+
{{- if .Values.diagnosticMode.enabled }}
36+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 14 }}
37+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 14 }}
38+
{{- else }}
3539
args:
3640
- /bin/boot
3741
- garbage-collect
3842
- $(DRYCC_REGISTRY_CONFIG)
3943
- --dry-run
4044
- --delete-untagged
45+
{{- end }}
4146
{{- include "builder.envs" . | indent 12 }}
4247
{{- end }}

charts/registry/templates/registry-deployment.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,13 @@ spec:
4141
- name: drycc-registry
4242
image: {{.Values.imageRegistry}}/{{.Values.imageOrg}}/registry:{{.Values.imageTag}}
4343
imagePullPolicy: {{.Values.imagePullPolicy}}
44+
{{- if .Values.diagnosticMode.enabled }}
45+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 10 }}
46+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 10 }}
47+
{{- end }}
4448
{{- include "registry.limits" . | indent 8 }}
4549
{{- include "registry.envs" . | indent 8 }}
50+
{{- if not .Values.diagnosticMode.enabled }}
4651
startupProbe:
4752
tcpSocket:
4853
port: 5000
@@ -69,6 +74,7 @@ spec:
6974
timeoutSeconds: 1
7075
successThreshold: 1
7176
failureThreshold: 5
77+
{{- end }}
7278
ports:
7379
- containerPort: 5000
7480
name: http

charts/registry/values.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,22 @@ imageTag: "canary"
44
imageRegistry: "registry.drycc.cc"
55
# limitsCpu: "100m"
66
# limitsMemory: "50Mi"
7+
8+
## Enable diagnostic mode
9+
##
10+
diagnosticMode:
11+
## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden)
12+
##
13+
enabled: false
14+
## @param diagnosticMode.command Command to override all containers
15+
##
16+
command:
17+
- sleep
18+
## @param diagnosticMode.args Args to override all containers
19+
##
20+
args:
21+
- infinity
22+
723
nodeAffinityPreset:
824
key: "drycc.cc/node"
925
type: "soft"

0 commit comments

Comments
 (0)