Skip to main content

OpenContrail integration with Mesos

By May 18, 2017Containers, Mesos

Note: This blog is coauthored by Aniket Gawade, Praneet Bachheti and Fawad Shaikh from Juniper Networks.

In this blog we’ll cover OpenContrail integration with Mesos. Mesos is a cluster management and orchestration framework. It gives us the flexibility to write our own schedulers (frameworks) and then plug them into the cluster management aspect of Mesos by registering these frameworks with Mesos Master. Mesos master via offer mechanism gets the resource information from all the slaves.

The following diagram lists the different components in a typical Mesos Architecture:

In order understand the integration between contrail and Mesos, it’s important to understand how a common application comes up in Mesos today.

  1. Based on the type of framework, user will create an application template (json, yaml etc), which in most cases will have the following parameters
    1. Name of the application (ID)
    2. Image name
    3. Network name
    4. Domain name
    5. Project name
  2. The request is sent to a framework.
  3. Framework which is registered to Mesos master will validate the request
  4. Framework scheduler picks a compute node and forwards the request to Mesos Master
  5. Mesos Master sends the request to the scheduled slave agent which is running on the compute node
  6. Slave invokes Mesos executor which creates the environment and launches the application

Having a general idea of the work flow, lets see what are the different components in the complete contrail-mesos architecture:

  1. Dockerized Contrail Components (Multiprocess containers):
    • Controller, Analytics, AnalyticsDB, vRouter-agent, Contrail-repo
  2. Mesos-Components:
    • Master, Mesos Agent, Framework(Marathon, Hadoop, redis etc), Mesos executor
  3. Contrail Mesos Components:
    • Contrail-CNI, Mesos Manager (containerized)

Contrail Mesos workflow:

  1. Request to framework to create application A
  2. Request send from the framework scheduler to Mesos Master
  3. Master forwards the task request to a particular Mesos Slave. This slave was chosen by the framework scheduler
  4. Mesos Slave invokes Mesos executor which launches application A
  5. CNI plugin is invoked when Mesos Slave issues a task
  6. CNI plugin connects to the REST API of contrail Mesos Manager which sends the request to the API server for IP address, creating contrail objects
  7. CNI plugin connects to the REST API vRouter to plug container  in to vRouter

The following video demonstrates the following:

  1. Create an application container via Mesos Marathon framework
  2. Contrail networking provides IP address to containers/applications
  3. Intra VN connectivity between Mesos applications
  4. Destroying of Mesos applications results in removal of open contrail objects