Skip to content

Commit

Permalink
add configMap volume for addon resizer
Browse files Browse the repository at this point in the history
Signed-off-by: Calvin Bui <[email protected]>
  • Loading branch information
calvinbui committed Mar 31, 2023
1 parent 551de64 commit 840608d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
7 changes: 7 additions & 0 deletions charts/metrics-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,13 @@ The image to use for the addon resizer
{{- printf "%s:%s" .Values.addonResizer.image.repository .Values.addonResizer.image.tag }}
{{- end }}

{{/*
ConfigMap name of addon resizer
*/}}
{{- define "metrics-server.addonResizer.configMap" -}}
{{- printf "%s-%s" (include "metrics-server.fullname" .) "nanny-config" }}
{{- end }}

{{/* Get PodDisruptionBudget API Version */}}
{{- define "metrics-server.pdb.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">= 1.21-0" .Capabilities.KubeVersion.Version) -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/metrics-server/templates/configmaps-nanny.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "metrics-server.fullname" .}}-nanny-config
name: {{ include "metrics-server.addonResizer.configMap" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
Expand Down
5 changes: 5 additions & 0 deletions charts/metrics-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,11 @@ spec:
volumes:
- name: tmp
emptyDir: {}
{{- if .Values.addonResizer.enabled }}
- name: nanny-config-volume
configMap:
name: {{ include "metrics-server.addonResizer.configMap" . }}
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down

0 comments on commit 840608d

Please sign in to comment.