Skip to content

eda-labs/clab-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Containerlab EDA Connector Tool

Containerlab EDA Connector

Integrate your Containerlab topology seamlessly with EDA (Event-Driven Automation) to streamline network automation and management.

Overview

There are two primary methods to create and experiment with network functions provided by EDA:

  1. Real Hardware: Offers robust and reliable performance but can be challenging to acquire and maintain, especially for large-scale setups.
  2. Sandbox System: Highly flexible and cost-effective but limited in adding secondary containers like authentication servers or establishing external connectivity.

Containerlab bridges these gaps by providing an elegant solution for network emulation using container-based topologies. This tool enhances your Containerlab experience by automating the onboarding process into EDA, ensuring a smooth and efficient integration.

🚨 Important Requirements

Important

EDA Installation Mode: This tool requires EDA to be installed with Simulate=False. Ensure that your EDA deployment is configured accordingly.

Hardware License: A valid hardware license for EDA version 24.12.1 is mandatory for using this connector tool.

Containerlab Topologies: Your Containerlab nodes should NOT have startup-configs defined. Nodes with startup-configs are not EDA-ready and will not integrate properly.

Prerequisites

Before running the Containerlab EDA Connector tool, ensure the following prerequisites are met:

  • EDA Setup:
    • Installed without simulation (Simulate=False).
    • Contains a valid hardware license for version 24.12.1.
  • Network Connectivity:
    • EDA nodes can ping the Containerlab's management IP.
  • Containerlab:
    • Minimum required version - v0.62.2
    • Nodes should not have startup-configs defined
  • kubectl:
    • You must have kubectl installed and configured to connect to the same Kubernetes cluster that is running EDA. The connector will use kubectl apply in the background to create the necessary Artifact resources.

Note

Proxy Settings: This tool does utilize the system's proxy ($HTTP_PROXY and $HTTPS_PROXY ) variables.

Installation

Follow these steps to set up the Containerlab EDA Connector tool:

Tip

Why uv? uv is a single, ultra-fast tool that can replace pip, pipx, virtualenv, pip-tools, poetry, and more. It automatically manages Python versions, handles ephemeral or persistent virtual environments (uv venv), lockfiles, and often runs 10–100× faster than pip installs.

  1. Install uv (no Python needed):

    # On Linux and macOS
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
  2. Install clab-connector

    uv tool install git+https://github.com/eda-labs/clab-connector.git
    
  3. Run the Connector

    clab-connector --help
    

Tip

Upgrade clab-connector to the latest version using uv tool upgrade clab-connector.

Checking Version and Upgrading

To check the currently installed version of clab-connector:

uv tool list

To upgrade clab-connector to the latest version:

uv tool upgrade clab-connector

Alternative: Using pip

If you'd rather use pip or can't install uv:

  1. Create & Activate a Virtual Environment after cloning:

    python -m venv venv
    source venv/bin/activate
    
  2. Install Your Project (which reads pyproject.toml for dependencies):

    pip install .
    
  3. Run the Connector:

    clab-connector --help
    

Usage

The tool offers two primary subcommands: integrate and remove.

Integrate Containerlab with EDA

To integrate your Containerlab topology with EDA you need the path to the topology-data.json file created by Containerlab when it deploys the lab. This file resides in the Containerlab Lab Directory as described in the documentation. Once you have the path, run the following command:

clab-connector integrate \
  --topology-data path/to/topology-data.json \
  --eda-url https://eda.example.com \
  --eda-user youruser \
  --eda-password yourpassword
Option Required Default Description
--topology-data, -t Yes None Path to the Containerlab topology data JSON file
--eda-url, -e Yes None EDA deployment hostname or IP address
--eda-user No admin EDA username
--eda-password No admin EDA password
--kc-user No admin Keycloak master realm admin user
--kc-password No admin Keycloak master realm admin password
--kc-secret No None Use given EDA client secret and skip Keycloak flow
--log-level, -l No INFO Logging level (DEBUG/INFO/WARNING/ERROR/CRITICAL)
--log-file, -f No None Optional log file path
--verify No False Enable certificate verification for EDA
--skip-edge-intfs No False Skip creation of edge links and their interfaces

Note

When SR Linux and SR OS nodes are onboarded, the connector creates the admin user with default passwords of NokiaSrl1! for SR Linux and NokiaSros1! for SROS.

Remove Containerlab Integration from EDA

Remove the previously integrated Containerlab topology from EDA:

clab-connector remove \
    --topology-data path/to/topology-data.json \
    --eda-url https://eda.example.com \
    --eda-user youruser \
    --eda-password yourpassword
Option Required Default Description
--topology-data, -t Yes None Path to the Containerlab topology data JSON file
--eda-url, -e Yes None EDA deployment hostname or IP address
--eda-user No admin EDA username
--eda-password No admin EDA password
--kc-user No admin Keycloak master realm admin user
--kc-password No admin Keycloak master realm admin password
--kc-secret No None Use given EDA client secret and skip Keycloak flow
--log-level, -l No INFO Logging level (DEBUG/INFO/WARNING/ERROR/CRITICAL)
--log-file, -f No None Optional log file path
--verify No False Enable certificate verification for EDA

Export a lab from EDA to Containerlab

clab-connector export-lab \
    --namespace eda
Option Required Default Description
--namespace, -n Yes None Namespace in which the lab is deployed in EDA
--output, -o No None Output .clab.yaml file path
--log-level, -l No INFO Logging level (DEBUG/INFO/WARNING/ERROR/CRITICAL)
--log-file No None Optional log file path

Generate CR YAML Manifests

The generate-crs command allows you to generate all the CR YAML manifests that would be applied to EDA—grouped by category. By default all manifests are concatenated into a single file. If you use the --separate flag, the manifests are written into separate files per category (e.g. artifacts.yaml, init.yaml, node-security-profile.yaml, etc.). You can also use --skip-edge-intfs to omit edge link resources and their interfaces.

Combined file example:
clab-connector generate-crs \
  --topology-data path/to/topology-data.json \
  --output all-crs.yaml
Separate files example:
clab-connector generate-crs \
  --topology-data path/to/topology-data.json \
  --separate \
  --output manifests
Option Required Default Description
--topology-data, -t Yes None Path to the Containerlab topology data JSON file
--output, -o No None Output file path or directory
--separate No False Generate separate YAML files for each CR
--log-level, -l No INFO Logging level (DEBUG/INFO/WARNING/ERROR/CRITICAL)
--log-file, -f No None Optional log file path
--skip-edge-intfs No False Skip creation of edge links and their interfaces

Example Command

clab-connector -l INFO integrate -t topology-data.json -e https://eda.example.com

Example Topologies

Explore the example-topologies directory for sample Containerlab topology files to get started quickly.

Requesting Support

If you encounter issues or have questions, please reach out through the following channels:

Tip

Running the script with -l INFO or -l DEBUG flags can provide additional insights into any failures or issues.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your enhancements.

Acknowledgements

About

Integrate Containerlab topologies with EDA

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •