Contiv

Contiv是思科开源的容器网络方案,是一个用于跨虚拟机、裸机、公有云或私有云的异构容器部署的开源容器网络架构,并与主流容器编排系统集成。Contiv最主要的优势是直接提供了多租户网络,并支持L2(VLAN), L3(BGP), Overlay (VXLAN)以及思科自家的ACI。

Contiv - 图1

主要特征

  • 原生的Tenant支持,一个Tenant就是一个virtual routing and forwarding (VRF)
  • 两种网络模式
    • L2 VLAN Bridged
    • Routed network, e.g. vxlan, BGP, ACI
  • Network Policy,如Bandwidth, Isolation等

Contiv - 图2

Contiv - 图3

Contiv - 图4

Contiv - 图5

Kubernetes集成

Ansible部署见https://github.com/kubernetes/contrib/tree/master/ansible/roles/contiv

  1. export VERSION=1.0.0-beta.3
  2. curl -L -O https://github.com/contiv/install/releases/download/$VERSION/contiv-$VERSION.tgz
  3. tar xf contiv-$VERSION.tgz
  4. cd ~/contiv/contiv-$VERSION/install/k8s
  5. netctl --netmaster http://$netmaster:9999 global set --fwd-mode routing
  6. cd ~/contiv/contiv-$VERSION
  7. install/k8s/install.sh -n 10.87.49.77 -v b -w routing
  8. # check contiv pods
  9. export NETMASTER=http://10.87.49.77:9999
  10. netctl global info
  11. # create a network
  12. # netctl network create --encap=vlan --pkt-tag=3280 --subnet=10.100.100.215-10.100.100.220/27 --gateway=10.100.100.193 vlan3280
  13. netctl net create -t default --subnet=20.1.1.0/24 default-net
  14. # create BGP connections to each of the nodes
  15. netctl bgp create devstack-77 --router-ip="30.30.30.77/24" --as="65000" --neighbor-as="65000" --neighbor="30.30.30.2"
  16. netctl bgp create devstack-78 --router-ip="30.30.30.78/24" --as="65000" --neighbor-as="65000" --neighbor="30.30.30.2"
  17. netctl bgp create devstack-71 --router-ip="30.30.30.79/24" --as="65000" --neighbor-as="65000" --neighbor="30.30.30.2"
  18. # then create pod with label "io.contiv.network"

参考文档