Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Installing Contrail with Kubernetes in Nested Mode by Using Juju Charms

 

Contrail Networking Release 1909 and later support provisioning of a Kubernetes cluster inside an OpenStack cluster. Contrail Networking offers a nested control and data plane where a single Contrail control plane and a single network stack can manage and service both the OpenStack and Kubernetes clusters.

In nested mode, a Kubernetes cluster is provisioned in virtual machines of an OpenStack cluster. The CNI plugin and the Contrail-Kubernetes manager of the Kubernetes cluster interface directly with Contrail components that manage the OpenStack cluster.

All Kubernetes features, functions and specifications are supported when used in nested mode.

Note

Nested mode deployment is only supported for Contrail with OpenStack cluster.

Before you begin:

  • Deploy Contrail with OpenStack either on bare metal server or virtual machines.

    Best Practice

    Public cloud deployment is not recommended because of slow nested virtualization.

  • The VMs must have internet connectivity.

  • Contrail in underlay network must be configured to support nested mode.

    You must select an unused IP in the cluster to configure link-local.

    For example:

    10.10.10.5 is the selected service IP.

    LL Service Name

    Service IP

    Service Port

    Fabric IP

    Fabric Port

    K8s-cni-to-agent

    10.10.10.5

    9091

    127.0.0.1

    9091

Follow these steps to deploy Juju Charms with Kubernetes in nested mode using bundle deployment:

Use this method if you want to use the existing machines.

  1. Create a Juju controller.

    juju bootstrap --bootstrap-series=xenial <cloud name> <controller name>

    You can use OpenStack Cloud provider or manually spun-up VMs. For details, refer to Preparing to Deploy Contrail with Kubernetes by Using Juju Charms.

  2. Deploy bundle.

    juju deploy --series xenial cs:~containers/kubernetes-worker-550 --to:0 \

    --config channel="1.14/stable" \

    --config docker_runtime="custom" \

    If the machines for the setup are already provisioned, run the following command to deploy bundle:

    juju deploy --map-machines=existing,0=0,5=1 ./bundle.yaml

    where bundle-id=existing-id

    For details, refer to https://jaas.ai/u/juniper-os-software/contrail-k8s-nested/bundle.



or



Follow these steps to deploy Juju Charms with Kubernetes in nested mode manually:

  1. Create a Juju controller.

    juju bootstrap --bootstrap-series=xenial <cloud name> <controller name>

    You can use OpenStack Cloud provider or manually spun-up VMs. For details, refer to Preparing to Deploy Contrail with Kubernetes by Using Juju Charms.

  2. Create machine instances for Contrail components, Kubernetes master and Kubernetes workers.

    Sample constraints for minimal deployment:

    All-In-One deployment:

    juju add-machine --constraints mem=32G cores=8 root-disk=150G --series=xenial # for all-in-one machine

    or

    Multinode deployment:

    juju add-machine --constraints mem=8G cores=2 root-disk=50G --series=xenial # kubernetes workers

    juju add-machine --constraints mem=8G cores=2 root-disk=50G --series=xenial # kubernetes masters

    juju add-machine --constraints mem=4G cores=4 root-disk=50G --series=xenial # contrail components

    You can use any series—xenial or bionic.

  3. Add machines to the cloud.

    For details, refer to Using Constraints-Juju.

  4. Deploy the Kubernetes services.

    Some of the applications may need additional configuration.

    You can deploy Kubernetes services using any one of the following methods:

    • By specifying the Kubernetes parameters in a YAML file.

    • By passing options/values directly on the command line.

    Note

    You must use the same docker version for Contrail and Kubernetes.

    For more details, refer to Juju Application Configuration.

  5. Deploy and configure ntp, easyrsa, etcd, kubernetes-master, kubernetes-worker.
  6. Deploy and configure Contrail services.

    Deploy contrail-kubernetes-master, contrail-kubernetes-node, contrail-agent from the directory where you have downloaded the charms.

  7. Add the necessary relations.
  8. Apply SSL, if needed.

    You must provide the same certificates to the contrail-kubernetes-master node if Contrail in underlay cluster has SSL enabled.

Release History Table
Release
Description
Contrail Networking Release 1909 and later support provisioning of a Kubernetes cluster inside an OpenStack cluster. Contrail Networking offers a nested control and data plane where a single Contrail control plane and a single network stack can manage and service both the OpenStack and Kubernetes clusters.