Skip to content

Commit 74449a6

Browse files
committed
feat(charts): add resource requests to chart
This change allows router resource requests to be specified in addition to the existing limits templates, allowing for easy use with a horizontal pod autoscaler.
1 parent 55a38f6 commit 74449a6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

charts/router/templates/router-deployment.yaml

+13-1
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,28 @@ spec:
3232
- name: deis-router
3333
image: quay.io/{{.Values.org}}/router:{{.Values.docker_tag}}
3434
imagePullPolicy: {{.Values.pull_policy}}
35-
{{- if or (.Values.limits_cpu) (.Values.limits_memory)}}
35+
{{- if or (.Values.limits_cpu) (.Values.limits_memory) (.Values.requests_cpu) (.Values.requests_memory)}}
3636
resources:
37+
{{- if or (.Values.limits_cpu) (.Values.limits_memory)}}
3738
limits:
3839
{{- if (.Values.limits_cpu) }}
3940
cpu: {{.Values.limits_cpu}}
4041
{{- end}}
4142
{{- if (.Values.limits_memory) }}
4243
memory: {{.Values.limits_memory}}
4344
{{- end}}
45+
{{- end}} {{/* end limits section */}}
46+
{{- if or (.Values.requests_cpu) (.Values.requests_memory)}}
47+
requests:
48+
{{- if (.Values.requests_cpu) }}
49+
cpu: {{.Values.requests_cpu}}
50+
{{- end}}
51+
{{- if (.Values.requests_memory) }}
52+
memory: {{.Values.requests_memory}}
4453
{{- end}}
54+
{{- end}} {{/* end requests section */}}
55+
{{- end}} {{/* end resources section */}}
56+
4557
env:
4658
- name: POD_NAMESPACE
4759
valueFrom:

charts/router/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ platform_domain: ""
55
dhparam: ""
66
# limits_cpu: "100m"
77
# limits_memory: "50Mi"
8+
# requests_cpu: "100m"
9+
# requests_memory: "50Mi"
810

911
# Any custom router annotations(https://github.com/deis/router#annotations)
1012
# which need to be applied can be specified as key-value pairs under "deployment_annotations"

0 commit comments

Comments
 (0)