Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Installing Contrail with Kubernetes by Using Juju Charms

 

You can deploy Contrail Networking using Juju Charms. Juju helps you deploy, configure, and efficiently manage applications on private clouds and public clouds. Juju accesses the cloud with the help of a Juju controller. A Charm is a module containing a collection of scripts and metadata and is used with Juju to deploy Contrail.

A Juju Charm helps you deploy Docker containers to the cloud. For more information on containerized Contrail, see Understanding Contrail Containers. Juju Charms simplifies Contrail deployment by providing a simple way to deploy, configure, scale, and manage Contrail operations.

Understanding Juju Charms with Kubernetes

Contrail supports the following charms:

  • contrail-agent

  • contrail-analytics

  • contrail-analyticsdb

  • contrail-controller

  • contrail-kubernetes-master

  • contrail-kubernetes-node

Preparing to Deploy Contrail with Kubernetes by Using Juju Charms

You can deploy Contrail Networking by using Juju bundle.

Follow these steps to prepare for deployment:

  1. Install Juju.
  2. Configure Juju.

    You can add a cloud to Juju, identify clouds supported by Juju, and manage clouds already added to Juju.

    Adding a cloud

    Juju already has knowledge of the AWS cloud, which means adding your AWS account to Juju is quick and easy.

    Note

    In versions prior to Juju v.2.6.0 the show-cloud command only operates locally. There is no --local option.

    You must ensure that Juju’s information is up to date (e.g. new region support). Run the following command to update Juju’s public cloud data:

    Juju recognizes a wide range of cloud types. You can use any one of the following methods to add a cloud credentials to Juju:

    • Adding a Cloud Credentials by Using Interactive Command

      Example: Adding AWS cloud credentials to Juju

    • Adding a Cloud Credentials Manually

      You can use a YAML configuration file to add AWS cloud credentials. Run the following command:

      For details, refer to Juju Adding Credentials from a File.

    Identifying a supported cloud

    Use the juju clouds command to list cloud types that are supported by Juju.

  3. Create a Juju controller.

    A Juju controller manages and keeps track of applications in the Juju cloud environment.

  4. Download the Contrail bundle from JAAS - Contrail Kubernetes.

Deploying Contrail Charms with Kubernetes

Juju Charms simplifies Contrail deployment by providing a simple way to deploy, configure, scale, and manage Contrail operations.

You can deploy Contrail Charms in a bundle or manually.

Deploying Contrail Charms in a Bundle

Follow these steps to deploy Contrail Charms in a bundle.

  1. Deploy Contrail Charms.

    To deploy Contrail Charms in a bundle, use the juju deploy <bundle_yaml_file> command.

    The following example shows you how to use a bundle YAML file to deploy Contrail on Amazon Web Services (AWS) Cloud.

    You can create or modify the Contrail Charm deployment bundle YAML file to:

    • Point to machines or instances where the Contrail Charms must be deployed.

    • Include the options you need.

      Each Contrail Charm has a specific set of options. The options you choose depend on the charms you select. For more information on the options that are available, see config.yaml file for each charm located at Contrail Charms.

  2. (Optional) Check the status of deployment.

    You can check the status of the deployment by using the juju status command.

  3. Enable configuration statements.

    Based on your deployment requirements, you can enable the following configuration statements:

Deploying Juju Charms with Kubernetes Manually

Before you begin deployment, ensure that you have:

  • Installed and configured Juju

  • Created a Juju controller

  • Installed Ubuntu 16.04 or Ubuntu 18.04

Follow these steps to deploy Juju Charms with Kubernetes manually:

  1. Create machine instances for Kubernetes master, Kubernetes workers, and Contrail.
  2. Deploy the Kubernetes services.

    Some of the applications may need an additional configuration.

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

    • By specifying the Kubernetes parameters in a YAML file

    • By using CLI

    • By using a combination of YAML-formatted file and CLI

    Note

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

    For more details, refer to Juju Application Configuration.

  3. Deploy and configure ntp, easyrsa, etcd, kubernetes-master, kubernetes-worker.
  4. Deploy and configure Contrail services.

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

    Note

    You must set the auth-mode parameter of the contrail-controller charm to no-auth if Contrail is deployed without a keystone.

  5. Enable applications to be available to external traffic:
  6. Enable contrail-controller and contrail-analytics services to be available to external traffic if you do not use HAProxy.
  7. Apply SSL.

    You can apply SSL if needed. To use SSL with Contrail services, deploy easy-rsa service and add-relation command to create relations to contrail-controller service and contrail-agent services.

  8. Add other necessary relations.

Related Documentation