Skip to content

Commit

Permalink
Kubernetes networking: improve documentation and upgrade versions
Browse files Browse the repository at this point in the history
  • Loading branch information
giorio94 committed Sep 3, 2020
1 parent dd7d27f commit af69b69
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 765 deletions.
1 change: 1 addition & 0 deletions infrastructure/kubernetes-networking/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
calico.yaml
29 changes: 12 additions & 17 deletions infrastructure/kubernetes-networking/README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
## Kubernetes Networking - CNI Setup
# Kubernetes Networking - CNI Setup

In order to correctly setup the cluster, the [calico.yaml](calico.yaml) configuration file of the CNI have been slightly modified. In particular the pod network CIDR has been configured as shown in the following snippet:
As for it concerns Kubernetes networking, we selected [Project Calico](https://www.projectcalico.org/), since it is one of the most popular CNI plugins.
In short, it limits the overhead by requiring no overlay and supports advanced features such as the definition of network policies to isolate the traffic between different containers.

```yaml
...
- name: CALICO_IPV4POOL_CIDR
value: "172.16.0.0/16"
...
```

Now, apply the [calico.yaml](calico.yaml) file:
## Calico Installation
In order to install Calico, you can perform the following operations, which will download the default configuration from the official webpage and apply it customizing the pod network CIDR according to the selected cluster setup:

```sh
$ kubectl apply -f calico.yaml
```bash
$ export CALICO_VERSION=v3.16
$ curl https://docs.projectcalico.org/${CALICO_VERSION}/manifests/calico.yaml -o calico.yaml
$ kubectl apply -k .
```

This will setup Calico with the following networking configuration of the cluster:
- IP addresses of pods: 172.16.0.0/16
- IP addresses of services: 10.96.0.0/12

IP addresses of the worker nodes are outside CALICO configuration.
## Selected cluster networking configuration
- IP addresses of pods: 172.16.0.0/16
- IP addresses of services: 10.96.0.0/12
13 changes: 13 additions & 0 deletions infrastructure/kubernetes-networking/calico-patch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: calico-node
namespace: kube-system
spec:
template:
spec:
containers:
- name: calico-node
env:
- name: CALICO_IPV4POOL_CIDR
value: "172.16.0.0/16"
Loading

0 comments on commit af69b69

Please sign in to comment.