What's is ${FLANNEL_SUBNET} and ${FLANNEL_MTU} when Installing a Kubernetes Master Node via Docker?

11/9/2015

When Installing a Kubernetes Master Node via Docker, docker config bip and mtu for Run flannel.
--bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}
What's are FLANNEL_SUBNET and FLANNEL_MTU variables? How to set ${FLANNEL_SUBNET} and ${FLANNEL_MTU}?

-- ttyyll
kubernetes

1 Answer

11/9/2015

I really don't understand your questions, but I can explain how flannel integrates with docker.

Flannel is managing this file:

# cat /usr/lib/systemd/system/docker.service.d/flannel.conf
[Service]
EnvironmentFile=-/run/flannel/docker

Which is setting the docker service to use the values from /run/flannel/docker as environment variables.

Inside /run/flannel/docker flannel is writing the network configuration that docker should use:

# cat /run/flannel/docker
DOCKER_OPT_BIP="--bip=172.16.66.1/24"
DOCKER_OPT_IPMASQ="--ip-masq=true"
DOCKER_OPT_MTU="--mtu=1472"
DOCKER_NETWORK_OPTIONS=" --iptables=false --ip-masq=false --bip=172.16.66.1/24 --ip-masq=true --mtu=1472 "

On centos/redhat, the docker systemd scripts is starting the daemon with the following command (taken from /usr/lib/systemd/system/docker.service)

ExecStart=/usr/bin/docker -d $OPTIONS \
      $DOCKER_STORAGE_OPTIONS \
      $DOCKER_NETWORK_OPTIONS \
      $ADD_REGISTRY \
      $BLOCK_REGISTRY \
      $INSECURE_REGISTRY

So it will use only DOCKER_NETWORK_OPTIONS from what flannel offers.

On coreos, the docker daemon is started with:

/usr/lib/coreos/dockerd daemon --host=fd:// $DOCKER_OPTS $DOCKER_OPT_BIP $DOCKER_OPT_MTU $DOCKER_OPT_IPMASQ
-- cristi
Source: StackOverflow