Skip to content

Commit 8fe0653

Browse files
SEJeffmurali-reddy
authored andcommitted
Small docs fixes for setting up a generic cluster (#283)
* Minor doc README update around manually installed clusters * Documentation spelling fixes for generic clusters * Documentation update for the generic cluster guide This reworks things a bit more to read better to native english speakers. It cleans up some grammar, removes a lot of passive voice, and re-organizes things a bit.
1 parent 1edee93 commit 8fe0653

File tree

2 files changed

+37
-44
lines changed

2 files changed

+37
-44
lines changed

Documentation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Please see the [steps](https://github.com/cloudnativelabs/kube-router/tree/maste
8888
Please see the [steps](https://github.com/cloudnativelabs/kube-router/blob/master/Documentation/kubeadm.md) to deploy Kubernetes cluster with Kube-router using [Kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)
8989

9090
#### generic
91-
Please see the [steps](https://github.com/cloudnativelabs/kube-router/blob/master/Documentation/generic.md) to deploy kube-router on generic installed clusters
91+
Please see the [steps](https://github.com/cloudnativelabs/kube-router/blob/master/Documentation/generic.md) to deploy kube-router on manually installed clusters
9292

9393
### deployment
9494

Documentation/generic.md

Lines changed: 36 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,59 @@
1-
# Kube-router on generic cluster
1+
# Kube-router on generic clusters
22

3-
This guide assumes you already have bootstrapped the initial pieces for a Kubernets cluster and is about to switch or setup service & container networking provider
3+
This guide is for running kube-router as the [CNI](https://github.com/containernetworking) 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.
44

5-
Kube-router relies on kube-controller-manager to allocate pod CIDR for the nodes
5+
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.
66

7-
Kube-router provides pod networking, network policy and high perfoming IPVS/LVS based service proxy. Depending on you choose to use kube-router for service proxy you have two options listed below the prerequisites
87

9-
## Prerequisites
8+
### Configuring the Kubelet
109

11-
kube-router can work as your whole network stack in Kubernetes on-prem & bare metall and works without any cloudproviders
10+
Ensure each kubelet is configured with the following options:
1211

13-
below is the needed configuration to run kube-router in such environments
12+
--network-plugin=cni
13+
--cni-conf-dir=/etc/cni/net.d
1414

15-
### Kubelet on each node
15+
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.
1616

17-
kube-router assumes each Kubelet is using `/etc/cni/net.d` as cni conf dir & network plugin `cni`
17+
**Note: Switching CNI providers on a running cluster requires re-creating all pods to pick up new pod IPs**
1818

19-
- --cni-conf-dir=/etc/cni/net.d
20-
- --network-plugin=cni
2119

22-
If you have been using a other CNI providerssuch as weave-net, calico or flannel you will have to remove old configurations from /etc/cni/net.d on each node
20+
### Configuring kube-controller-manager
2321

24-
## __Switching CNI provider on a running cluster will require you to delete all the running pods and let them recreate and get new adresses assigned from the Kubenet IPAM__
22+
The following options are mandatory for kube-controller-manager:
2523

26-
### Kube controller-manager
24+
--cluster-cidr=${POD_NETWORK} # for example 10.32.0.0/12
25+
--service-cluster-ip-range=${SERVICE_IP_RANGE} # for example 10.50.0.0/22
2726

28-
The following options needs to be set on the controller-manager
2927

30-
```text
31-
--cluster-cidr=${POD_NETWORK} # for example 10.32.0.0/12
32-
--service-cluster-ip-range=${SERVICE_IP_RANGE} # for example 10.50.0.0/22
33-
```
28+
## Running kube-router with everything
3429

35-
## Kube-router providing pod networking and network policy
30+
This runs kube-router with pod/service networking, the network policy firewall, and service proxy to replace kube-proxy. The example command uses `10.32.0.0/12` as the pod CIDR address range and `https://cluster01.int.domain.com:6443` as the apiserver address. Please change these to suit your cluster.
3631

37-
Don't forgett to adjust values for Cluster CIDR (pod range) & apiserver adress (must be reachable directly from host networking)
32+
CLUSTERCIDR=10.32.0.0/12 \
33+
APISERVER=https://cluster01.int.domain.com:6443 \
34+
sh -c 'curl https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/generic-kuberouter-all-features.yaml -o - | \
35+
sed -e "s;%APISERVER%;$APISERVER;g" -e "s;%CLUSTERCIDR%;$CLUSTERCIDR;g"' | \
36+
kubectl apply -f -
3837

39-
```sh
40-
CLUSTERCIDR=10.32.0.0/12 \
41-
APISERVER=https://cluster01.int.domain.com:6443 \
42-
sh -c 'curl https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/generic-kuberouter.yaml -o - | \
43-
sed -e "s;%APISERVER%;$APISERVER;g" -e "s;%CLUSTERCIDR%;$CLUSTERCIDR;g"' | \
44-
kubectl apply -f -
45-
```
38+
### Removing a previous kube-proxy
4639

47-
## Kube-router providing service proxy, firewall and pod networking
40+
If kube-proxy was never deployed to the cluster, this can likely be skipped.
4841

49-
Don't forgett to adjust values for Cluster CIDR (pod range) & apiserver adress (must be reachable directly from host networking)
42+
Remove any previously running kube-proxy and all iptables rules it created. Start by deleting the kube-proxy daemonset:
5043

51-
```sh
52-
CLUSTERCIDR=10.32.0.0/12 \
53-
APISERVER=https://cluster01.int.domain.com:6443 \
54-
sh -c 'curl https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/generic-kuberouter-all-features.yaml -o - | \
55-
sed -e "s;%APISERVER%;$APISERVER;g" -e "s;%CLUSTERCIDR%;$CLUSTERCIDR;g"' | \
56-
kubectl apply -f -
57-
```
44+
kubectl -n kube-system delete ds kube-proxy
5845

59-
Now since kube-router provides service proxy as well. Run below commands to remove kube-proxy and cleanup any iptables configuration it may have done
46+
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:
6047

61-
Depending on if or how you installed kube-proxy previously these instructions will differ and have to be ran on every node where kube-proxy has run
48+
docker run --privileged --net=host gcr.io/google_containers/kube-proxy-amd64:v1.7.3 kube-proxy --cleanup-iptables
6249

63-
```sh
64-
kubectl -n kube-system delete ds kube-proxy
65-
docker run --privileged --net=host gcr.io/google_containers/kube-proxy-amd64:v1.7.3 kube-proxy --cleanup-iptables
66-
```
50+
51+
## Running kube-router without the service proxy
52+
53+
This runs kube-router with pod/service networking and the network policy firewall. The service proxy is disabled. Don't forget to update the cluster CIDR and apiserver addresses to match your cluster.
54+
55+
CLUSTERCIDR=10.32.0.0/12 \
56+
APISERVER=https://cluster01.int.domain.com:6443 \
57+
sh -c 'curl https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/generic-kuberouter.yaml -o - | \
58+
sed -e "s;%APISERVER%;$APISERVER;g" -e "s;%CLUSTERCIDR%;$CLUSTERCIDR;g"' | \
59+
kubectl apply -f -

0 commit comments

Comments
 (0)