Commit e46f2e65 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into...

Merge branch 'develop' of ssh://gifrerenom_labs.etsi.org/tfs/controller into feat/430-cttc-extended-mwc2026-demo-scenario
parents 54de1e79 1321a3a0
Loading
Loading
Loading
Loading
+1 −0
Changes for .gitlab-ci.yml: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -75,6 +75,7 @@ include:
  - local: '/src/simap_connector/.gitlab-ci.yml'
  - local: '/src/pluggables/.gitlab-ci.yml'
  - local: '/src/logical_resources/.gitlab-ci.yml'
  - local: '/src/spine_leaf/.gitlab-ci.yml'

  # This should be last one: end-to-end integration tests
  - local: '/src/tests/.gitlab-ci.yml'
+101 −0
Changes for manifests/spine_leafservice.yaml: 101 added lines, 0 removed lines.
Original line number Diff line number Diff line
# Copyright 2022-2026 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: spine-leafservice
spec:
  selector:
    matchLabels:
      app: spine-leafservice
  #replicas: 1
  template:
    metadata:
      labels:
        app: spine-leafservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: labs.etsi.org:5050/tfs/controller/spine_leaf:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 30240
            - containerPort: 9192
          env:
            - name: LOG_LEVEL
              value: "INFO"
          startupProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:30240"]
            failureThreshold: 30
            periodSeconds: 1
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:30240"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:30240"]
          resources:
            requests:
              cpu: 250m
              memory: 128Mi
            limits:
              cpu: 1000m
              memory: 1024Mi
---
apiVersion: v1
kind: Service
metadata:
  name: spine-leafservice
  labels:
    app: spine-leafservice
spec:
  type: ClusterIP
  selector:
    app: spine-leafservice
  ports:
    - name: grpc
      protocol: TCP
      port: 30240
      targetPort: 30240
    - name: metrics
      protocol: TCP
      port: 9192
      targetPort: 9192

# TODO: Cannot be auto-scaled until a proper database is implemented.
#---
#apiVersion: autoscaling/v2
#kind: HorizontalPodAutoscaler
#metadata:
#  name: spine-leafservice-hpa
#spec:
#  scaleTargetRef:
#    apiVersion: apps/v1
#    kind: Deployment
#    name: spine-leafservice
#  minReplicas: 1
#  maxReplicas: 20
#  metrics:
#    - type: Resource
#      resource:
#        name: cpu
#        target:
#          type: Utilization
#          averageUtilization: 80
#  #behavior:
#  #  scaleDown:
#  #    stabilizationWindowSeconds: 30
+3 −0
Changes for my_deploy.sh: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -100,6 +100,9 @@ export TFS_COMPONENTS="context device pathcomp service nbi webui"
# Uncomment to activate Logical Resources.
#export TFS_COMPONENTS="${TFS_COMPONENTS} logical_resources"

# Uncomment to activate Spine Leaf.
#export TFS_COMPONENTS="${TFS_COMPONENTS} spine_leaf"

# Uncomment to activate Load Generator
#export TFS_COMPONENTS="${TFS_COMPONENTS} load_generator"

proto/spine_leaf.proto

0 → 100644
+113 −0
Changes for proto/spine_leaf.proto: 113 added lines, 0 removed lines.
Original line number Diff line number Diff line
// Copyright 2022-2026 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


syntax = "proto3";
package spine_leaf;

service SpineLeaf {
  rpc DefineSpineLeafFabric(FabricSettings           ) returns (FabricDefinitionResponse) {}
  rpc SetDeviceAsSpine     (SetDeviceRoleRequest     ) returns (ConfigSetting           ) {}
  rpc SetDeviceAsLeaf      (SetDeviceRoleRequest     ) returns (ConfigSetting           ) {}
  rpc SetDeviceAsGateway   (SetDeviceRoleRequest     ) returns (ConfigSetting           ) {}
  rpc DeployDeviceConfig   (DeployDeviceConfigRequest) returns (DeployResponse          ) {}
  rpc UnsetDeviceRole      (UnsetDeviceRoleRequest   ) returns (OperationStatus         ) {}
  rpc GetFabricInventory   (FabricScope              ) returns (FabricInventory         ) {}
  rpc GetDeviceConfig      (DeviceConfigQuery        ) returns (ConfigSetting           ) {}
}

message FabricSettings {
  string fabric_name = 1;           // Fabric identifier like dc1-fabric or any other name 
  string underlay_type = 3;        // "bgp" | "ospf" | "isis"
  string overlay_type = 4;         // "vxlan" | "bgp_evpn"
  uint32 spine_count = 5;          // Number of spines
  uint32 leaf_count = 6;           // Number of leaves
  uint32 gateway_count = 7;        // Number of gateway 

}

message FabricDefinitionResponse {
  string fabric_id = 1;
}

message SetDeviceRoleRequest {
  string device_uuid = 1;          // Device UUID from context/web UI.
  string fabric_id = 2;            // Fabric ID from DefineSpineLeafFabric.
  string role = 3;                 // "spine" | "leaf" | "gateway".
}

message ConfigSetting {
    string device_uuid = 1;
    string endpoint_uuid = 2;
    string ip_address = 3;
    uint32 vlan_tag = 4;
    string mac_address = 5;
    uint32 asn = 6;
    string router_id = 7;
    uint32 vni = 8;
    string local_address = 9;
    uint32 port = 10;
    string bridge = 11;
    string interface = 12;
    string remote_address = 13;
    uint32 remote_as = 14;
    string local_role = 15;
    string routing_table = 16;
    bool multihop = 17;
    string afi = 18;
    string name = 19;
}

message DeployDeviceConfigRequest {
  string device_uuid = 1;
  string fabric_id = 2;
  ConfigSetting config = 3;        // config generated by SetDeviceAs
}

message DeployResponse {
  bool success = 1;
  string message = 2;
}

message OperationStatus {
  bool success = 1;
  string message = 2;
}

message UnsetDeviceRoleRequest {
  string device_uuid = 1;
  string fabric_id = 2;
}

message FabricScope {
  string fabric_id = 1;
}

message FabricNode {
  string device_uuid = 1;
  string role = 2;
  string state = 3;
}

message FabricInventory {
  string fabric_id = 1;
  repeated FabricNode spines = 2;
  repeated FabricNode leaves = 3;
  repeated FabricNode gateways = 4;
}

message DeviceConfigQuery {
  string device_uuid = 1;
  string fabric_id = 2;
}
+27 −0
Changes for scripts/show_logs_spine_leaf.sh: 27 added lines, 0 removed lines.
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2026 ETSI SDG TeraFlowSDN (TFS) (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

########################################################################################################################
# Define your deployment settings here
########################################################################################################################

# If not already set, set the name of the Kubernetes namespace to deploy to.
export TFS_K8S_NAMESPACE=${TFS_K8S_NAMESPACE:-"tfs"}

########################################################################################################################
# Automated steps start here
########################################################################################################################

kubectl --namespace $TFS_K8S_NAMESPACE logs deployment/spine-leafservice -c server
Loading