Skip to content

Commit ffe45f0

Browse files
committed
chore(charts): change resources format
1 parent 17259db commit ffe45f0

5 files changed

Lines changed: 33 additions & 19 deletions

File tree

charts/controller/templates/_helpers.tpl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,6 @@ env:
180180
value: api.routers.DefaultReplicaRouter
181181
{{- end }}
182182

183-
{{/* Generate controller deployment limits */}}
184-
{{- define "controller.limits" -}}
185-
{{- if or (.Values.limitsCpu) (.Values.limitsMemory) }}
186-
resources:
187-
limits:
188-
{{- if (.Values.limitsCpu) }}
189-
cpu: {{.Values.limitsCpu}}
190-
{{- end }}
191-
{{- if (.Values.limitsMemory) }}
192-
memory: {{.Values.limitsMemory}}
193-
{{- end }}
194-
{{- end }}
195-
{{- end }}
196-
197183
{{/* Generate controller config default limit specs */}}
198184
{{ define "controller.config.defaultLimitSpecs" }}
199185
- model: api.limitspec

charts/controller/templates/controller-api-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ spec:
7070
ports:
7171
- containerPort: 8000
7272
name: http
73-
{{- include "controller.limits" . | indent 8 }}
73+
{{- with index .Values "api" "resources" }}
74+
resources:
75+
{{- toYaml . | nindent 10 }}
76+
{{- end }}
7477
{{- include "controller.envs" . | indent 8 }}
7578
volumeMounts:
7679
- name: controller-config

charts/controller/templates/controller-celery-deloyment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ spec:
5151
- -c
5252
- celery --app api worker --queues controller.low,controller.middle,controller.high --autoscale=32,1 --loglevel=WARNING
5353
{{- end }}
54-
{{- include "controller.limits" $ | indent 8 }}
54+
{{- with index .Values "celery" "resources" }}
55+
resources:
56+
{{- toYaml . | nindent 10 }}
57+
{{- end }}
5558
{{- include "controller.envs" $ | indent 8 }}
5659
volumeMounts:
5760
- name: controller-config

charts/controller/templates/controller-mutate-deloyment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,10 @@ spec:
5959
volumeMounts:
6060
- name: controller-mutate-cert
6161
mountPath: /etc/controller/mutate/cert
62-
{{- include "controller.limits" . | indent 8 }}
62+
{{- with index .Values "mutate" "resources" }}
63+
resources:
64+
{{- toYaml . | nindent 10 }}
65+
{{- end }}
6366
{{- include "controller.envs" . | indent 8 }}
6467
volumes:
6568
- name: controller-mutate-cert

charts/controller/values.yaml

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ diagnosticMode:
2020
# See https://www.drycc.cc/managing-workflow/deploy-hooks/
2121
deployHookUrls: ""
2222
timezone: "UTC"
23-
# limitsCpu: "100m"
24-
# limitsMemory: "50Mi"
2523
# Possible values are:
2624
# enabled - allows for open registration
2725
# disabled - turns off open registration
@@ -93,6 +91,13 @@ environment:
9391
RESERVED_NAMES: "drycc, drycc-builder, drycc-grafana, drycc-passport, drycc-helmbroker, drycc-manager"
9492

9593
api:
94+
resources: {}
95+
# limits:
96+
# cpu: 200m
97+
# memory: 50Mi
98+
# requests:
99+
# cpu: 100m
100+
# memory: 30Mi
96101
nodeAffinityPreset:
97102
key: "drycc.cc/node"
98103
type: "soft"
@@ -108,6 +113,13 @@ api:
108113
app: "drycc-controller-api"
109114

110115
celery:
116+
resources: {}
117+
# limits:
118+
# cpu: 200m
119+
# memory: 50Mi
120+
# requests:
121+
# cpu: 100m
122+
# memory: 30Mi
111123
nodeAffinityPreset:
112124
key: "drycc.cc/node"
113125
type: "soft"
@@ -123,6 +135,13 @@ celery:
123135
app: "drycc-controller-celery"
124136

125137
mutate:
138+
resources: {}
139+
# limits:
140+
# cpu: 200m
141+
# memory: 50Mi
142+
# requests:
143+
# cpu: 100m
144+
# memory: 30Mi
126145
nodeAffinityPreset:
127146
key: "drycc.cc/node"
128147
type: "soft"

0 commit comments

Comments
 (0)