Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Provisioning Contrail CNI for Kubernetes

You can use the following procedure to provision Contrail Container Network Interface (CNI) for Kubernetes.

Requirements

This procedure requires the following minimum virtual machine and host specifications:

  • 32 GB RAM

  • Eight vCPUs

  • 150 GB disk space

The supported software versions for provisioning Contrail CNI for Kubernetes are:

  • Kubernetes 1.6

  • Docker Engine versions 1.11.0 to 1.13.0

  • Ubuntu 16.04.2 or CentOS 7 operating systems

Preparing for Installation

Before provisioning Contrail CNI for Kubernetes, ensure the following prerequisites are met:

  1. Stop the firewall service and delete all the iptable rules.

    • For Ubuntu 16.04 host OS, use the following commands:

    • For CentOS 7 host OS, use the following commands:

  2. Ensure that the Kubernetes cluster is running. You can choose any method to install Kubernetes. For quick installation steps, use the following commands:

    • Commands for Ubuntu 16.04 host OS:

    • Commands for CentOS 7 host OS:

  3. Patch LivenessProbe and ReadinessProbe of kube-dns deployment using the following commands:

  4. (Optional) If you are re-provisioning Contrail on the same setup, ensure that you delete the configdb and analyticsdb data from the previous installation.

Overview

Kubernetes is an open source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure. Kubernetes supports a pluggable framework called CNI for most of the basic network connectivity, including container pod addressing, network isolation, policy-based security, a gateway, SNAT, load-balancer, and service chaining capability for Kubernetes orchestration. Contrail supports CNI for integrating Contrail with the Kubernetes automation platform.

Configuration

Procedure

Step-by-Step Procedure

To provision Contrail CNI for Kubernetes, perform the following steps:

  1. Git clone the contrail-docker repository.

  2. Change directory to contrail-docker/kubernetes/manifests/.

  3. Edit the single yaml file. You can use any editor to edit the file.

    • For Ubuntu 16.04 host OS:

    • For CentOS 7 host OS:

  4. Edit the following variables in configmap and change it according to your setup. Mandatory variables that must be changed are config_nodes, controller_nodes, analytics_nodes, analyticsdb_nodes, and api_server. Refer to Definable Input Variables While Provisioning Contrail for Kubernetes for more information.

  5. (Optional) If the setup is a single node setup then uncomment the following lines in contrail-agent daemonset.

  6. Deploy Contrail using the following command.

  7. Verify Contrail status on all Contrail containers. Look-up Contrail pod names using the following command.

  8. Check the contrail-status for all the pods, using the following command.

Troubleshooting

Problem

To check if Contrail pods are running.

Solution

Use the following command to list the Contrail pods:

Problem

To ensure that contrail-agent pod is displayed.

Solution

If the setup is a single node setup then uncomment the following lines in contrail-agent daemonset.

Problem

To bring up Contrail control plane pods on nodes other than the Kubernetes master.

Solution

Label the node as opencontrail.org/controller=true using the following command:

Problem

To delete the Contrail stack.

Solution

Use the following command to delete the Contrail stack: