From 3e1a1e5f4b98219f56cd76b9a6713703f8b00b6e Mon Sep 17 00:00:00 2001 From: Evan Johnson Date: Wed, 16 Oct 2024 11:45:19 -0400 Subject: [PATCH] make volume and volume mounts configurable through helm --- deploy/chart/templates/daemonset.yaml | 10 ++++++++-- deploy/chart/values.yaml | 17 ++++++++++++++--- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/deploy/chart/templates/daemonset.yaml b/deploy/chart/templates/daemonset.yaml index 9b5304bf..b9b66804 100644 --- a/deploy/chart/templates/daemonset.yaml +++ b/deploy/chart/templates/daemonset.yaml @@ -54,6 +54,9 @@ spec: volumeMounts: - mountPath: /etc/kubernetes name: k8s + {{- if .Values.volumeMounts}} + {{- toYaml .Values.volumeMounts | nindent 12 }} + {{- end}} env: - name: LINODE_API_TOKEN valueFrom: @@ -65,10 +68,13 @@ spec: secretKeyRef: name: {{ if .Values.secretRef }}{{ .Values.secretRef.name | default "ccm-linode" }}{{ else }}"ccm-linode"{{ end }} key: {{ if .Values.secretRef }}{{ .Values.secretRef.regionRef | default "region" }}{{ else }}"region"{{ end }} - {{if .Values.env}} + {{- if .Values.env}} {{- toYaml .Values.env | nindent 12 }} - {{end}} + {{- end}} volumes: - name: k8s hostPath: path: /etc/kubernetes + {{- if .Values.volumes}} + {{- toYaml .Values.volumes | nindent 8 }} + {{- end}} diff --git a/deploy/chart/values.yaml b/deploy/chart/values.yaml index 7d8d656b..a2f0256a 100644 --- a/deploy/chart/values.yaml +++ b/deploy/chart/values.yaml @@ -58,6 +58,17 @@ tolerations: # This section adds the ability to pass environment variables to adjust CCM defaults # https://github.com/linode/linode-cloud-controller-manager/blob/master/cloud/linode/loadbalancers.go # LINODE_HOSTNAME_ONLY_INGRESS type bool is supported -# env: - # - name: EXAMPLE_ENV_VAR - # value: "true" +env: +# - name: EXAMPLE_ENV_VAR +# value: "true" + +# This section adds the ability to pass volumes to the CCM DaemonSet +volumes: +# - name: test-volume +# emptyDir: +# sizeLimit: 500Mi + +# this section adds the ability to pass volumeMounts to the CCM container +volumeMounts: +# - mountPath: /tmp/ +# name: test-volume \ No newline at end of file