Skip to content

Commit 42f7177

Browse files
roffemurali-reddy
authored andcommitted
Updated generic cluster docs & daemonset (#284)
* fixed server adress in generic examples * updated generic docs * removed unnecessary mounts * removed some steps not needed * some clarification on functionality * updated description * updated description * enriching docs with usefull links * added note about containerised kubelet * fixed link * final touches * one last link
1 parent 8fe0653 commit 42f7177

File tree

4 files changed

+17
-50
lines changed

4 files changed

+17
-50
lines changed

Documentation/generic.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,32 @@
22

33
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-
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.
6-
5+
All pod networking [CIDRs](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) are allocated by kube-controller-manager. Kube-router provides service/pod networking, a network policy firewall, and a high performance [IPVS/LVS](http://www.linuxvirtualserver.org/software/ipvs.html) based service proxy. The network policy firewall and service proxy are both optional but recommended.
76

87
### Configuring the Kubelet
98

10-
Ensure each kubelet is configured with the following options:
9+
Ensure each [Kubelet](https://kubernetes.io/docs/reference/generated/kubelet/) is configured with the following options:
1110

1211
--network-plugin=cni
1312
--cni-conf-dir=/etc/cni/net.d
1413

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.
14+
If running Kubelet containerised, make sure `/etc/cni/net.d` is mapped to the host's `/etc/cni/net.d`
1615

17-
**Note: Switching CNI providers on a running cluster requires re-creating all pods to pick up new pod IPs**
16+
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.
1817

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

2020
### Configuring kube-controller-manager
2121

22-
The following options are mandatory for kube-controller-manager:
22+
The following options are mandatory for [kube-controller-manager](https://kubernetes.io/docs/reference/generated/kube-controller-manager/):
2323

2424
--cluster-cidr=${POD_NETWORK} # for example 10.32.0.0/12
2525
--service-cluster-ip-range=${SERVICE_IP_RANGE} # for example 10.50.0.0/22
2626

2727

2828
## Running kube-router with everything
2929

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.
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](https://kubernetes.io/docs/reference/generated/kube-apiserver/) address. Please change these to suit your cluster.
3131

3232
CLUSTERCIDR=10.32.0.0/12 \
3333
APISERVER=https://cluster01.int.domain.com:6443 \
@@ -37,7 +37,7 @@ This runs kube-router with pod/service networking, the network policy firewall,
3737

3838
### Removing a previous kube-proxy
3939

40-
If kube-proxy was never deployed to the cluster, this can likely be skipped.
40+
If [kube-proxy](https://kubernetes.io/docs/reference/generated/kube-proxy/) was never deployed to the cluster, this can likely be skipped.
4141

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

@@ -50,10 +50,10 @@ Any iptables rules kube-proxy left around will also need to be cleaned up. This
5050

5151
## Running kube-router without the service proxy
5252

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.
53+
This runs kube-router with pod/service networking and the network policy firewall. The Services proxy is disabled.
5454

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 -
55+
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/generic-kuberouter.yaml
56+
57+
In this mode kube-router relies on for example [kube-proxy](https://kubernetes.io/docs/reference/generated/kube-proxy/) to provide service networking.
58+
59+
When service proxy is disabled kube-router will use [in-cluster configuration](https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configuration) to access APIserver through cluster-ip. Service networking must therefore be setup before deploying kube-router.

daemonset/generic-kuberouter-all-features-advertise-routes.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data:
2525
- name: cluster
2626
cluster:
2727
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
28-
server: https://%APISERVER%
28+
server: %APISERVER%
2929
users:
3030
- name: kube-router
3131
user:

daemonset/generic-kuberouter-all-features.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ data:
2525
- name: cluster
2626
cluster:
2727
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
28-
server: https://%APISERVER%
28+
server: %APISERVER%
2929
users:
3030
- name: kube-router
3131
user:

daemonset/generic-kuberouter.yaml

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,6 @@ data:
1717
"type":"host-local"
1818
}
1919
}
20-
kubeconfig: |
21-
apiVersion: v1
22-
kind: Config
23-
clusterCIDR: %CLUSTERCIDR%
24-
clusters:
25-
- name: cluster
26-
cluster:
27-
certificate-authority: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
28-
server: %APISERVER%
29-
users:
30-
- name: kube-router
31-
user:
32-
tokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
33-
contexts:
34-
- context:
35-
cluster: cluster
36-
user: kube-router
37-
name: kube-router-context
38-
current-context: kube-router-context
3920
4021
---
4122
apiVersion: extensions/v1beta1
@@ -64,7 +45,6 @@ spec:
6445
- "--run-router=true"
6546
- "--run-firewall=true"
6647
- "--run-service-proxy=false"
67-
- "--kubeconfig=/var/lib/kube-router/kubeconfig"
6848
env:
6949
- name: NODE_NAME
7050
valueFrom:
@@ -82,9 +62,6 @@ spec:
8262
readOnly: true
8363
- name: cni-conf-dir
8464
mountPath: /etc/cni/net.d
85-
- name: kubeconfig
86-
mountPath: /var/lib/kube-router
87-
readOnly: true
8865
initContainers:
8966
- name: install-cni
9067
image: busybox
@@ -97,19 +74,12 @@ spec:
9774
TMP=/etc/cni/net.d/.tmp-kuberouter-cfg;
9875
cp /etc/kube-router/cni-conf.json ${TMP};
9976
mv ${TMP} /etc/cni/net.d/10-kuberouter.conf;
100-
fi;
101-
if [ ! -f /var/lib/kube-router/kubeconfig ]; then
102-
TMP=/var/lib/kube-router/.tmp-kubeconfig;
103-
cp /etc/kube-router/kubeconfig ${TMP};
104-
mv ${TMP} /var/lib/kube-router/kubeconfig;
10577
fi
10678
volumeMounts:
10779
- mountPath: /etc/cni/net.d
10880
name: cni-conf-dir
10981
- mountPath: /etc/kube-router
110-
name: kube-router-cfg
111-
- name: kubeconfig
112-
mountPath: /var/lib/kube-router
82+
name: kube-router-cfg
11383
hostNetwork: true
11484
tolerations:
11585
- key: CriticalAddonsOnly
@@ -127,9 +97,6 @@ spec:
12797
- name: kube-router-cfg
12898
configMap:
12999
name: kube-router-cfg
130-
- name: kubeconfig
131-
hostPath:
132-
path: /var/lib/kube-router
133100

134101
---
135102
apiVersion: v1

0 commit comments

Comments
 (0)