Simple bridge network for kubernetes
 
 
Go to file
kvaps 22537fba35 add: colors 2017-12-22 16:23:36 +01:00
images add: colors 2017-12-22 16:23:36 +01:00
Dockerfile rename start.sh to bridget.sh 2017-12-22 14:21:07 +01:00
LICENSE Create LICENSE 2017-12-22 13:49:56 +01:00
README.md Update README.md 2017-12-22 16:05:14 +01:00
bridget.sh add: cni config removing 2017-12-22 14:40:51 +01:00
bridget.yaml upd: name and variables 2017-12-22 12:32:22 +01:00

README.md

bridget

Simple bridge network for kubernetes

How it works

bridget - it's short shell script, that helps you for organise simple bridge network for Kubernetes. There is no overlays, no politics. Just flat L2-network across all your hosts and pods.

In addition bridget can automatically configure VLAN and bridge interfaces for that. See the picture:

bridget automatically retrieves IP-addresses from your pod-network, and configures cni for use it. Collision check is carried out each new run by arping tool.

Parameters

All parameters passing as environment variables:

  • BRIDGE (example: cbr0) - Bridge name. Mandatory option.
  • VLAN (example: 100) - VLAN id. If set, the new vlan-interface under IFACE will be created, then added to BRIDGE.
  • IFACE (example: eth0) - Physical interface for connect to bridge. Mandatory if VLAN is set, but can be used singly.
  • MTU (default: 1500) - MTU value for cni config
  • CHECK_SLAVES (example: 1) - Make bridget for configure slave interfaces, if bridge already exists.
  • POD_NETWORK (default: 10.244.0.0/16) - Your pod network.
  • DIVISION_PREFIX (default: 24) - Network CIDR prefix for devide your POD_NETWORK.
  • DEBUG (example: 1) - Enable verbose output.

Quick start

  • Instantiate your kubernetes with --pod-network-cidr=10.244.0.0/16 flag.

  • Download yaml file:

curl -o https://raw.githubusercontent.com/kvaps/bridget/master/bridget.yaml
  • Edit wanted parameters:
vim bridget.yaml

By default bridget uses cbr0 bridge that nowhere connected, so you need to set IFACE and VLAN parameters. Or make sure that your bridge is already configured for use some physical interface. Please make sure that you have no any IP-address on bridge, because will be configured automatcally.

  • Run daemonset:
kubectl create -f bridget.yaml

Alternatives

There is not much alternatives for kubernetes if you want to use flat L2-network.

As a rule, if such solutions are provided, like L2-modes for flannel or romana, it's still use difficult rules for nating and routing. Thanks to that you have flexible policies and some other things, but lose simplicity and productivity of simple L2-network.

Bridget was created under pipework's inspiration. pipework allows you to add single interfaces into your containers, but you need to do extra actions for achieve this. Besides Kubernetes knows nothing about any changes from this side.

Unlike pipework bridget uses CNI for configuring pod interfaces, as a result all configuration occurs automatically, and kubernetes gets right IP-addresses.

As alternative you can also consider сreate your own CNI configuration with bridge or macvlan plugin for each your host.

Contact

Contributing

To contribute bug patches or new features, you can use the github Pull Request model. It is assumed that code and documentation are contributed under the Apache License 2.0.

Reporting bugs

Please use github issue-tracker for submit bugs

License

bridget is under the Apache 2.0 license. See the LICENSE file for details.