Skip to content

Release 0.52#

2024-03-05 ยท Full Changelog

In #1914 @steiler made a big leap forward by unblocking links creation between the nodes. Previously a link could only be created between the nodes if both node-backing containers were running.

This interdependency between the links and nodes was a big blocker for the stages feature, since you couldn't, say, make one node to wait on another if they had a link between them. Effectively this reduced the usefullness of the stages particularly for VM-based nodes.

Now, the links creation is handled on a per-node basis, which means that a node creates its side of the link as soon as it is ready, regardless of the state of the other node. The other node will pick its part of the link and attach it whenever it is ready.

This change makes it possible for nodeA to depend on nodeB using stages, even if they have a link between them. Here is how it works:

sequenceDiagram
    autonumber
    participant A as Node A
    participant H as Host NS
    participant B as Node B

    Note over A: Reaches healthy stage
    activate A
    loop Healthcheck
        B->>B: waiting to reach the healthy stage
    end
    A->>H: Creates a veth pair with remote end<br/> in the host namespace
    Note over B: reaches healthy stage
    activate B
    B->>H: takes the remote end from the host<br/>namespace and attaches it to the container
    A->>B: The veth link has been created
    deactivate A
    deactivate B

With links asynchronous creation, you can now define the stages for your nodes and make them wait on each other using the wait-for feature!

Per-stage exec#

With Stages introduction in the previous release, we opened new possibilities for the nodes lifecycle management. Now, @steiler expanded it even further by adding the per-stage exec option to the stages.

With per-stage command execution the user can define exec block under each stage; moreover, it is possible to specify when the commands should be run on-enter or on-exit of the stage.

nodes:
  node1:
    stages:
      create-links:
        exec:
          on-enter:
            - ls /sys/class/net/

In the example above, the ls /sys/class/net/ command will be executed when node1 is about to enter the create-links stage. As expected, the command will list only interfaces provisioned by docker (eth0 and lo), but none of the containerlab-provisioned interfaces, since the create-links stage has not been finished yet.

Per-stage command execution gives you additional flexibility in terms of when the commands are executed, and what commands are executed at each stage.

k8s-kind extra options#

In #1912 @YutaroHayakawa added kind options to containerlab definition file to add extra extensibility to the way you can deploy kind clusters.

Miscellaneous#

  • long-named links will use interface's AltName instead of Aliases #1908
  • fixed doubled log messages for SR OS nodes #1919