Skip to content

Commit

Permalink
Version 2.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
Satya Ranjan Pradhan committed Oct 9, 2018
1 parent edf4a4d commit edd2a5d
Show file tree
Hide file tree
Showing 6 changed files with 338 additions and 20 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ CNI Genie is an add-on to [Kuberenets](https://github.com/kubernetes/kubernetes)
- Isolated 'logical' networks for different tenants on a shared 'physical'network


6. [CNI-Genie network policy engine](docs/network-policy/README.md) for network level ACLs


7. Real-time switching between different (physical or logical) networks for a given workload. This allows for
- Price minimization: dynamically switching workload to a cheaper network as network prices change
- Maximizing network utilization: dynamically switching workload to the less congested network at a threshold

![image](docs/network-switching.PNG)



Note: CNI-Genie itself is NOT a routing solution! It makes a call to CNI plugins that provide routing service

### More docs here [Getting started](docs/GettingStarted.md), [CNI-Genie Feature Set](docs/CNIGenieFeatureSet.md)
6 changes: 3 additions & 3 deletions conf/1.8/genie.yaml
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,12 @@ data:
"romana_root": "http://__ROMANA_SERVICE_HOST__:__ROMANA_SERVICE_PORT__",
"segment_label_name": "romanaSegment"
}
---
# Install CNI-Genie plugin on each slave node.
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
name: genie
name: genie-plugin
namespace: kube-system
labels:
k8s-app: genie
Expand Down Expand Up @@ -129,7 +128,8 @@ spec:
# Installs required 00-genie.conf and genie binary
# on slave node.
- name: install-cni
image: quay.io/cnigenie/v1.5:latest
image: cnigenie/genie-plugin:latest
imagePullPolicy: Always
command: ["/launch.sh"]
env:
- name: CNI_NETWORK_CONFIG
Expand Down
11 changes: 5 additions & 6 deletions docs/GettingStarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$ kubeadm init --use-kubernetes-version=v1.7.0 --pod-network-cidr=10.244.0.0/16
```

For 1.8 version:
Version 1.8 onwards:
```
$ kubeadm init --pod-network-cidr=10.244.0.0/16
```
Expand All @@ -32,14 +32,14 @@
$ kubectl taint nodes --all dedicated-
```

For 1.8 version, run:
Version 1.8 onwards, run:
```
$ kubectl taint nodes --all node-role.kubernetes.io/master-
```

* One (or more) CNI plugin(s) installed, e.g., Canal, Weave, Flannel
* Use this [link](https://github.com/projectcalico/canal/tree/master/k8s-install) to install Canal
* One (or more) CNI plugin(s) installed, e.g., Calico, Weave, Flannel
* Use this [link](https://docs.projectcalico.org/v3.2/getting-started/kubernetes) to install Calico
* Use this [link](https://www.weave.works/docs/net/latest/kube-addon/) to install Weave
* Use this [link](https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml) to install Flannel

Expand All @@ -52,7 +52,7 @@ Till Kubernetes 1.7 version:
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/conf/1.5/genie.yaml
```

For Kubernetes 1.8 version:
Kubernetes 1.8 version onwards:
```
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/conf/1.8/genie.yaml
```
Expand Down Expand Up @@ -100,4 +100,3 @@ $ tail -f /var/log/syslog | grep 'CNI'
$ kubectl taint nodes --all node-role.kubernetes.io/master-
```
* Note: most plugins use differenet installation files for Kuberenetes 1.5, 1.6, 1.7 & 1.8. Make sure you use the right one!

102 changes: 102 additions & 0 deletions releases/v2.0/GettingStarted.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Getting started

### Prerequisite

* Linux box with
* We tested on Ubuntu 14.04 & 16.04
* Docker installed
* Kubernetes cluster running with CNI enabled
* One easy way to bring up a cluster is to use [kubeadm](https://kubernetes.io/docs/getting-started-guides/kubeadm/):
* We tested on Kubernetes 1.5, 1.6, 1.7, 1.8

Till 1.7 version:
```
$ kubeadm init --use-kubernetes-version=v1.7.0 --pod-network-cidr=10.244.0.0/16
```

Version 1.8 onwards:
```
$ kubeadm init --pod-network-cidr=10.244.0.0/16
```

Next steps:
```
$ mkdir -p $HOME/.kube
$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
$ sudo chown $(id -u):$(id -g) $HOME/.kube/config
```
* To schedule pods on the master, e.g. for a single-machine Kubernetes cluster,

Till 1.7 version, run:
```
$ kubectl taint nodes --all dedicated-
```

Version 1.8 onwards, run:
```
$ kubectl taint nodes --all node-role.kubernetes.io/master-
```

* One (or more) CNI plugin(s) installed, e.g., Calico, Weave, Flannel
* Use this [link](https://docs.projectcalico.org/v3.2/getting-started/kubernetes) to install Calico
* Use this [link](https://www.weave.works/docs/net/latest/kube-addon/) to install Weave
* Use this [link](https://github.com/coreos/flannel/blob/master/Documentation/kube-flannel.yml) to install Flannel

### Installing genie

We install genie as a Docker Container on every node

Till Kubernetes 1.7 version:
```
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/conf/1.5/genie.yaml
```

Kubernetes 1.8 version onwards:
```
$ kubectl apply -f https://raw.githubusercontent.com/Huawei-PaaS/CNI-Genie/master/releases/v2.0/genie.yaml
```
### Making changes to and build from source

Note that you should install genie first before making changes to the source. This ensures genie conf file is generated successfully.

After making changes to source, build genie binary by running:
```
$ make all
```
Place "genie" binary from dest/ into /opt/cni/bin/ directory.
```
$ cp dist/genie /opt/cni/bin/genie
```

### Test process

To run ginkgo tests for CNI-Genie run the following command:

If Kubernetes cluster is 1.7+
```
$ make test testKubeVersion=1.7 testKubeConfig=/root/admin.conf
```

If Kubernetes cluster is 1.5.x
```
$ make test testKubeVersion=1.5
```

### Genie Logs

For now Genie logs are stored in /var/log/syslog
To see the logs:
```
$ cat /dev/null > /var/log/syslog
$ tail -f /var/log/syslog | grep 'CNI'
```

### Troubleshooting

* 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:
```
$ kubectl taint nodes --all node-role.kubernetes.io/master-
```
* Note: most plugins use differenet installation files for Kuberenetes 1.5, 1.6, 1.7 & 1.8. Make sure you use the right one!
64 changes: 64 additions & 0 deletions releases/v2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# CNI-Genie

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
1. ['reference' CNI plugins](https://github.com/containernetworking/plugins), e.g., bridge, macvlan, ipvlan, loopback
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))
3. 'specialized' CNI plugins, e.g., [SR-IOV](https://github.com/hustcat/sriov-cni), DPDK (work-in-progress)
4. any generic CNI plugin of choice installed on the host

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.

[![Build Status](https://travis-ci.org/Huawei-PaaS/CNI-Genie.svg)](https://travis-ci.org/Huawei-PaaS/CNI-Genie)
[![Go Report Card](https://goreportcard.com/badge/github.com/Huawei-PaaS/CNI-Genie)](https://goreportcard.com/report/github.com/Huawei-PaaS/CNI-Genie)

Please feel free to post your feedback, questions on CNI-Genie [Slack channel](https://cni-genie.slack.com/)

## Demo
Here is a 6 minute demo video that demonstrates 3 scenarios
1. Assign an IP address to a pod from a particular network solution, e.g., 'Weave-net'
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'
3. Assign an IP address to a pod from the "less congested" network solution, e.g., from 'Canal' that is less congested

[![asciicast](https://asciinema.org/a/118191.png)](https://asciinema.org/a/118191)

# Contributing
[Contributing](CONTRIBUTING.md)

[Code of Conduct](CODE_OF_CONDUCT.md)

# Why we created CNI-Genie?

CNI Genie is an add-on to [Kuberenets](https://github.com/kubernetes/kubernetes) open-source project and is designed to provide the following features:

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
![image](docs/multiple-cni-plugins/what-cni-genie.png)
- 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
- Different CNI plugins are different in terms of need for port-mapping, NAT, tunneling, interrupting host ports/interfaces

[Watch multiple CNI plugins demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/multiple-cni-plugins/README.md#demo)


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
![image](docs/multiple-ips/multi-interface.PNG)

[Watch multi-NICs per 'container' demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/multiple-ips/README.md#demo)

[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)

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.
- CNI Genie watches KPI(s) of interest for existing CNI plugins, e.g., occupancy rate, number of subnets, latency, bandwidth

[Watch Smart CNI Plugin Selection demo](https://github.com/Huawei-PaaS/CNI-Genie/blob/master/docs/smart-cni-genie/README.md#demo)


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


5. Network isolation, i.e.,
- Dedicated 'physical' network for a tenant
- Isolated 'logical' networks for different tenants on a shared 'physical'network


Note: CNI-Genie itself is NOT a routing solution! It makes a call to CNI plugins that provide routing service

### More docs here [Getting started](GettingStarted.md)
Loading

0 comments on commit edd2a5d

Please sign in to comment.