Skip to content
This repository was archived by the owner on Mar 3, 2025. It is now read-only.

Commit edd2a5d

Browse files
author
Satya Ranjan Pradhan
committed
Version 2.0 release
1 parent edf4a4d commit edd2a5d

File tree

6 files changed

+338
-20
lines changed

6 files changed

+338
-20
lines changed

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,6 @@ CNI Genie is an add-on to [Kuberenets](https://github.com/kubernetes/kubernetes)
5959
- Isolated 'logical' networks for different tenants on a shared 'physical'network
6060

6161

62-
6. [CNI-Genie network policy engine](docs/network-policy/README.md) for network level ACLs
63-
64-
65-
7. Real-time switching between different (physical or logical) networks for a given workload. This allows for
66-
- Price minimization: dynamically switching workload to a cheaper network as network prices change
67-
- Maximizing network utilization: dynamically switching workload to the less congested network at a threshold
68-
69-
![image](docs/network-switching.PNG)
70-
71-
72-
7362
Note: CNI-Genie itself is NOT a routing solution! It makes a call to CNI plugins that provide routing service
7463

7564
### More docs here [Getting started](docs/GettingStarted.md), [CNI-Genie Feature Set](docs/CNIGenieFeatureSet.md)

conf/1.8/genie.yaml

100755100644
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,12 @@ data:
8888
"romana_root": "http://__ROMANA_SERVICE_HOST__:__ROMANA_SERVICE_PORT__",
8989
"segment_label_name": "romanaSegment"
9090
}
91-
9291
---
9392
# Install CNI-Genie plugin on each slave node.
9493
kind: DaemonSet
9594
apiVersion: extensions/v1beta1
9695
metadata:
97-
name: genie
96+
name: genie-plugin
9897
namespace: kube-system
9998
labels:
10099
k8s-app: genie
@@ -129,7 +128,8 @@ spec:
129128
# Installs required 00-genie.conf and genie binary
130129
# on slave node.
131130
- name: install-cni
132-
image: quay.io/cnigenie/v1.5:latest
131+
image: cnigenie/genie-plugin:latest
132+
imagePullPolicy: Always
133133
command: ["/launch.sh"]
134134
env:
135135
- name: CNI_NETWORK_CONFIG

docs/GettingStarted.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
$ kubeadm init --use-kubernetes-version=v1.7.0 --pod-network-cidr=10.244.0.0/16
1515
```
1616
17-
For 1.8 version:
17+
Version 1.8 onwards:
1818
```
1919
$ kubeadm init --pod-network-cidr=10.244.0.0/16
2020
```
@@ -32,14 +32,14 @@
3232
$ kubectl taint nodes --all dedicated-
3333
```
3434
35-
For 1.8 version, run:
35+
Version 1.8 onwards, run:
3636
```
3737
$ kubectl taint nodes --all node-role.kubernetes.io/master-
3838
```
3939
4040
41-
* One (or more) CNI plugin(s) installed, e.g., Canal, Weave, Flannel
42-
* Use this [link](https://github.com/projectcalico/canal/tree/master/k8s-install) to install Canal
41+
* One (or more) CNI plugin(s) installed, e.g., Calico, Weave, Flannel
42+
* Use this [link](https://docs.projectcalico.org/v3.2/getting-started/kubernetes) to install Calico
4343
* Use this [link](https://www.weave.works/docs/net/latest/kube-addon/) to install Weave
4444
* Use this [link](https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml) to install Flannel
4545
@@ -52,7 +52,7 @@ Till Kubernetes 1.7 version:
5252
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/conf/1.5/genie.yaml
5353
```
5454
55-
For Kubernetes 1.8 version:
55+
Kubernetes 1.8 version onwards:
5656
```
5757
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/conf/1.8/genie.yaml
5858
```
@@ -100,4 +100,3 @@ $ tail -f /var/log/syslog | grep 'CNI'
100100
$ kubectl taint nodes --all node-role.kubernetes.io/master-
101101
```
102102
* Note: most plugins use differenet installation files for Kuberenetes 1.5, 1.6, 1.7 & 1.8. Make sure you use the right one!
103-

releases/v2.0/GettingStarted.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Getting started
2+
3+
### Prerequisite
4+
5+
* Linux box with
6+
* We tested on Ubuntu 14.04 & 16.04
7+
* Docker installed
8+
* Kubernetes cluster running with CNI enabled
9+
* One easy way to bring up a cluster is to use [kubeadm](https://kubernetes.io/docs/getting-started-guides/kubeadm/):
10+
* We tested on Kubernetes 1.5, 1.6, 1.7, 1.8
11+
12+
Till 1.7 version:
13+
```
14+
$ kubeadm init --use-kubernetes-version=v1.7.0 --pod-network-cidr=10.244.0.0/16
15+
```
16+
17+
Version 1.8 onwards:
18+
```
19+
$ kubeadm init --pod-network-cidr=10.244.0.0/16
20+
```
21+
22+
Next steps:
23+
```
24+
$ mkdir -p $HOME/.kube
25+
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
26+
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
27+
```
28+
* To schedule pods on the master, e.g. for a single-machine Kubernetes cluster,
29+
30+
Till 1.7 version, run:
31+
```
32+
$ kubectl taint nodes --all dedicated-
33+
```
34+
35+
Version 1.8 onwards, run:
36+
```
37+
$ kubectl taint nodes --all node-role.kubernetes.io/master-
38+
```
39+
40+
41+
* One (or more) CNI plugin(s) installed, e.g., Calico, Weave, Flannel
42+
* Use this [link](https://docs.projectcalico.org/v3.2/getting-started/kubernetes) to install Calico
43+
* Use this [link](https://www.weave.works/docs/net/latest/kube-addon/) to install Weave
44+
* Use this [link](https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml) to install Flannel
45+
46+
### Installing genie
47+
48+
We install genie as a Docker Container on every node
49+
50+
Till Kubernetes 1.7 version:
51+
```
52+
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/conf/1.5/genie.yaml
53+
```
54+
55+
Kubernetes 1.8 version onwards:
56+
```
57+
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/releases/v2.0/genie.yaml
58+
```
59+
### Making changes to and build from source
60+
61+
Note that you should install genie first before making changes to the source. This ensures genie conf file is generated successfully.
62+
63+
After making changes to source, build genie binary by running:
64+
```
65+
$ make all
66+
```
67+
Place "genie" binary from dest/ into /opt/cni/bin/ directory.
68+
```
69+
$ cp dist/genie /opt/cni/bin/genie
70+
```
71+
72+
### Test process
73+
74+
To run ginkgo tests for CNI-Genie run the following command:
75+
76+
If Kubernetes cluster is 1.7+
77+
```
78+
$ make test testKubeVersion=1.7 testKubeConfig=/root/admin.conf
79+
```
80+
81+
If Kubernetes cluster is 1.5.x
82+
```
83+
$ make test testKubeVersion=1.5
84+
```
85+
86+
### Genie Logs
87+
88+
For now Genie logs are stored in /var/log/syslog
89+
To see the logs:
90+
```
91+
$ cat /dev/null > /var/log/syslog
92+
93+
$ tail -f /var/log/syslog | grep 'CNI'
94+
```
95+
96+
### Troubleshooting
97+
98+
* Note: one a single node cluster, after your Kubernetes master is initialized successfully, make sure you are able to schedule pods on the master by running:
99+
```
100+
$ kubectl taint nodes --all node-role.kubernetes.io/master-
101+
```
102+
* Note: most plugins use differenet installation files for Kuberenetes 1.5, 1.6, 1.7 & 1.8. Make sure you use the right one!

releases/v2.0/README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# CNI-Genie
2+
3+
CNI-Genie enables container orchestrators ([Kubernetes](https://github.com/kubernetes/kubernetes), [Mesos](https://mesosphere.com/)) to seamlessly connect to the choice of CNI plugins installed on a host, including
4+
1. ['reference' CNI plugins](https://github.com/containernetworking/plugins), e.g., bridge, macvlan, ipvlan, loopback
5+
2. '3rd-party' CNI plugins, e.g., ([Calico](https://github.com/projectcalico/calico), [Romana](https://github.com/romana/romana), [Weave-net](https://github.com/weaveworks/weave))
6+
3. 'specialized' CNI plugins, e.g., [SR-IOV](https://github.com/hustcat/sriov-cni), DPDK (work-in-progress)
7+
4. any generic CNI plugin of choice installed on the host
8+
9+
Without CNI-Genie, the orchestrator is bound to only a single CNI plugin. E.g., for the case of Kubernetes, without CNI-Genie, kubelet is bound to only a single CNI plugin passed to kubelet on start. CNI-Genie allows for the co-existance of multiple CNI plugins in runtime.
10+
11+
[![Build Status](https://travis-ci.org/Huawei-PaaS/CNI-Genie.svg)](https://travis-ci.org/Huawei-PaaS/CNI-Genie)
12+
[![Go Report Card](https://goreportcard.com/badge/github.com/Huawei-PaaS/CNI-Genie)](https://goreportcard.com/report/github.com/Huawei-PaaS/CNI-Genie)
13+
14+
Please feel free to post your feedback, questions on CNI-Genie [Slack channel](https://cni-genie.slack.com/)
15+
16+
## Demo
17+
Here is a 6 minute demo video that demonstrates 3 scenarios
18+
1. Assign an IP address to a pod from a particular network solution, e.g., 'Weave-net'
19+
2. Assign multi-IP addresses to a pod from multiple network solutions, e.g., 1st IP address from 'Weave-net', 2nd IP address from 'Canal'
20+
3. Assign an IP address to a pod from the "less congested" network solution, e.g., from 'Canal' that is less congested
21+
22+
[![asciicast](https://asciinema.org/a/118191.png)](https://asciinema.org/a/118191)
23+
24+
# Contributing
25+
[Contributing](CONTRIBUTING.md)
26+
27+
[Code of Conduct](CODE_OF_CONDUCT.md)
28+
29+
# Why we created CNI-Genie?
30+
31+
CNI Genie is an add-on to [Kuberenets](https://github.com/kubernetes/kubernetes) open-source project and is designed to provide the following features:
32+
33+
1. [wide range of network offerings, CNI plugins](docs/multiple-cni-plugins/README.md), available to the users in runtime. This figure shows Kubernetes CNI Plugin landscape before and after CNI-Genie
34+
![image](docs/multiple-cni-plugins/what-cni-genie.png)
35+
- User-story: based on "performance" requirements, "application" requirements, “workload placement” requirements, the user could be interested to use different CNI plugins for different application groups
36+
- Different CNI plugins are different in terms of need for port-mapping, NAT, tunneling, interrupting host ports/interfaces
37+
38+
[Watch multiple CNI plugins demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/multiple-cni-plugins/README.md#demo)
39+
40+
41+
2. [Multiple NICs per container & per pod](docs/multiple-ips/README.md). The user can select multiple NICs to be added to a container upon creating them. Each NIC can get an IP address from an existing CNI plugin of choice. This makes the container reachable across multiple networks. Some use-cases from [SIG-Network](https://github.com/kubernetes/community/wiki/SIG-Network) are depicted in the figure below
42+
![image](docs/multiple-ips/multi-interface.PNG)
43+
44+
[Watch multi-NICs per 'container' demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/multiple-ips/README.md#demo)
45+
46+
[Watch multi-NICs per 'pod' demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/multiple-ips/README.md#feature-2-extension-cni-genie-multiple-ip-addresses-per-pod) (IP addresses assigned not only to the container, but also to the Pod)
47+
48+
3. The user can leave the CNI plugin selection to CNI-Genie. CNI-Genie watches the Key Performance Indicator (KPI) that is of interest to the user and [selects the CNI plugin](docs/smart-cni-genie/README.md), accordingly.
49+
- CNI Genie watches KPI(s) of interest for existing CNI plugins, e.g., occupancy rate, number of subnets, latency, bandwidth
50+
51+
[Watch Smart CNI Plugin Selection demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/smart-cni-genie/README.md#demo)
52+
53+
54+
4. [Default plugin support](docs/default-plugin/README.md). Another useful feature from genie. Using this, we can ensure to get ip address(es) for a pod by selecting default set of plugins
55+
56+
57+
5. Network isolation, i.e.,
58+
- Dedicated 'physical' network for a tenant
59+
- Isolated 'logical' networks for different tenants on a shared 'physical'network
60+
61+
62+
Note: CNI-Genie itself is NOT a routing solution! It makes a call to CNI plugins that provide routing service
63+
64+
### More docs here [Getting started](GettingStarted.md)

0 commit comments

Comments
 (0)