diff --git a/apis/v1alpha1/topology.go b/apis/v1alpha1/topology.go index 7462affc..b948e37a 100644 --- a/apis/v1alpha1/topology.go +++ b/apis/v1alpha1/topology.go @@ -38,10 +38,13 @@ type TopologySpec struct { // images. // +optional ImagePull ImagePull `json:"imagePull"` - // EnableSlurpeeth enables experimental slurpeeth for connectivity between nodes on different - // launchers. - // +optional - EnableSlurpeeth bool `json:"enableSlurpeeth"` + // Connectivity defines the type of connectivity to use between nodes in the topology. The + // default behavior is to use vxlan tunnels, alternatively you can enable a more experimental + // "slurpeeth" connectivity flavor that stuffs traffic into tcp tunnels to avoid any vxlan mtu + // and/or fragmentation challenges. + // +kubebuilder:validation:Enum=vxlan;slurpeeth + // +kubebuilder:default=vxlan + Connectivity string `json:"connectivity"` } // TopologyStatus is the status for a Topology resource. diff --git a/assets/crd/clabernetes.containerlab.dev_topologies.yaml b/assets/crd/clabernetes.containerlab.dev_topologies.yaml index 3325c912..c5e00b3b 100644 --- a/assets/crd/clabernetes.containerlab.dev_topologies.yaml +++ b/assets/crd/clabernetes.containerlab.dev_topologies.yaml @@ -45,6 +45,17 @@ spec: spec: description: TopologySpec is the spec for a Topology resource. properties: + connectivity: + default: vxlan + description: |- + Connectivity defines the type of connectivity to use between nodes in the topology. The + default behavior is to use vxlan tunnels, alternatively you can enable a more experimental + "slurpeeth" connectivity flavor that stuffs traffic into tcp tunnels to avoid any vxlan mtu + and/or fragmentation challenges. + enum: + - vxlan + - slurpeeth + type: string definition: description: |- Definition defines the actual set of nodes (network ones, not k8s ones!) that this Topology @@ -310,10 +321,6 @@ spec: type: array type: object type: object - enableSlurpeeth: - description: EnableSlurpeeth enables experimental slurpeeth for connectivity - between nodes on different launchers. - type: boolean expose: description: Expose holds configurations relevant to how clabernetes exposes a topology. @@ -407,6 +414,7 @@ spec: type: string type: object required: + - connectivity - definition type: object status: diff --git a/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml b/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml index 3325c912..c5e00b3b 100644 --- a/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml +++ b/charts/clabernetes/crds/clabernetes.containerlab.dev_topologies.yaml @@ -45,6 +45,17 @@ spec: spec: description: TopologySpec is the spec for a Topology resource. properties: + connectivity: + default: vxlan + description: |- + Connectivity defines the type of connectivity to use between nodes in the topology. The + default behavior is to use vxlan tunnels, alternatively you can enable a more experimental + "slurpeeth" connectivity flavor that stuffs traffic into tcp tunnels to avoid any vxlan mtu + and/or fragmentation challenges. + enum: + - vxlan + - slurpeeth + type: string definition: description: |- Definition defines the actual set of nodes (network ones, not k8s ones!) that this Topology @@ -310,10 +321,6 @@ spec: type: array type: object type: object - enableSlurpeeth: - description: EnableSlurpeeth enables experimental slurpeeth for connectivity - between nodes on different launchers. - type: boolean expose: description: Expose holds configurations relevant to how clabernetes exposes a topology. @@ -407,6 +414,7 @@ spec: type: string type: object required: + - connectivity - definition type: object status: diff --git a/controllers/topology/deployment.go b/controllers/topology/deployment.go index 12f8b1e3..d81e0eef 100644 --- a/controllers/topology/deployment.go +++ b/controllers/topology/deployment.go @@ -451,11 +451,6 @@ func (r *DeploymentReconciler) renderDeploymentContainerEnv( } } - connectivityKind := clabernetesconstants.ConnectivityVXLAN - if owningTopology.Spec.EnableSlurpeeth { - connectivityKind = clabernetesconstants.ConnectivitySlurpeeth - } - envs := []k8scorev1.EnvVar{ { Name: clabernetesconstants.NodeNameEnv, @@ -518,7 +513,7 @@ func (r *DeploymentReconciler) renderDeploymentContainerEnv( }, { Name: clabernetesconstants.LauncherConnectivityKind, - Value: connectivityKind, + Value: owningTopology.Spec.Connectivity, }, } @@ -989,7 +984,7 @@ func (r *DeploymentReconciler) DetermineNodesNeedingRestart( continue } - if owningTopology.Spec.EnableSlurpeeth { + if owningTopology.Spec.Connectivity == clabernetesconstants.ConnectivitySlurpeeth { determineNodeNeedsRestartSlurpeeth(reconcileData, nodeName) } else if !reflect.DeepEqual(nodeConfig, reconcileData.PreviousConfigs[nodeName]) { reconcileData.NodesNeedingReboot.Add(nodeName) diff --git a/generated/openapi/openapi_generated.go b/generated/openapi/openapi_generated.go index ac758c29..e755c5a2 100644 --- a/generated/openapi/openapi_generated.go +++ b/generated/openapi/openapi_generated.go @@ -1640,16 +1640,16 @@ func schema_srl_labs_clabernetes_apis_v1alpha1_TopologySpec( ), }, }, - "enableSlurpeeth": { + "connectivity": { SchemaProps: spec.SchemaProps{ - Description: "EnableSlurpeeth enables experimental slurpeeth for connectivity between nodes on different launchers.", - Default: false, - Type: []string{"boolean"}, + Description: "Connectivity defines the type of connectivity to use between nodes in the topology. The default behavior is to use vxlan tunnels, alternatively you can enable a more experimental \"slurpeeth\" connectivity flavor that stuffs traffic into tcp tunnels to avoid any vxlan mtu and/or fragmentation challenges.", + Default: "", + Type: []string{"string"}, Format: "", }, }, }, - Required: []string{"definition"}, + Required: []string{"definition", "connectivity"}, }, }, Dependencies: []string{