Find file Copy path
71d16bf Apr 17, 2018
1 contributor

Users who have contributed to this file

66 lines (37 sloc) 4.07 KB

Kube-router on generic clusters

This guide is for running kube-router as the CNI network provider for on premise and/or bare metal clusters outside of a cloud provider's environment. It assumes the initial cluster is bootstrapped and a networking provider needs configuration.

All pod networking CIDRs are allocated by kube-controller-manager. Kube-router provides service/pod networking, a network policy firewall, and a high performance IPVS/LVS based service proxy. The network policy firewall and service proxy are both optional but recommended.

Configuring the Kubelet

If you choose to run kube-router as daemonset, then both kube-apiserver and kubelet must be run with --allow-privileged=true option

Ensure each Kubelet is configured with the following options:


If running Kubelet containerised, make sure /etc/cni/net.d is mapped to the host's /etc/cni/net.d

If a previous CNI provider (e.g. weave-net, calico, or flannel) was used, remove old configurations from /etc/cni/net.d on each kubelet.

Note: Switching CNI providers on a running cluster requires re-creating all pods to pick up new pod IPs

Configuring kube-controller-manager

If you choose to use kube-router for pod-to-pod network connectivity then kube-controller-manager need to be configured to allocate pod CIDRs by passing --allocate-node-cidrs=true flag and providing a cluster-cidr (i.e. by passing --cluster-cidr= for e.g.)

For example:


Running kube-router with everything

This runs kube-router with pod/service networking, the network policy firewall, and service proxy to replace kube-proxy. The example command uses as the pod CIDR address range and as the apiserver address. Please change these to suit your cluster.

sh -c 'curl -o - | \
kubectl apply -f -

Removing a previous kube-proxy

If kube-proxy was never deployed to the cluster, this can likely be skipped.

Remove any previously running kube-proxy and all iptables rules it created. Start by deleting the kube-proxy daemonset:

kubectl -n kube-system delete ds kube-proxy

Any iptables rules kube-proxy left around will also need to be cleaned up. This command might differ based on how kube-proxy was setup or configured:

docker run --privileged --net=host kube-proxy --cleanup-iptables

Running kube-router without the service proxy

This runs kube-router with pod/service networking and the network policy firewall. The Services proxy is disabled.

kubectl apply -f

In this mode kube-router relies on for example kube-proxy to provide service networking.

When service proxy is disabled kube-router will use in-cluster configuration to access APIserver through cluster-ip. Service networking must therefore be setup before deploying kube-router.


kube-router supports setting log level via the command line -v or --v, To get maximal debug output from kube-router please start with --v=3