diff --git a/chart/kube-flannel/templates/daemonset.yaml b/chart/kube-flannel/templates/daemonset.yaml index af7226db2e..e038afeb91 100644 --- a/chart/kube-flannel/templates/daemonset.yaml +++ b/chart/kube-flannel/templates/daemonset.yaml @@ -107,3 +107,6 @@ spec: hostPath: path: /run/xtables.lock type: FileOrCreate + {{- if .Values.global.imagePullSecrets }} + imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 6 }} + {{- end }} diff --git a/chart/kube-flannel/tests/daemonset_test.yaml b/chart/kube-flannel/tests/daemonset_test.yaml index 561e8f9cae..69655ad62a 100644 --- a/chart/kube-flannel/tests/daemonset_test.yaml +++ b/chart/kube-flannel/tests/daemonset_test.yaml @@ -45,3 +45,13 @@ tests: - "/opt/bin/flanneld" - "--ip-masq" - "--kube-subnet-mgr" + + - it: should have the correct image pull secrets + set: + global.imagePullSecrets: + - name: "a-test-secret" + asserts: + - equal: + path: spec.template.spec.imagePullSecrets + value: + - name: "a-test-secret" diff --git a/chart/kube-flannel/values.yaml b/chart/kube-flannel/values.yaml index 9244c2df45..9e5a2ed295 100644 --- a/chart/kube-flannel/values.yaml +++ b/chart/kube-flannel/values.yaml @@ -1,4 +1,7 @@ --- +global: + imagePullSecrets: +# - name: "a-secret-name" # The IPv4 cidr pool to create on startup if none exists. Pod IPs will be # chosen from this range.