defining pod_cidr without overlay network

125 views
Skip to first unread message

Tim Korn

unread,
Aug 16, 2016, 10:05:15 PM8/16/16
to CoreOS User
I'm trying to setup K8S on bare-metal without an overlay network.  Heres what I've got.

master01 : node IP 10.96.86.11/24 : no pods
node02 : node IP 10.96.86.13/24 : pod_cidr 10.96.86.32/27
node03 : node IP 10.96.86.15/24 : pod_cidr 10.96.86.64/27
node04 : node IP 10.100.32.11/24 : pod_cidr 10.100.32.32/27

Currently I just have K8S installed according to https://coreos.com/kubernetes/docs/latest/deploy-workers.html, but I skipped anything involving calico and flannel.  So all node's networking looks like this: 
node02 kubernetes # ip addr
2: enp6s0f0:
    inet
10.96.86.13/24 brd 10.96.86.255 scope global dynamic enp6s0f0
4: docker0:
    inet
172.17.0.1/16 scope global docker0

All three of them are using the default docker0 subnet of 172.17.0.1/16.  Somewhere I need to define the pod_cidr that I want to use, but I can't figure out where to do it so it can be specific to each host.  Any ideas?  



If i run kubectl run my-nginx --image=nginx --port=80 it tries to deploy the pod, but it never starts:
tkorn:kuber tkorn$ kubectl get deployments
NAME       DESIRED   CURRENT   UP
-TO-DATE   AVAILABLE   AGE
my-nginx   1         1         1            0           4h
tkorn
:kuber tkorn$ kubectl get pods
NAME                        READY     STATUS    RESTARTS   AGE
my-nginx-2494149703-jxx0p   0/1       Pending   0          4h

A docker ps on the nodes just shows the following...none of them have this nginx pod:
node02 kubernetes # docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS               NAMES
b5fe545e8d3d        
quay.io/coreos/hyperkube:v1.3.4_coreos.0   "/hyperkube proxy --m"   About an hour ago   Up About an hour                        k8s_kube-proxy.d62dcbdf_kube-proxy-10.96.86.13_kube-system_992d7858cb3726dc6ed8cb88b35e4244_193ef02f
5254544e1ad1        gcr.io/google_containers/pause-amd64:3.0   "/pause"                 About an hour ago   Up About an hour                        k8s_POD.d8dbe16c_kube-proxy-10.96.86.13_kube-system_992d7858cb3726dc6ed8cb88b35e4244_8c31b254

So it's like kubernetes has no clue where to put that pod and its not even attempting to send it out to a node...

Any ideas on how to get this squared away?

I think this doc might be a step in the right direction, but I don't really know where to put those docker options.  
Message has been deleted

will.g...@coreos.com

unread,
Sep 1, 2016, 9:33:17 PM9/1/16
to CoreOS User
Hey Tim,

Have you tried kubenet? It will configure the bridge and veths for you.
Since the kubelet service handles pod creation and management, networking flags can be set in the service file:
`/etc/systemd/system/kubelet.service`  You may also want to check out our generic kubernetes scripts here and corresponding documentation here

Cheers,

Will

Tim Korn

unread,
Sep 2, 2016, 1:43:15 PM9/2/16
to CoreOS User
Kubenet did the trick.  I have my cluster working properly now.  Thanks a ton!
Reply all
Reply to author
Forward
0 new messages