Skip to content

Commit

Permalink
chart: add possibility for defining image pull secrets in daemonset
Browse files Browse the repository at this point in the history
when users overwrite image repository, image pull secrets may be required to have access
  • Loading branch information
vonhutrong committed Dec 17, 2023
1 parent 0179277 commit c59f73a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions chart/kube-flannel/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,6 @@ spec:
hostPath:
path: /run/xtables.lock
type: FileOrCreate
{{- if .Values.global.imagePullSecrets }}
imagePullSecrets: {{ toYaml .Values.global.imagePullSecrets | nindent 6 }}
{{- end }}
10 changes: 10 additions & 0 deletions chart/kube-flannel/tests/daemonset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
3 changes: 3 additions & 0 deletions chart/kube-flannel/values.yaml
Original file line number Diff line number Diff line change
@@ -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.
Expand Down

0 comments on commit c59f73a

Please sign in to comment.