diff --git a/chart/kube-flannel/templates/daemonset.yaml b/chart/kube-flannel/templates/daemonset.yaml index af7226db2e..1853b5f97a 100644 --- a/chart/kube-flannel/templates/daemonset.yaml +++ b/chart/kube-flannel/templates/daemonset.yaml @@ -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: diff --git a/chart/kube-flannel/tests/daemonset_test.yaml b/chart/kube-flannel/tests/daemonset_test.yaml index 561e8f9cae..905068bf25 100644 --- a/chart/kube-flannel/tests/daemonset_test.yaml +++ b/chart/kube-flannel/tests/daemonset_test.yaml @@ -35,6 +35,8 @@ tests: - it: should have the correct args set: + flannel.command: + - "/opt/bin/flanneld" flannel.args: - "--ip-masq" - "--kube-subnet-mgr" @@ -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" diff --git a/chart/kube-flannel/values.yaml b/chart/kube-flannel/values.yaml index 3a1aa19dcc..f25bece427 100644 --- a/chart/kube-flannel/values.yaml +++ b/chart/kube-flannel/values.yaml @@ -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