Skip to content

Commit

Permalink
feat(helm-chart): command and args configurable
Browse files Browse the repository at this point in the history
Signed-off-by: Armin Schlegel <armin.schlegel@gmx.de>
  • Loading branch information
siredmar committed Aug 10, 2023
1 parent c17e715 commit f5bf449
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
13 changes: 10 additions & 3 deletions chart/kube-flannel/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,17 @@ spec:
containers:
- name: kube-flannel
image: {{ .Values.flannel.image.repository }}:{{ .Values.flannel.image.tag }}
command:
- "/opt/bin/flanneld"
{{- if .Values.flannel.command }}
command:
{{- range .Values.flannel.command }}
- {{ . }}
{{- end }}
{{- end }}
{{- if .Values.flannel.args }}
args:
{{- range .Values.flannel.args }}
- {{ . | quote }}
- {{ . }}
{{- end }}
{{- end }}
resources:
requests:
Expand Down
5 changes: 5 additions & 0 deletions chart/kube-flannel/tests/daemonset_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ tests:

- it: should have the correct args
set:
flannel.command:
- "/opt/bin/flanneld"
flannel.args:
- "--ip-masq"
- "--kube-subnet-mgr"
Expand All @@ -43,5 +45,8 @@ tests:
path: spec.template.spec.containers[0].command
value:
- "/opt/bin/flanneld"
- equal:
path: spec.template.spec.containers[0].args
value:
- "--ip-masq"
- "--kube-subnet-mgr"
9 changes: 5 additions & 4 deletions chart/kube-flannel/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ flannel:
image_cni:
repository: docker.io/flannel/flannel-cni-plugin
tag: v1.2.0
# flannel command arguments
args:
- "--ip-masq"
- "--kube-subnet-mgr"

# command to execute
command: ["/opt/bin/flanneld"]
# command arguments
args: ["--ip-masq", "--kube-subnet-mgr"]
# Backend for kube-flannel. Backend should not be changed
# at runtime. (vxlan, host-gw, wireguard, udp)
# Documentation at https://github.com/flannel-io/flannel/blob/master/Documentation/backends.md
Expand Down

0 comments on commit f5bf449

Please sign in to comment.