Giter Site home page Giter Site logo

flannel-cni's Introduction

Example for deploying flannel daemonset:

flannel-configmap:

apiVersion: v1
kind: ConfigMap
metadata:
  name: kube-flannel-cfg
  namespace: kube-system
  labels:
    tier: node
    k8s-app: flannel
data:
  cni-conf.json: |
    {
      "name": "cbr0",
      "type": "flannel",
      "delegate": {
        "isDefaultGateway": true
      }
    }
  net-conf.json: |
    {
      "Network": "{{ .PodCIDR }}",
      "Backend": {
        "Type": "vxlan"
      }
    }

flannel-daemonset:

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: kube-flannel
  namespace: kube-system
  labels:
    tier: node
    k8s-app: flannel
spec:
  template:
    metadata:
      labels:
        tier: node
        k8s-app: flannel
    spec:
      containers:
      - name: kube-flannel
        image: quay.io/coreos/flannel:v0.7.1-amd64
        command: [ "/opt/bin/flanneld", "--ip-masq", "--kube-subnet-mgr", "--iface=$(POD_IP)"]
        securityContext:
          privileged: true
        env:
        - name: POD_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        - name: POD_NAMESPACE
          valueFrom:
            fieldRef:
              fieldPath: metadata.namespace
        - name: POD_IP
          valueFrom:
            fieldRef:
              fieldPath: status.podIP
        volumeMounts:
        - name: run
          mountPath: /run
        - name: cni
          mountPath: /etc/cni/net.d
        - name: flannel-cfg
          mountPath: /etc/kube-flannel/
      - name: install-cni
        image: quay.io/coreos/flannel-cni:0.1
        command: ["/install-cni.sh"]
        env:
        # The CNI network config to install on each node.
        - name: CNI_NETWORK_CONFIG
            valueFrom:
            configMapKeyRef:
                name: kube-flannel-cfg
                key: cni-conf.json
        volumeMounts:
        - name: cni
          mountPath: /etc/cni/net.d
        - name: host-cni-bin
          mountPath: /host/opt/cni/bin/
      hostNetwork: true
      tolerations:
      - key: node-role.kubernetes.io/master
        operator: Exists
        effect: NoSchedule
      volumes:
        - name: run
          hostPath:
            path: /run
        - name: cni
          hostPath:
            path: /etc/kubernetes/cni/net.d
        - name: flannel-cfg
          configMap:
            name: kube-flannel-cfg
        - name: host-cni-bin
          hostPath:
            path: /opt/cni/bin
  updateStrategy:
    rollingUpdate:
      maxUnavailable: 1
    type: RollingUpdate

flannel-cni's People

Contributors

abhinavdahiya avatar dghubble avatar klausenbusk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flannel-cni's Issues

failure to launch k8s cluster when ipv6 disabled

I am deploying a k8s cluster deployed using Rancher v2.1.7 (backed by flannel)

I am trying to run Kubernetes v1.11.8, which uses the following flannel-relevant system images:

  • flannel: rancher/coreos-flannel:v0.10.0
  • flannel_cni: rancher/coreos-flannel-cni:v0.3.0

When I try to initialize a k8s cluster using flannel, I get a ton of pods failing to create with the following message from kubectl describe pod ${POD_NAME}:

Warning FailedCreatePodSandBox 1m (x4 over 1m) kubelet, 10.15.2.240 (combined from similar events): Failed create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container "12345678910" network for pod "kube-dns-123456-abc4y": NetworkPlugin cni failed to set up pod "kube-dns-123456-abc4y_kube-system" network: open /proc/sys/net/ipv6/conf/eth0/accept_dad: no such file or directory, failed to clean up sandbox container "12345678910" network for pod "kube-dns-123456-abc4y": NetworkPlugin cni failed to teardown pod "kube-dns-123456-abc4y_kube-system" network: failed to get IP addresses for "eth0": <nil>]

I have ipv6 disabled on my k8s nodes and don't have problems booting up a k8s cluster with another network provider (like Calico).

When I enable ipv6, I am able to bootup the cluster. However I don't want to have to do this.

I read that this issue was fixed in the latest release of containernetworking/plugins: v0.7.0

Is this going to get supported in a new release of flannel-cni? Since I use rancher for my k8s cluster deployments, I have to pretty much rely on the implementation of the flannel-cni docker container.

Default config won't work with kubelet 1.16+

kubernetes/kubernetes#80482 added CNI validation to the kubelet, which results in the kubelet choking on the current default config for flannel, with errors along the line of:

Aug 27 23:28:44 wk-k8s kubelet[16814]: W0827 23:28:44.567137   16814 cni.go:202] Error validating CNI config &{cbr0  false [0xc000cb9580 0xc000cb9600] [123 10 32 32 34 110 97 109 101 34 58 32 34 99 98 114 48 34 44 10 32 32 34 112 108 117 103 105 110 115 34 58 32 91 10 32 32 32 
Aug 27 23:28:44 wk-k8s kubelet[16814]: W0827 23:28:44.567244   16814 cni.go:237] Unable to update cni config: no valid networks found in /etc/cni/net.d
Aug 27 23:28:45 wk-k8s kubelet[16814]: E0827 23:28:45.801717   16814 kubelet.go:2182] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

Adding a

"cniVersion": "0.3.1"

line to https://github.com/coreos/flannel/blob/ecb6db314e40094a43144b57f29b3ec2164d44c9/Documentation/kube-flannel.yml#L107-L131 or https://github.com/coreos/flannel-cni/blob/master/flannel.conflist.default fixes the issue.

Default config won't work with kubelet 1.16+

kubernetes/kubernetes#80482 added CNI validation to the kubelet, which results in the kubelet choking on the current default config for flannel, with errors along the line of:

Aug 27 23:28:44 wk-k8s kubelet[16814]: W0827 23:28:44.567137   16814 cni.go:202] Error validating CNI config &{cbr0  false [0xc000cb9580 0xc000cb9600] [123 10 32 32 34 110 97 109 101 34 58 32 34 99 98 114 48 34 44 10 32 32 34 112 108 117 103 105 110 115 34 58 32 91 10 32 32 32 
Aug 27 23:28:44 wk-k8s kubelet[16814]: W0827 23:28:44.567244   16814 cni.go:237] Unable to update cni config: no valid networks found in /etc/cni/net.d
Aug 27 23:28:45 wk-k8s kubelet[16814]: E0827 23:28:45.801717   16814 kubelet.go:2182] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:docker: network plugin is not ready: cni config uninitialized

Adding a

"cniVersion": "0.3.1"

line to https://github.com/coreos/flannel/blob/ecb6db314e40094a43144b57f29b3ec2164d44c9/Documentation/kube-flannel.yml#L107-L131 or https://github.com/coreos/flannel-cni/blob/master/flannel.conflist.default fixes the issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.