Configuration

The Controller is configured with a env-based configuration file, controller.env.

The config/controller.env file contains an example of configuration for the Controller, which is the configuration used by default:

controller.env
#!/usr/bash

##############################################################################
################### Controller example configuration file  ###################
##############################################################################

# Controller example configuration file.

# This is used to enable/disable features for the controller and 
# to set configuration parameters.
#

# To provide the configuration settings defined in this script, pass
# the path of this script as parameter when you start the controller.
#   $ controller --env-path .env
# For more information, check the documentation.

# Note that the configuration settings contained in this script are
# defined as environment variables; therefore you can also load the
# configuration by sourcing this script.

# Some settings can be also passed as command-line arguments when you
# start the controller. Command-line arguments have priority over the
# variables defined in this script.



##############################################################################
############################## General settings ##############################
##############################################################################

# Must debug logs be enabled? (optional, default: True)
# export DEBUG=True

# Must persistency be enabled? (optional, default: False)
export ENABLE_PERSISTENCY=False

##############################################################################



##############################################################################
############################ gRPC server settings ############################
##############################################################################

# Must the gRPC server be enabled on the controller? (default: False)
# export ENABLE_GRPC_SERVER=True

# IP address of the gRPC server (:: means 'listen on any addrs', default: ::)
export GRPC_SERVER_IP=::

# Number of port on which the gRPC server is reachable (default: 12345)
export GRPC_SERVER_PORT=12345

# Must gRPC server use secure channels? (default: False)
# export GRPC_SERVER_SECURE=True

# Path to the certificate of Certification Authority (CA) 
# required by gRPC secure mode (default: 'cert_client.pem')
# export GRPC_SERVER_CERTIFICATE_PATH=/tmp/ca.crt

# Path to the private key of the server required by gRPC secure mode
# (default: 'key_server.pem')
# export GRPC_SERVER_KEY_PATH=/tmp/server.key

##############################################################################



##############################################################################
############################ gRPC client settings ############################
##############################################################################

# Must gRPC client use secure channels? (default: False)
# export GRPC_SECURE=True

# Must gRPC use secure channels? (default: False)
# export GRPC_CA_CERTIFICATE_PATH=/tmp/ca.crt

##############################################################################



##############################################################################
############################# ArangoDB configuration #########################
##############################################################################

# Must ArangoDB modules be enabled on the controller? (default: False)
export ENABLE_ARANGO_INTEGRATION=True

# URL of the ArangoDB server
export ARANGO_URL=http://localhost:8529

# Username for the authentication with the ArangoDB server
export ARANGO_USER=root

# Password for the authentication with the ArangoDB server
export ARANGO_PASSWORD=12345678

##############################################################################



##############################################################################
################################# Kafka settings #############################
##############################################################################

# Must Kafka modules be enabled on the controller? (default: False)
export ENABLE_KAFKA_INTEGRATION=True

# IP and port of the Kafka servers
export KAFKA_SERVERS=kafka:9092

##############################################################################

If you want to override the default settings, you can create a controller.env file containing the desired configuration parameters.

The next section shows the available configuration options.

Configuration options

This section shows a list of the available configuration options for the Controller. You can set configuration parameters by using the syntax of the environment variables:

export ATTRIBUTE=VALUE

where ATTRIBUTE is the name of the configuration option that you want to set and VALUE is the value to be assigned to the option.

To use your custom configuration, you can pass your .env configuration file to the Controller when it is started, as explained in the Load configuration section.

General settings

General settings for controller.env

Attribute

Type

Default

Description

GRPC_SECURE

boolean

False

If True, the Controller will use the TLS
to encrypt and authenticate the traffic
sent to the Node Manager on the gRPC
Channel.

GRPC_CA_CERTIFICATE_PATH

string

None

Name of CA certificate for the TLS,
required if GRPC_SECURE is True.

DEBUG

boolean

False

If True, the debug logging is enabled.

ArangoDB settings

Some features offered by the Controller are related to ArangoDB, such as exporting the network topology to a database.

If you want to use these features, you need to enable the ArangoDB integration and to configure the parameters listed in this section.

If you are not interested in using features that depend on ArangoDB, you can skip this section.

ArangoDB settings for controller.env

Attribute

Type

Default

Description

ENABLE_ARANGO_INTEGRATION

boolean

False

If True, the ArangoDB features
are enabled.

ARANGO_URL

string

None

The URL of the ArangoDB database,
required if
ENABLE_ARANGO_INTEGRATION
is True.

ARANGO_USER

string

None

The username used to log in the
ArangoDB database, required if
ENABLE_ARANGO_INTEGRATION
is True.

ARANGO_PASSWORD

string

None

The password used to log in the
ArangoDB database, required if
ENABLE_ARANGO_INTEGRATION
is True.

Note

the db_update library is required to support ArangoDB integration. Follow the instructions provided in Optional requirements section to setup the required dependencies.

Kafka settings

Some features offered by the Controller are related to Kafka, such as exporting the performance measurement data.

If you want to use these features, you need to enable the Kafka integration and to configure the parameters listed in this section.

If you are not interested in using features that depend on Kafka, you can skip this section.

Kafka settings for controller.env

Attribute

Type

Default

Description

ENABLE_KAFKA_INTEGRATION

boolean

False

If True, the Kafka features are enabled.

KAFKA_SERVERS

string

None

A comma-separated list of Kafka servers
(e.g. “kafka:9092,localhost9000”).

Note

the kafka-python package is required to support Kafka integration. Follow the instructions provided in Optional requirements section to setup the required dependencies.

gRPC server settings

The Controller uses the gRPC protocol to interact with the nodes. In most use-cases it acts as a gRPC client, while the node executes the gRPC server. Optionally, you can also executes a gRPC server on the Controller. This enables several use-cases where the nodes need to send information to the Controller (e.g. performance measurement data). This section explains how to enable and configure this functionality.

gRPC server settings for controller.env

Attribute

Type

Default

Description

ENABLE_GRPC_SERVER

boolean

False

If True, a gRPC server will be
started on the Controller.
This will enable the creation of
(Node -> Controller) gRPC Channels.
This feature allows a Node to
contact the Controller and
it is used in some use-case
like performance monitoring.

GRPC_SERVER_IP

string

::

The IP address on which the gRPC
server will listen for
connections (“::” means “any”).

GRPC_SERVER_PORT

integer

12345

The TCP port on which the gRPC
server will listen for connections.

GRPC_SERVER_SECURE

boolean

False

If True, the Controller will use
the TLS to encrypt and authenticate
the traffic exchanged with the
Node Manager on the
(Node -> Controller) gRPC Channel.

GRPC_SERVER_CERTIFICATE_PATH

string

None

Name of the server certificate for
the TLS, required if
GRPC_SERVER_SECURE is True.

GRPC_SERVER_KEY_PATH

string

None

Name of the server private key for
the TLS, required if
GRPC_SERVER_SECURE is True.

Verifying configuration

You can verify that your configuration is correct with the check_controller_config script:

check_controller_config /etc/rose-srv6-control-plane/controller.env

Configuration examples

For an example of configuration, you can see the config/controller.env file. It is the default configuration used by the Controller. You can use this file as a template for your custom configuration.

Load configuration

In order to load your configuration in the Controller, you can pass the path of your controller.env configuration file when you start the Controller:

$ controller --env-file controller.env

For more information about the usage of the Controller and the supported Command-Line arguments, see the Usage section.

Command-Line arguments

You can interact with the Controller through a CLI. You can provide Command-Line arguments to the CLI to override the settings written in your controller.env file such as paths for certificate files and port numbers.

For more information about the CLI and the supported Command-Line arguments, see the Usage section.