Skip to content

Installing Contrail CNI on Kubernetes

dinesh80 edited this page Jun 4, 2018 · 16 revisions

Contrail CNI can be installed on a Kubernetes cluster through multiple provisioning schemes.

This wiki will describe the most simplest of all: A single yaml based install

Pre-requisites

A running Kubernetes cluster

 There are multiple options available to user. The most simplest being [kubeadm](https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/)

 Alternatively if you would like to install Contrail and K8s cluster together, you can use [Contrail Ansible Deployer](https://github.com/Juniper/contrail-ansible-deployer/wiki/Contrail-microservice-installation-with-kubernetes). 

Installation

Installation of Contrail is a 3-step process.

Step 1

Download Contrail single yaml file

curl https://github.com/Juniper/contrail-controller/wiki/contrail.yml | awk '/<pre><code>/{flag=1;next}/<\/pre>/{flag=0}flag' > contrail.yml

Step 2

Label your Kubernetes master node.

kubectl label node $HOSTNAME opencontrail.org/controller=true

Step 3

Install Contrail.

Note: Replace x.x.x.x with the IP of your Kubernetes Master node.

K8S_MASTER_IP=x.x.x.x; cat contrail.yml | sed "s/{{ K8S_MASTER_IP }}/$K8S_MASTER_IP/g" | kubectl apply  -f -

What just happened ?

Hurray! Welcome to Contrail.

  1. You installed Contrail CNI in your Kubernetes node. If new compute nodes are added to your Kubernetes cluster, Contrail CNI will be propogated to them auto-magically as it is backed by a Kubernetes DaemaonSet.

  2. You installed entire Contrail Networking suite with rich Networking, Analytics, Security, Visualization functions, to name a few.

  3. Contrail UI is available on port 8143 of your node. Feel free to play around. About Contrail

https://x.x.x.x:8143
Default credentials: admin/contrail123

Check Contrail Status

You can get the status of Contrail compoenents, by running "contrail-status" command line tool in your Kubernetes master node. This will list all Contrail components running in your system.

[root@foo ~]# contrail-status
Pod         Service         Original Name                          State    Status         
            zookeeper       contrail-external-zookeeper            running  Up 35 minutes  
analytics   alarm-gen       contrail-analytics-alarm-gen           running  Up 35 minutes  
analytics   api             contrail-analytics-api                 running  Up 35 minutes  
analytics   collector       contrail-analytics-collector           running  Up 35 minutes  
analytics   nodemgr         contrail-nodemgr                       running  Up 33 minutes  
analytics   query-engine    contrail-analytics-query-engine        running  Up 35 minutes  
analytics   snmp-collector  contrail-analytics-snmp-collector      running  Up 35 minutes  
analytics   topology        contrail-analytics-topology            running  Up 34 minutes  
config      api             contrail-controller-config-api         running  Up 35 minutes  
config      cassandra       contrail-external-cassandra            running  Up 35 minutes  
config      device-manager  contrail-controller-config-devicemgr   running  Up 35 minutes  
config      nodemgr         contrail-nodemgr                       running  Up 33 minutes  
config      rabbitmq        contrail-external-rabbitmq             running  Up 35 minutes  
config      schema          contrail-controller-config-schema      running  Up 35 minutes  
config      svc-monitor     contrail-controller-config-svcmonitor  running  Up 35 minutes  
control     control         contrail-controller-control-control    running  Up 35 minutes  
control     dns             contrail-controller-control-dns        running  Up 35 minutes  
control     named           contrail-controller-control-named      running  Up 35 minutes  
control     nodemgr         contrail-nodemgr                       running  Up 33 minutes  
database    cassandra       contrail-external-cassandra            running  Up 35 minutes  
database    kafka           contrail-external-kafka                running  Up 35 minutes  
database    nodemgr         contrail-nodemgr                       running  Up 34 minutes  
kubernetes  kube-manager    contrail-kubernetes-kube-manager       running  Up 35 minutes  
vrouter     agent           contrail-vrouter-agent                 running  Up 34 minutes  
vrouter     nodemgr         contrail-nodemgr                       running  Up 33 minutes  
webui       job             contrail-controller-webui-job          running  Up 35 minutes  
webui       web             contrail-controller-webui-web          running  Up 35 minutes  

WARNING: container with original name 'contrail-external-zookeeper' have Pod os Service empty. Pod: '' / Service: 'zookeeper'. Please pass NODE_TYPE with pod name to container's env

vrouter kernel module is PRESENT
== Contrail control ==
control: active
nodemgr: initializing (NTP state unsynchronized. ) . <-- Safe to ignore
named: active
dns: active

== Contrail kubernetes ==
kube-manager: active

== Contrail database ==
kafka: active
nodemgr: initializing (NTP state unsynchronized. ) . <-- Safe to ignore
zookeeper: inactive                                  <-- Safe to ignore
cassandra: active

== Contrail analytics ==
nodemgr: initializing (NTP state unsynchronized. ) . <-- Safe to ignore
api: active
collector: active
query-engine: active
alarm-gen: active

== Contrail webui ==
web: active
job: active

== Contrail vrouter ==
nodemgr: initializing (NTP state unsynchronized. )    <-- Safe to ignore
agent: active

== Contrail config ==
api: active
zookeeper: inactive                                   <-- Safe to ignore
svc-monitor: active
nodemgr: initializing (NTP state unsynchronized. ) .  <-- Safe to ignore
device-manager: active
cassandra: active
rabbitmq: active
schema: active

Get to know Contrail more

All about Contrail

Contrail and Kubernetes Intro

Clone this wiki locally