2525 {{- .Values.deploymentStrategy | toYaml | nindent 4}}
2626 template :
2727 metadata :
28- {{- with .Values.podAnnotations }}
28+ {{- if or .Values.minecraftRouter.autoScale.allowDeny .Values.podAnnotations }}
2929 annotations :
30+ {{- if .Values.minecraftRouter.autoScale.allowDeny }}
31+ {{- if eq .Values.minecraftRouter.autoScale.configObject "Secret" }}
32+ checksum/autoscale-allow-deny-config : {{ include (print .Template.BasePath "/autoscale-allow-deny-secret.yaml") . | sha256sum }}
33+ {{- else if eq .Values.minecraftRouter.autoScale.configObject "ConfigMap" }}
34+ checksum/autoscale-allow-deny-config : {{ include (print .Template.BasePath "/autoscale-allow-deny-configmap.yaml") . | sha256sum }}
35+ {{- end }}
36+ {{- end }}
37+ {{- with .Values.podAnnotations }}
3038 {{- toYaml . | nindent 8 }}
39+ {{- end }}
3140 {{- end }}
3241 labels :
3342 {{- include "mc-router.labels" . | nindent 8 }}
5463{{- include "mc-router.envMap" (list "PORT" $minecraftPort) }}
5564
5665 {{- with .Values.minecraftRouter }}
57- {{- include "mc-router.envMap" (list "AUTO_SCALE_UP" .autoScaleUp.enabled) }}
66+ {{- include "mc-router.envMap" (list "AUTO_SCALE_UP" .autoScale.up.enabled) }}
67+ {{- include "mc-router.envMap" (list "AUTO_SCALE_DOWN" .autoScale.down.enabled) }}
68+ {{- include "mc-router.envMap" (list "AUTO_SCALE_DOWN_AFTER" .autoScale.down.after) }}
69+ {{- if .autoScale.allowDeny }}
70+ {{- include "mc-router.envMap" (list "AUTO_SCALE_ALLOW_DENY" "etc/mc-router/auto-scale-allow-deny-list.json") }}
71+ {{- end }}
5872{{- include "mc-router.envMap" (list "CONNECTION_RATE_LIMIT" .connectionRateLimit) }}
5973{{- include "mc-router.envMap" (list "CPU_PROFILE" .cpuProfilePath) }}
6074{{- include "mc-router.envMap" (list "DEBUG" .debug.enabled) }}
@@ -136,13 +150,20 @@ spec:
136150 port : {{ $apiPort }}
137151 resources :
138152 {{- toYaml .Values.resources | nindent 12 }}
139- {{- with .Values.extraVolumes }}
153+ {{- if or .Values.minecraftRouter.autoScale.allowDeny .Values.extraVolumes }}
140154 volumeMounts :
155+ {{- if .Values.minecraftRouter.autoScale.allowDeny }}
156+ - name : autoscale-allow-deny
157+ mountPath : /etc/mc-router
158+ readOnly : true
159+ {{- end }}
160+ {{- with .Values.extraVolumes }}
141161 {{- range . }}
142162 {{- if .volumeMounts }}
143163 {{- toYaml .volumeMounts | nindent 12 }}
144164 {{- end }}
145165 {{- end }}
166+ {{- end }}
146167 {{- end }}
147168 {{- with .Values.nodeSelector }}
148169 nodeSelector :
@@ -157,13 +178,26 @@ spec:
157178 {{- toYaml . | nindent 8 }}
158179 {{- end }}
159180
160- {{- with .Values.extraVolumes }}
181+ {{- if or .Values.minecraftRouter.autoScale.allowDeny .Values.extraVolumes }}
161182 volumes :
183+ {{- if .Values.minecraftRouter.autoScale.allowDeny }}
184+ {{- if eq .Values.minecraftRouter.autoScale.configObject "Secret" }}
185+ - name : autoscale-allow-deny
186+ secret :
187+ secretName : {{ include "mc-router.fullname" . }}-autoscale-allow-deny
188+ {{- else if eq .Values.minecraftRouter.autoScale.configObject "ConfigMap" }}
189+ - name : autoscale-allow-deny
190+ configMap :
191+ name : {{ include "mc-router.fullname" . }}-autoscale-allow-deny
192+ {{- end }}
193+ {{- end }}
194+ {{- with .Values.extraVolumes }}
162195 {{- range . }}
163196 {{- if .volumes }}
164197 {{- toYaml .volumes | nindent 8 }}
165198 {{- end }}
166199 {{- end }}
200+ {{- end }}
167201 {{- end }}
168202 {{- range $key, $value := .Values.extraPodSpec }}
169203 {{ $key }}: {{ tpl $value $ }}
0 commit comments