Miniature: Containernet fork that allows to use Kubernete cluster nodes as hosts in emulated networks
Miniature leverage Kind to bootstrap kubernetes clusters, where each container represent a kubernete node. These containers are connect through Containernet to construct emulated networks.
The features that are supported by Containernet are also supported in Miniature.
- Kind website: https://kind.sigs.k8s.io/
- Containernet website: https://containernet.github.io/
- Mininet website: http://mininet.org
- Original Mininet repository: https://github.com/mininet/mininet
- Add a Kubernete cluster (currently only supporting Kind) to Mininet topologies
Following are what supported by Containernet
- Add, remove Docker containers to Mininet topologies
- Connect Docker containers to topology (to switches, other containers, or legacy Mininet hosts)
- Execute commands inside containers by using the Mininet CLI
- Dynamic topology changes
- Add hosts/containers to a running Mininet topology
- Connect hosts/docker containers to a running Mininet topology
- Remove Hosts/Docker containers/links from a running Mininet topology
- Resource limitation of Docker containers
- CPU limitation with Docker CPU share option
- CPU limitation with Docker CFS period/quota options
- Memory/swap limitation
- Change CPU/mem limitations at runtime!
- Expose container ports and set environment variables of containers through Python API
- Traffic control links (delay, bw, loss, jitter)
- Automated installation based on Ansible playbook
Automatic installation is provided through an Ansible playbook.
Requires: Ubuntu Linux 18.04 LTS and Python3 Experimental: Ubuntu Linux 20.04 LTS and Python3
$ sudo apt-get install ansible git aptitude
$ git clone https://github.com/violetbingzhe/miniature
$ cd miniature/ansible
$ sudo ansible-playbook -i "localhost," -c local install.yml
$ cd ..
Wait (and have a coffee) ...
You can switch between development (default) and normal installation as follows:
sudo make develop
# or
sudo make install
Follow instruction from here: https://github.com/kubernetes-sigs/kind
Start example topology with one Docker container and two kubernetes nodes connected to the network.
- run:
sudo python3 kube_example_kind.py
In your custom topology script you can add kubernete cluster like this:
net = KubeSim(controller=Controller)
info('*** Adding docker containers\n')
# config is optional
net.addKubeCluster("test", config = "config/kind.yaml")
# adding a control plane node
k1 = net.addKubeNode("test", "k1", role = "control-plane", type = "kind")
# adding a worker node
k2 = net.addKubeNode("test", "k2", role = "worker", type = "kind")
# can add a docker container into the topology
d1 = net.addDocker('d1', ip='172.18.0.10', dimage="ubuntu:trusty")
For more features, you could find it on Mininet or Containernet website.
More details TBD.
Bingzhe Liu
- Mail: <bingzhe (at) illinois (dot) edu>