0

I want to setup a kubernetes multi-node cluster on docker following http://kubernetes.io/v1.1/docs/getting-started-guides/docker-multinode/master.html on a ubuntu server.

The single node setup works fine. However For the multi-node setup I occur several problems: https://github.com/kubernetes/kubernetes/issues/22256

The most important one being:

sudo docker -H unix:///var/run/docker.sock exec someHash cat /run/flannel/subnet.env
cat: can't open '/run/flannel/subnet.env': No such file or directory

I do not think that it is an issue with 1.10 docker? https://github.com/kubernetes/kubernetes/issues/19720

This is possibly similar https://groups.google.com/forum/#!topic/google-containers/nGX1XfZ0bE8 (see the posting from leto12, 01.06.15)

A find as suggested by leto12 /var/lib/docker/aufs/diff/8f390f0c044c536483a090913290a0bffb9820f0e6376133f8299a98facbd199/tmp/flannelshows me this file - however, I am unable to access it.

Georg Heiler
  • 16,916
  • 36
  • 162
  • 292
  • Is etcd up? can you try docker execing into the flannel container and curling etcd? subnet.env is written out by flannel after it's acquired a subnet through etcd. You should be able to see the actual subnet allocated to a given node via etcdls ls --recursive. – Prashanth B Mar 03 '16 at 06:51
  • Thanks for the tip - unfortunately (when re-following these steps & after a reboot) I already fail at the step before with `sudo docker -H unix:///var/run/docker.sock run --net=host gcr.io/google_containers/etcd:2.0.12 etcdctl set /coreos.com/network/config '{ "Network": "10.1.0.0/16" }'` resulting in `Error: cannot sync with the cluster using endpoints http://127.0.0.1:4001, http://127.0.0.1:2379` – Georg Heiler Mar 03 '16 at 07:04
  • I started from scratch on a different machine and got past both errors !! – Georg Heiler Mar 03 '16 at 09:08
  • Might be a little late for you, but i wanted to share: In my case this problem was related to a wrong _Docker-Kubernetes_ setup, which caused containers like `CoreDNS` to be stuck in _ContainerCreation_. My full answer can be found [here](https://stackoverflow.com/a/60049037/3757672). – Markus Feb 05 '20 at 10:05

1 Answers1

1

"subnet.env" file is generated by Flannel. Docker should be started after Flannel is running. Try following steps:

Step 1: stop docker and flannel;
Step 2: delete docker0 and flannel.1;
Step 3: start flannel and check its status;
Step 4: start docker and check its status.

Check if docker was running with parameters "--bip" "--ip-masq" and "--mtu".

openxxs
  • 146
  • 3