3

I am running kubernetes(v1.7) and flannel(v0.9.0) which was installed using kubeadm.

I want to know that-

  1. How does a node get a subnet?
  2. Where are all allocated subnets stored and how I can see them?
  3. How does flannel interact with kubernetes?

Thanks,

shabbir
  • 121
  • 2
  • 6

1 Answers1

4
  1. flannel gives the POD IP address. network range is defined in subnet.env file
# cat /var/run/flannel/subnet.env
FLANNEL_NETWORK=10.244.0.0/16
FLANNEL_SUBNET=10.244.0.1/24
FLANNEL_MTU=1450
FLANNEL_IPMASQ=true
  1. Allocated IPs are stored in etcd database in the Master Node. you can query API server to view them

  2. Flannel is a virtual network that gives a subnet to PODs. when Kubernetes start the pod it gets the IP address from flannel and assign to PODs

you can look at the network info like this from etcd database.

 export ETCDCTL_API=3;  etcdctl get "/registry/configmaps/kube-system/kubeadm-config" --prefix=true
sfgroups
  • 18,151
  • 28
  • 132
  • 204