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

MCP Server component:

- Initial implemation
parent 8586676f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ include:
  #- local: '/manifests/.gitlab-ci.yml'
  - local: '/src/monitoring/.gitlab-ci.yml'
  - local: '/src/nbi/.gitlab-ci.yml'
  - local: '/src/mcp_server/.gitlab-ci.yml'
  - local: '/src/context/.gitlab-ci.yml'
  - local: '/src/device/.gitlab-ci.yml'
  - local: '/src/service/.gitlab-ci.yml'
+4 −0
Original line number Diff line number Diff line
@@ -72,6 +72,10 @@ export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice n
# Uncomment to activate Pluggables Component
#export TFS_COMPONENTS="${TFS_COMPONENTS} pluggables"

# Uncomment to activate MCP Server.
# Keep it last so it is deployed after optional components it can expose.
#export TFS_COMPONENTS="${TFS_COMPONENTS} mcp_server"

# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}

+105 −0
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: mcp-serverservice
spec:
  selector:
    matchLabels:
      app: mcp-serverservice
  replicas: 1
  template:
    metadata:
      labels:
        app: mcp-serverservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: labs.etsi.org:5050/tfs/controller/mcp_server:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 3002
          env:
            - name: LOG_LEVEL
              value: "INFO"
            - name: TFS_MCP_PORT
              value: "3002"
            - name: TFS_MCP_MODE
              value: "normal"
            - name: TFS_NBI_URL
              value: "http://nbiservice:8080"
            - name: TFS_NBI_PREFIX
              value: "/tfs-api"
          readinessProbe:
            httpGet:
              path: /health
              port: 3002
            initialDelaySeconds: 5
            periodSeconds: 10
            failureThreshold: 10
          livenessProbe:
            httpGet:
              path: /health
              port: 3002
            initialDelaySeconds: 5
            periodSeconds: 10
            failureThreshold: 10
          resources:
            requests:
              cpu: 50m
              memory: 128Mi
            limits:
              cpu: 500m
              memory: 512Mi
---
apiVersion: v1
kind: Service
metadata:
  name: mcp-serverservice
  labels:
    app: mcp-serverservice
spec:
  type: ClusterIP
  selector:
    app: mcp-serverservice
  ports:
    - name: http
      protocol: TCP
      port: 3002
      targetPort: 3002
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tfs-ingress-mcp-server
  annotations:
    nginx.ingress.kubernetes.io/limit-rps: "50"             # max requests per second per source IP
    nginx.ingress.kubernetes.io/limit-connections: "50"     # max concurrent connections per source IP
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "60" # max timeout for connecting to server
    nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"  # max timeout between two successive read operations
    nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"  # max timeout between two successive write operations
spec:
  rules:
    - http:
        paths:
          - path: /mcp
            pathType: Prefix
            backend:
              service:
                name: mcp-serverservice
                port:
                  number: 3002
+4 −0
Original line number Diff line number Diff line
@@ -103,6 +103,10 @@ export TFS_COMPONENTS="context device pathcomp service nbi webui"
# Uncomment to activate Pluggables Component
#export TFS_COMPONENTS="${TFS_COMPONENTS} pluggables"

# Uncomment to activate MCP Server.
# Keep it last so it is deployed after optional components it can expose.
#export TFS_COMPONENTS="${TFS_COMPONENTS} mcp_server"


# Set the tag you want to use for your images.
export TFS_IMAGE_TAG="dev"
+27 −0
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/mcp-serverservice -c server
Loading