Skip to content

Commit beef8ab

Browse files
committed
chore(charts): change resources format
1 parent 0883f1e commit beef8ab

4 files changed

Lines changed: 35 additions & 35 deletions

File tree

charts/registry/templates/_helper.tpl

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,3 @@ env:
6969
key: secretkey
7070
{{- end }}
7171
{{- end }}
72-
73-
{{/* Generate registry deployment limits */}}
74-
{{- define "registry.limits" -}}
75-
{{- if or (.Values.limitsCpu) (.Values.limitsMemory)}}
76-
resources:
77-
limits:
78-
{{- if (.Values.limitsCpu) }}
79-
cpu: {{.Values.limitsCpu}}
80-
{{- end }}
81-
{{- if (.Values.limitsMemory) }}
82-
memory: {{.Values.limitsMemory}}
83-
{{- end }}
84-
{{- if (.Values.limitsHugepages2Mi) }}
85-
hugepages-2Mi: {{.Values.limitsHugepages2Mi}}
86-
{{- end }}
87-
{{- if (.Values.limitsHugepages1Gi) }}
88-
hugepages-1Gi: {{.Values.limitsHugepages1Gi}}
89-
{{- end }}
90-
{{- end }}
91-
{{- end }}

charts/registry/templates/registry-deployment.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ spec:
4747
args:
4848
- start-registry
4949
{{- end }}
50-
{{- include "registry.limits" . | indent 8 }}
50+
{{- with index .Values "resources" }}
51+
resources:
52+
{{- toYaml . | nindent 10 }}
53+
{{- end }}
5154
{{- include "registry.envs" . | indent 8 }}
5255
{{- if not .Values.diagnosticMode.enabled }}
5356
startupProbe:

charts/registry/templates/registry-proxy-daemonset.yaml

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,10 @@ spec:
4747
args:
4848
- start-proxy
4949
{{- end }}
50-
{{- if or (.Values.limitsCpu) (.Values.limitsMemory)}}
50+
{{- with index .Values "proxy" "resources" }}
5151
resources:
52-
limits:
53-
{{- if (.Values.limitsCpu) }}
54-
cpu: {{.Values.limitsCpu}}
55-
{{- end}}
56-
{{- if (.Values.limitsMemory) }}
57-
memory: {{.Values.limitsMemory}}
58-
{{- end}}
59-
{{- end}}
52+
{{- toYaml . | nindent 10 }}
53+
{{- end }}
6054
{{- if not .Values.diagnosticMode.enabled }}
6155
startupProbe:
6256
httpGet:
@@ -101,4 +95,4 @@ spec:
10195
key: password
10296
ports:
10397
- containerPort: 8080
104-
hostPort: {{.Values.proxyPort}}
98+
hostPort: {{.Values.proxy.port}}

charts/registry/values.yaml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ imageOrg: "drycc"
22
imagePullPolicy: "Always"
33
imageTag: "canary"
44
imageRegistry: "registry.drycc.cc"
5-
# limitsCpu: "100m"
6-
# limitsMemory: "50Mi"
75

86
## Enable diagnostic mode
97
##
@@ -40,8 +38,25 @@ podAntiAffinityPreset:
4038
replicas: 1
4139
# registry storage redirect
4240
redirect: "false"
43-
# host port for the registry proxy in the daemonset
44-
proxyPort: 5555
41+
42+
proxy:
43+
# host port for the registry proxy in the daemonset
44+
port: 5555
45+
resources: {}
46+
# limits:
47+
# cpu: 200m
48+
# memory: 50Mi
49+
# requests:
50+
# cpu: 100m
51+
# memory: 30Mi
52+
53+
resources: {}
54+
# limits:
55+
# cpu: 200m
56+
# memory: 50Mi
57+
# requests:
58+
# cpu: 100m
59+
# memory: 30Mi
4560

4661
concurrencyPolicy: "Replace"
4762

@@ -59,3 +74,11 @@ storage:
5974
service:
6075
# Provide any additional service annotations
6176
annotations: {}
77+
78+
resources: {}
79+
# limits:
80+
# cpu: 200m
81+
# memory: 50Mi
82+
# requests:
83+
# cpu: 100m
84+
# memory: 30Mi

0 commit comments

Comments
 (0)