Skip to content

Commit e7375a7

Browse files
committed
chore(charts): change resources format
1 parent ab96f3c commit e7375a7

4 files changed

Lines changed: 22 additions & 18 deletions

File tree

charts/helmbroker/templates/_helpers.tpl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,6 @@ env:
2828
{{- end }}
2929
{{- end }}
3030

31-
{{/* Generate helmbroker deployment limits */}}
32-
{{- define "helmbroker.limits" -}}
33-
{{- if or (.Values.limitsCpu) (.Values.limitsMemory) }}
34-
resources:
35-
limits:
36-
{{- if (.Values.limitsCpu) }}
37-
cpu: {{.Values.limitsCpu}}
38-
{{- end }}
39-
{{- if (.Values.limitsMemory) }}
40-
memory: {{.Values.limitsMemory}}
41-
{{- end }}
42-
{{- end }}
43-
{{- end }}
44-
4531
{{/* Generate helmbroker deployment volumeMounts */}}
4632
{{- define "helmbroker.volumeMounts" }}
4733
volumeMounts:

charts/helmbroker/templates/helmbroker-celery-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ spec:
4949
- -c
5050
- celery --app helmbroker worker --queues helmbroker.low,helmbroker.middle,helmbroker.high --autoscale=32,1 --loglevel=WARNING
5151
{{- end }}
52-
{{- include "helmbroker.limits" $ | indent 8 }}
52+
{{- with index .Values "celery" "resources" }}
53+
resources:
54+
{{- toYaml . | nindent 10 }}
55+
{{- end }}
5356
{{- include "helmbroker.envs" $ | indent 8 }}
5457
{{- include "helmbroker.volumeMounts" $ | indent 8 }}
5558
{{- include "helmbroker.volumes" . | indent 6 }}

charts/helmbroker/templates/helmbroker-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,10 @@ spec:
7171
ports:
7272
- containerPort: 8000
7373
name: http
74-
{{- include "helmbroker.limits" . | indent 8 }}
74+
{{- with index .Values "api" "resources" }}
75+
resources:
76+
{{- toYaml . | nindent 10 }}
77+
{{- end }}
7578
{{- include "helmbroker.envs" . | indent 8 }}
7679
{{- include "helmbroker.volumeMounts" . | indent 8 }}
7780
{{- include "helmbroker.volumes" . | indent 6 }}

charts/helmbroker/values.yaml

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ imageTag: "canary"
33
imageRegistry: "registry.drycc.cc"
44
imagePullPolicy: "Always"
55
replicas: 1
6-
# limitsCpu: "100m"
7-
# limitsMemory: "50Mi"
86

97
## Enable diagnostic mode
108
##
@@ -44,6 +42,13 @@ environment:
4442
# HELMBROKER_CONFIG_ROOT: /etc/helmbroker
4543

4644
api:
45+
resources: {}
46+
# limits:
47+
# cpu: 200m
48+
# memory: 50Mi
49+
# requests:
50+
# cpu: 100m
51+
# memory: 30Mi
4752
nodeAffinityPreset:
4853
key: "drycc.cc/node"
4954
type: "soft"
@@ -59,6 +64,13 @@ api:
5964
app: "drycc-helmbroker"
6065

6166
celery:
67+
resources: {}
68+
# limits:
69+
# cpu: 200m
70+
# memory: 50Mi
71+
# requests:
72+
# cpu: 100m
73+
# memory: 30Mi
6274
nodeAffinityPreset:
6375
key: "drycc.cc/node"
6476
type: "soft"

0 commit comments

Comments
 (0)