2 Installing the Multus Module

This chapter discusses how to install the Multus module in Oracle Cloud Native Environment.

Prerequisites

This section contains the prerequisite information you might need to set up the Multus module.

Updating Proxy Configuration

If you're using a proxy server in the environment, edit the CRI-O proxy configuration file and add the Kubernetes service IP (the default is 10.96.0.1) to the NO_PROXY variable. For example, on each Kubernetes node, edit the /etc/systemd/system/crio.service.d/proxy.conf file:

[Service]
Environment="HTTP_PROXY=http://proxy.example.com:3128"
Environment="HTTPS_PROXY=https://proxy.example.com:3128"
Environment="NO_PROXY=mydomain.example.com,10.96.0.1"

Reload the configuration file and restart the crio service:

sudo systemctl daemon-reload
sudo systemctl restart crio.service

Note:

You don't need to perform this step if you're using the olcnectl provision command to perform a quick installation. This is set up for you automatically when using that installation method and you provide any proxy information.

Creating a Multus Configuration File

You can optionally provide a Multus configuration file to set up NetworkAttachmentDefinitions when you deploy the Multus module.

If you deploy the Multus module without a configuration file, the Multus module is created with no NetworkAttachmentDefinitions set up. You can then create NetworkAttachmentDefinitions using the kubectl command after the module is installed.

The configuration file must contain one or more Kubernetes NetworkAttachmentDefinition Custom Resource Definitions (CRDs). These definitions set up the network attachments, which configure the secondary interfaces for pods. You provide a Multus configuration file on the operator node in YAML format. For example:

---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: bridge-conf
spec:
  config: '{
      ...
      }
    }'
---
apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: macvlan-conf
spec:
  config: '{
      ...
      }
    }'

The Platform API Server uses the information contained in the configuration file when creating the Multus module to create any NetworkAttachmentDefinitions.

For information on creating the Multus configuration file, see the upstream Multus documentation.

Deploying the Multus Module

This section contains the information on how to install the Multus module. You must have a Kubernetes module installed before you install Multus. The Kubernetes module uses Flannel as the default Kubernetes pod networking CNI.

For the syntax to use to create a Multus module, see the multus option of the olcnectl module create command in Platform Command-Line Interface.

To deploy the Multus module:

  1. Create and install a Kubernetes module. The name of the Kubernetes module in this example is mycluster.

  2. Create a Multus module and associate it with the Kubernetes module named mycluster using the --multus-kubernetes-module option. In this example, the Multus module is named mymultus.

    olcnectl module create \
    --environment-name myenvironment \
    --module multus \
    --name mymultus \
    --multus-kubernetes-module mycluster 

    The --module option sets the module type to create, which is multus. You define the name of the Multus module using the --name option, which in this case is mymultus.

    The --multus-kubernetes-module option sets the name of the Kubernetes module.

    You can optionally provide the --multus-config option to set the location for a Multus configuration file. This file must be available on the operator node under the provided path. For information on creating this configuration file, see Prerequisites.

    If you don't include all the required options when adding the module, you're prompted to provide them.

    Important:

    Multus is deployed to the Kubernetes kube-system namespace by default. If you're creating NetworkAttachmentDefinitions when you deploy the module using a configuration file, specify the namespace in which to create these with the --multus-namespace option. Both the Multus pods and the NetworkAttachmentDefinitions are created in this namespace when you use a configuration file. Any Kubernetes applications that use these NetworkAttachmentDefinitions must also be created in the namespace you specify with this option. For example:

    --multus-namespace default
  3. Use the olcnectl module install command to install the Multus module. For example:

    olcnectl module install \
    --environment-name myenvironment \
    --name mymultus

    You can optionally use the --log-level option to set the level of logging displayed in the command output. By default, error messages are displayed. For example, you can set the logging level to show all messages when you include:

    --log-level debug

    The log messages are also saved as an operation log. You can view operation logs as commands are running, or when they've completed. For more information using operation logs, see Platform Command-Line Interface.

    The Multus module is deployed into the Kubernetes cluster.

Verifying the Multus Module Deployment

You can verify the Multus module is deployed using the olcnectl module instances command on the operator node. For example:

olcnectl module instances \
--environment-name myenvironment

The output looks similar to:

INSTANCE                  MODULE        STATE  
mymultus                  multus        installed 
mycluster                 kubernetes    installed
...

Note the entry for multus in the MODULE column is in the installed state.

In addition, use the olcnectl module report command to review information about the module. For example, use the following command to review the Multus module named mymultus in myenvironment:

olcnectl module report \
--environment-name myenvironment \
--name mymultus \
--children

For more information on the syntax for the olcnectl module report command, see Platform Command-Line Interface.