Flannel: kubectl apply -f kub-flannel doesn't create /etc/cni content

Created on 27 Nov 2017  路  3Comments  路  Source: coreos/flannel

I have created a vagrant box and try to create a kubernetes cluster following the instructions at https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/

On step 3 launch:

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml

no content at /etc/cni and receive message in journal:

Unable to update cni config: No networks found in /etc/cni/net.d

Expected Behavior

Should be content at /etc/cni after apply kube-flannel.yml

Current Behavior

No content at /etc/cni

Possible Solution

Steps to Reproduce (for bugs)

  1. Create a virtualbox machine with vagrant:
# Vagrantfile
Vagrant.configure("2") do |config|
  config.vm.provider "virtualbox" do |v|
    v.cpus = 4  # CPU settings. VirtualBox works much better with a single CPU.
    v.memory = 4096

    # Disable VirtualBox DNS proxy as it may cause issues.
    # See https://github.com/docker/machine/pull/1069
    v.customize ['modifyvm', :id, '--natdnshostresolver1', 'off']
    v.customize ['modifyvm', :id, '--natdnsproxy1', 'off']
  end

  config.vm.define "kbt_1" do |config|
    config.vm.box = 'coreos-stable'
    config.vm.box_url = 'https://stable.release.core-os.net/amd64-usr/1520.8.0/coreos_production_vagrant.json'

    config.vm.box_check_update = false
    config.vbguest.auto_update = false
    config.vm.network "private_network", ip: "172.17.8.150"
    config.vm.synced_folder ".", "/vagrant", id: "core", :nfs => true
    config.vm.network :forwarded_port, guest: 8001, host: 8001

    config.vm.hostname = 'coreos1'
  end
end
  1. Install kubeadm with
docker run -it \
-v /etc:/rootfs/etc \
-v /opt:/rootfs/opt \
-v /usr/bin:/rootfs/usr/bin \
 -e K8S_VERSION=v1.8.4 \
 -e CNI_RELEASE=v0.6.0 \
xakra/kubeadm-installer:0.4.7 coreos
  1. Init cluster:
sudo systemctl daemon-reload
sudo systemctl enable docker kubelet
sudo systemctl restart docker kubelet

sudo kubeadm init --pod-network-cidr=10.244.0.0/16

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

sudo sysctl net.bridge.bridge-nf-call-iptables=1
  1. Install flannel:
sudo kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.9.1/Documentation/kube-flannel.yml

Context

I'm trying to start to test kubernetes to move it to production.

Your Environment

  • Flannel version: 9.1
  • Backend used (e.g. vxlan or udp): ?
  • Etcd version:
  • Kubernetes version (if used): 1.8.4
  • Operating System and version: CoreOS 1520.8.0 in a Windows 10, Vagrant with vagrant-winnfsd plugin
kinsupport

All 3 comments

It's probably worth seeing if someone can help you on slack https://github.com/coreos/flannel#contact

thanks @tomdee, you are right.

same problem

Was this page helpful?
0 / 5 - 0 ratings

Related issues

euclid-geometry picture euclid-geometry  路  5Comments

bboreham picture bboreham  路  4Comments

lucaswilric picture lucaswilric  路  5Comments

a365541453 picture a365541453  路  5Comments

smarkm picture smarkm  路  4Comments