core

module
v1.0.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 8, 2017 License: Apache-2.0

README

Romana Core Components

License ReportCard GoDoc

Romana is a new Software Defined Network (SDN) solution specifically designed for the Cloud Native architectural style. The result of this focus is that Romana cloud networks are less expensive to build, easier to operate and deliver higher performance than cloud networks built using alternative SDN designs.

What's in this repository

This repository contains the core components of the Romana system: A series of cooperating microservices written in Go. These services currently are:

  • Root: Used as the starting point for services to discover each other. Also holds the configuration and serves relevant parts to the other services.
  • Tenant: Manages tenants in the Romana system, interfaces with environments such as OpenStack, to map their tenants to Romana tenants.
  • Topology: Keeps track of the network topology in which we are deployed, knows about hosts, racks, spines, etc. This information is the used by the IPAM service.
  • IPAM: Generates and manages the IP addresses Romana assigns to network endpoints. Uses the topology service to be able to create topology aware addresses.
  • Agent: Lives on hosts and there performs actions on behalf of Romana, such as creating interfaces, setting routes or iptables rules.
  • Auth: Serves authentication tokens to tenants and services.
  • CLI: Command Line Interface, which provides a reference romana API implmentation.

Getting started

Setup the Go development environment

First, you need to setup a Go development environment. You can skip this if you have a development environment already.

Option A: Using binary distribution

Option B: Installing from source

Download, build and test the Romana core source code

Once you have your Go environment, follow these steps to download, build and test the Romana core components:

  1. Prepare a Go workspace.
  2. Ensure your PATH is set to find your Go installation and binaries.
  3. Ensure the GOPATH environment variable is set to point at the root of your workspace.
  4. Inside of the workspace directory run: go get github.com/romana/core/... (the three dots at the end are part of the command).
  5. You may see an error at this point, complaining about No submodule mapping found in .gitmodules.... This is due to a known bug in "go get". You can fix that by running cd $GOPATH/src/github.com/romana/core ; git submodule update --init --recursive.
  6. If you wish to work with a specific branch or tag you need to run: git checkout <branchname> ; git submodule update --init --recursive.
  7. To run unit test for a specific Romana service run: go test -v github.com/romana/core/<name>, where <name> might be agent, root, ipam, tenant, policy or topology.
Update a running cluster with your modified code

If you use the 'romana-setup' script (provided in the https://github.com/romana/romana repository), you get an OpenStack DevStack cluster running on some EC2 instances. It installs a standard version of the Romana core components.

Let's say you have made changes to the core services and wish to test them on a running cluster. Here are the instructions describing how to replace the binaries on the cluster and how to restart the services:

  1. After successfully compiling your code locally, you will find the binaries in $GOPATH/bin as agent, root, ipam, tenant, policy, listener, romana and topology.

  2. Upload these binaries to every host in the cluster (every EC2 instance) with this command: rsync -e 'ssh -i <absolute path to your SSH key .ssh/ec2_id_rsa>' -azu --existing "$GOPATH/bin/" ubuntu@<ec2-ip-address>:~/romana/bin/. This command needs to be executed for every EC2 instance in the cluster. Please remember to specify the correct IP address of the EC2 instance and the absolute path to your SSH key where indicated.

  3. Log into the controller host and restart the services with these commands (note that only root and agent need to be re-started manually, other services will re-start on their own):

    for i in ipam tenant topology root agent policy listener; do
        sudo service romana-$i stop
    done
    sudo service romana-root start
    sudo service romana-agent start
    
  4. On the compute host(s), restart the services with these commands:

    sudo service romana-agent stop
    sudo service romana-agent start
    
Previous Releases

Previous Releases can be found here.

Directories

Path Synopsis
Package common contains various things common to all Romana services.
Package common contains various things common to all Romana services.
store
Package store provides routines for backing storage, currently supporting libkv and RDBMS-based backends.
Package store provides routines for backing storage, currently supporting libkv and RDBMS-based backends.
Command for running the IPAM service.
Command for running the IPAM service.
Main entry point for Kubernetes listener
Main entry point for Kubernetes listener
pkg
policy/enforcer
Policy enforcer package translates romana policies into iptables rules.
Policy enforcer package translates romana policies into iptables rules.
util/exec
Package provides wrapper around os.exec for purpose of testing
Package provides wrapper around os.exec for purpose of testing
util/iptsave
IPTsave is a library that provides IPtables type that can read iptables-save output and create a tokenized representation of it.
IPTsave is a library that provides IPtables type that can read iptables-save output and create a tokenized representation of it.
util/os
Package provides wrapper aound os module for purpose of testing
Package provides wrapper aound os module for purpose of testing
util/policy/cache
Policy cache package maintains local a local copy of all romana policies and provides updates when a policy added/deleted/modified.
Policy cache package maintains local a local copy of all romana policies and provides updates when a policy added/deleted/modified.
util/u32
Package generates masks for u32 iptables module to match Romana entities.
Package generates masks for u32 iptables module to match Romana entities.
Command for running the Policy Manager service.
Command for running the Policy Manager service.
Package romana contains romana/core related features which interact with the root/tenant/ipam/tenant and other related romana services.
Package romana contains romana/core related features which interact with the root/tenant/ipam/tenant and other related romana services.
adaptor
Package adaptor implements glue code for multiple platforms like openstack, kubernetes, etc.
Package adaptor implements glue code for multiple platforms like openstack, kubernetes, etc.
cmd
Package cmd contains various files for adding commands and subcommands to romana command line tools.
Package cmd contains various files for adding commands and subcommands to romana command line tools.
kubernetes
Package kubernetes implements kubernetes API specific helper functions.
Package kubernetes implements kubernetes API specific helper functions.
openstack
Package openstack implements openstack API specific helper functions.
Package openstack implements openstack API specific helper functions.
util
Package util contains common utility functions.
Package util contains common utility functions.
Command to launch root service
Command to launch root service
Command for running the Tenant service.
Command for running the Tenant service.
Package test for testing purpose.
Package test for testing purpose.
doc
Command to launch topology service
Command to launch topology service

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL