Skip to content
This repository has been archived by the owner on Sep 24, 2021. It is now read-only.

Add support for more network plugins, e.g. flannel and calico #196

Merged
merged 3 commits into from
Aug 10, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cluster/allinone.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ EOF
}

setup-master() {
kubeadm init kubeadm init --pod-network-cidr ${CLUSTER_CIDR} --kubernetes-version stable
kubeadm init --pod-network-cidr ${CLUSTER_CIDR} --kubernetes-version stable
# Also enable schedule pods on the master for allinone.
export KUBECONFIG=/etc/kubernetes/admin.conf
kubectl taint nodes --all node-role.kubernetes.io/master-
Expand Down
5 changes: 5 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Frakti Documentation

- [Deployment](deploy.md)
- [E2E tests](e2e-tests.md)
- [Network Plugins](networking.md)
85 changes: 85 additions & 0 deletions docs/networking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Networking

Frakti is using CNI for setting up pod's networking. A list of validated plugins includes

- Bridge
- Flannel
- Calico

## [Bridge](https://github.com/containernetworking/plugins/tree/master/plugins/main/bridge)

Firstly, install CNI:

```sh
$ sudo mkdir -p /etc/cni/net.d /opt/cni/bin
$ git clone https://github.com/containernetworking/plugins $GOPATH/src/github.com/containernetworking/plugins
$ cd $GOPATH/src/github.com/containernetworking/plugins
$ ./build.sh
$ sudo cp bin/* /opt/cni/bin/
```

Then config CNI to use bridge and portmap plugin:

```sh
$ sudo sh -c 'cat >/etc/cni/net.d/10-mynet.conflist <<-EOF
{
"cniVersion": "0.3.1",
"name": "mynet",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"ipam": {
"type": "host-local",
"subnet": "10.30.0.0/16",
"routes": [
{ "dst": "0.0.0.0/0" }
]
}
},
{
"type": "portmap",
"capabilities": {"portMappings": true},
"snat": true
}
]
}
EOF'
$ sudo sh -c 'cat >/etc/cni/net.d/99-loopback.conf <<-EOF
{
"cniVersion": "0.3.1",
"type": "loopback"
}
EOF'
```

## [Flannel](https://github.com/coreos/flannel)

Remove other cni network configure if they are already configured:

```sh
rm -f /etc/cni/net.d/*
```

Then setup flannel plugin by running:

```sh
kubectl create -f https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel-rbac.yml
kubectl create -f https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel.yml
```

## [Calico](https://www.projectcalico.org)

Remove other cni network configure if they are already configured:

```sh
rm -f /etc/cni/net.d/*
```

Then setup calico plugin by running:

```sh
kubectl apply -f https://docs.projectcalico.org/v2.4/getting-started/kubernetes/installation/hosted/kubeadm/1.6/calico.yaml
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is thiskubeadm/1.6/ implying we should we use k8s 1.6?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it origins from calico's documentation, and supports kubernetes v1.6+

```
Loading