From cff39eeb3d0dd3710f83b5eba7bde1afa8fa2d46 Mon Sep 17 00:00:00 2001 From: Ricky Pai Date: Mon, 17 Jul 2017 16:53:18 -0700 Subject: [PATCH] use init container to install cni on flannel daemonset --- Documentation/kube-flannel.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/Documentation/kube-flannel.yml b/Documentation/kube-flannel.yml index db98fdcde..e76c8d71c 100644 --- a/Documentation/kube-flannel.yml +++ b/Documentation/kube-flannel.yml @@ -53,6 +53,20 @@ spec: operator: Exists effect: NoSchedule serviceAccountName: flannel + initContainers: + - name: install-cni + image: quay.io/coreos/flannel:v0.8.0-amd64 + command: + - cp + args: + - -f + - /etc/kube-flannel/cni-conf.json + - /etc/cni/net.d/10-flannel.conf + volumeMounts: + - name: cni + mountPath: /etc/cni/net.d + - name: flannel-cfg + mountPath: /etc/kube-flannel/ containers: - name: kube-flannel image: quay.io/coreos/flannel:v0.8.0-amd64 @@ -73,14 +87,6 @@ spec: mountPath: /run - name: flannel-cfg mountPath: /etc/kube-flannel/ - - name: install-cni - image: quay.io/coreos/flannel:v0.8.0-amd64 - command: [ "/bin/sh", "-c", "set -e -x; cp -f /etc/kube-flannel/cni-conf.json /etc/cni/net.d/10-flannel.conf; while true; do sleep 3600; done" ] - volumeMounts: - - name: cni - mountPath: /etc/cni/net.d - - name: flannel-cfg - mountPath: /etc/kube-flannel/ volumes: - name: run hostPath: