Sign inSign up

ohmyadd/ovn-node

By ohmyadd

•Updated over 6 years ago

Image
0

2.7K

ohmyadd/ovn-node repository overview

⁠Architecture

⁠Overview

  • network: provide capacity of generate any topology
  • application: specify application containers
  • juction: plug apps into corresponding logical switch port in ovn

⁠Network layer

  • central node running:
    • ovn northdb + ovn northd + ovn southdb
    • can be running as deployment in k8s in anywhere
  • every hypervisor running:
    • ovn controller + ovs switchd + ovs db
    • must be running as daemonset in k8s on each compute node

⁠Application layer

  • now docker-compose is used (only single node)
  • maybe openstack or k8s or openstack + zun(kvm & docker mixed) later

⁠Junction component

  • a docker libnetwork remote driver is implemented for connecting apps into switch
  • source code in infra/driver

⁠Install

  • start ovn central, ovn node and docker libnetwork remote drvier (single node deploy)
    • cd infra/ovn/
    • docker-compose up -d
  • ip netns reach docker's netns
    • ln -s /var/run/docker/netns/ /var/run/netns
    • after reboot this link command should be run again
  • install docker-compose and its dependencies

    • docker-compose under version 1.25 is based on python2.7 which is no longer supported
    • pip3 install docker-compose==1.26.0rc1
    • pip3 install -r https://raw.githubusercontent.com/docker/compose/1.26.0-rc1/requirements.txt
  • modify compose's source code, and make compose create container first, then connect its networks

    • vi /usr/local/lib/python3.6/site-packages/compose/service.py
      1. change connect under container.start()
    • def start_container(self, container, use_network_aliases=True):
          self.connect_container_to_networks(container, use_network_aliases)
          try:
              container.start()
          except APIError as ex:
      
    • def start_container(self, container, use_network_aliases=True):
          try:
              container.start()
              self.connect_container_to_networks(container, use_network_aliases)
          except APIError as ex:
      
      1. do not pass any netowrk arguments to dockerd when create container
    • def build_default_networking_config(self):
          return {}
      
  • when dokcer-compose throw error: WARNING: Connection pool is full, discarding connection:localhost

    • count of compose parallel process larger than urllib3 default pool's size
    • COMPOSE_PARALLEL_LIMIT should a little higher than pool default maxsize
      1. export COMPOSE_PARALLEL_LIMIT=30; export COMPOSE_HTTP_TIMEOUT=6000
      1. vi /usr/local/lib/python3.6/site-packages/docker/transport/unixconn.py
    • class UnixHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
          def __init__(self, base_url, socket_path, timeout=60, maxsize=15):
      
  • yum install python-lxml

⁠Run a topology

  • edit source code
    • open draw.io⁠
    • export a chart xml in topology/src
    • modify it to what you want
    • finally you can export the chart as xml
    • do not export as compressed file
    • do not use formatted text in any component in chart
  • convert src to ir
    • cd topology/front
    • python3 drawio.py your-chart-name.xml
  • run it up
    • cd topology/back
    • ./all your-chart-name up
    • ./all your-chart-name down
    • it's better to systemctl restart docker every time you turn down the apps
  • new front complier plugin
    • you can write some new code to convert anything into IR

⁠Error handling

  • ./all run up or down stuck:
    1. rm /var/lib/docker/network/files/local-kv.db
    2. reboot
    3. docker rm -f $(docker ps -qa)
    4. start again

Tag summary

Content type

Image

Digest

Size

101.7 MB

Last updated

over 6 years ago

docker pull ohmyadd/ovn-node