This repository has been archived by the owner on Sep 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 115
Add support for more network plugins, e.g. flannel and calico #196
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this
kubeadm/1.6/
implying we should we use k8s 1.6?There was a problem hiding this comment.
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+