apiVersion: v1
kind: Pod
metadata:
  namespace: kube-system
  name: flannel
  labels:
    component: flannel
    tier: control-plane
spec:
  initContainers:
  - name: install-cni
    image: quay.io/coreos/flannel:v0.11.0-amd64
    command:
    - cp
    args:
    - -f
    - /etc/kube-flannel/cni-conf.json
    - /etc/cni/net.d/10-flannel.conflist
    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.11.0-amd64
    command:
    - /opt/bin/flanneld
    args:
    - --ip-masq
    - --kube-subnet-mgr
    - --kubeconfig-file=/etc/kube-flannel-kubeconfig.conf
    resources: {}
    securityContext:
      privileged: false
      capabilities:
          add: ["NET_ADMIN"]
    env:
    - name: POD_NAME
      valueFrom:
        fieldRef:
          fieldPath: metadata.name
    - name: POD_NAMESPACE
      valueFrom:
        fieldRef:
          fieldPath: metadata.namespace
    volumeMounts:
    - name: run
      mountPath: /run/flannel
    - name: flannel-cfg
      mountPath: /etc/kube-flannel/
      readOnly: true
    - name: kubeconfig
      mountPath: /etc/kube-flannel-kubeconfig.conf
      readOnly: true
  hostNetwork: true
  volumes:
    - hostPath:
        path: /etc/kubernetes/admin.conf
        type: FileOrCreate
      name: kubeconfig
    - name: run
      hostPath:
        path: /run/flannel
        type: DirectoryOrCreate
    - name: cni
      hostPath:
        path: /etc/cni/net.d
        type: DirectoryOrCreate
    - name: flannel-cfg
      hostPath:
        path: /usr/lib/kubernetes/config/flannel/
        type: DirectoryOrCreate
