Commit dee37531 authored by Álvaro Ramírez Hernández's avatar Álvaro Ramírez Hernández
Browse files

Refactored netphony-pce integration, ensured database functionality, and connected WebUI

parent 47935462
Loading
Loading
Loading
Loading
+101 −0
Original line number Diff line number Diff line
# apiVersion: v1
# kind: Service
# metadata:
#   name: netphony-service
# spec:
#   type: LoadBalancer  # Cambia a NodePort o ClusterIP según la necesidad
#   selector:
#     app: netphony
#   loadBalancerIP: 10.0.2.150  # Ajusta según la configuración de MetalLB o tu entorno
#   ports:
#     - name: grpc
#       port: 4189          # Puerto externo accesible
#       targetPort: 4189     # Puerto donde escucha Netphony-PCE en el pod
#       protocol: TCP
# ---
# apiVersion: apps/v1
# kind: Deployment
# metadata:
#   name: netphony-deployment
# spec:
#   replicas: 1
#   selector:
#     matchLabels:
#       app: netphony
#   template:
#     metadata:
#       labels:
#         app: netphony
#     spec:
#       containers:
#       - name: netphony
#         image: <tu-imagen-netphony>   # Reemplaza con la imagen correcta
#         ports:
#         - containerPort: 4189
# apiVersion: v1
# kind: Service
# metadata:
#   name: netphony-external-service
# spec:
#   type: ClusterIP
#   ports:
#     - port: 4189
#       targetPort: 4189
#       protocol: TCP
# ---
# apiVersion: v1
# kind: Endpoints
# metadata:
#   name: netphony-external-service
# subsets:
#   - addresses:
#       - ip: 192.168.1.100   # IP de VM A
#     ports:
#       - port: 4189
apiVersion: v1
kind: Service
metadata:
  name: netphony-external-service
spec:
  type: ClusterIP
  ports:
    - name: grpc
      protocol: TCP
      port: 20050
      targetPort: 20050
    - name: metrics
      protocol: TCP
      port: 9192
      targetPort: 9192
    - name: pcep
      protocol: TCP
      port: 4189
      targetPort: 4189
    - name: managm
      protocol: TCP
      port: 6666
      targetPort: 6666
    - name: grpcnetphony
      protocol: TCP
      port: 10060
      targetPort: 10060
---
apiVersion: v1
kind: Endpoints
metadata:
  name: netphony-external-service
subsets:
  - addresses:
      - ip: 192.168.159.225  # IP de la VM donde está Netphony
    ports:
      - name: grpc
        port: 20050
      - name: metrics
        port: 9192
      - name: pcep
        port: 4189
      - name: managm
        port: 6666
      - name: grpcnetphony
        port: 10060
+5 −3
Original line number Diff line number Diff line
@@ -43,6 +43,8 @@ spec:
        env:
        - name: LOG_LEVEL
          value: "DEBUG"
        # - name: CRDB_DATABASE
        #       value: "tfs_pcep"
        envFrom:
          - secretRef:
              name: crdb-lsp-data
@@ -67,11 +69,11 @@ metadata:
  labels:
    app: pcepservice
spec:
  type: LoadBalancer
  externalTrafficPolicy: Local
  type: ClusterIP
  # externalTrafficPolicy: Local
  selector:
    app: pcepservice
  loadBalancerIP: 192.168.159.65
  # loadBalancerIP: 192.168.159.65
  ports:
  - name: grpc
    protocol: TCP
+13 −1
Original line number Diff line number Diff line
@@ -39,9 +39,21 @@ spec:
            - containerPort: 8004
          env:
            - name: LOG_LEVEL
              value: "INFO"
              value: "DEBUG"
            - name: WEBUISERVICE_SERVICE_BASEURL_HTTP
              value: "/webui/"
            - name: CRDB_NAMESPACE
              value: "crdb"
            - name: CRDB_SQL_PORT
              value: "26257"
            - name: CRDB_DATABASE_LSP_MGMT
              value: "tfs_lsp_mgmt"
            - name: CRDB_USERNAME
              value: "tfs"
            - name: CRDB_PASSWORD
              value: "tfs123"
            - name: CRDB_SSLMODE
              value: "require"
          readinessProbe:
            httpGet:
              path: /healthz/ready
+21 −21
Original line number Diff line number Diff line
@@ -20,18 +20,28 @@ import "context.proto";


service PcepService {
  rpc sendRequest    ( RequestRq ) returns (       RequestRp      ) {}
  rpc sendRequest    ( RequestRq ) returns (       commandResponse      ) {}
  rpc configuratePCE ( PceIpRq   ) returns (       PceIpRp      ) {}
  rpc getLSPdb       (LSPdb_Request) returns (LSPdb_Response) {}
  
  rpc SetLsp    (LspDescriptor      ) returns (LspID               ) {}
  rpc DeleteLsp (LspID              ) returns (context.Empty       ) {}
  rpc GetLsp    (LspID              ) returns (LspDescriptor       ) {}
  rpc SetLsp    (LspDescriptor      ) returns (LspId               ) {}
  rpc DeleteLsp (LspId              ) returns (context.Empty       ) {}
  rpc GetLsp    (LspId              ) returns (LspDescriptor       ) {}

  // RPC method for retrieving LSP database
	rpc getSessionsInfo(Session_Request) returns (Session_Response);
  
}
// Command request from the client
message commandRequest{
	string command = 1;
}

// Response after a Command Request (If bad request show error log)
message commandResponse{
	bool success = 1;
 	string error_message = 2;
}

message RequestRq {
  string command = 1;
@@ -52,26 +62,16 @@ message PceIpRp{
}


message LspID {
  context.Uuid lsp_id = 1;
message LspId {
  context.Uuid lsp_uuid = 1;
}

message LspDescriptor {
    LspID lsp_id = 1;                          // ID del LSP
    bool delegate_flag = 2;                     // Delegate Flag
    bool sync_flag = 3;                         // Sync Flag
    bool remove_flag = 4;                       // Remove Flag
    bool administrative_flag = 5;               // Administrative Flag
    int32 op_flags = 6;                         // Operational Flags
    bool create_flag = 7;                       // Create Flag
    bool p2mp_flag = 8;                         // P2MP Flag
    bool fragmentation_flag = 9;                // Fragmentation Flag
    bool ero_compression_flag = 10;             // ERO Compression Flag
    string symbolic_path_name_tlv = 11;         // Symbolic Path Name TLV
    string lsp_identifiers_tlv = 12;            // LSP Identifiers TLV
    string lsp_error_codes_tlv = 13;            // LSP Error Codes TLV
    string rsvp_error_spec_tlv = 14;            // RSVP Error Spec TLV
    string lsp_db_version_tlv = 15;             // LSP DB Version TLV
    LspId lsp_id = 1;                          // ID del LSP (UUID en formato string)
    string srp = 2;                               // SRP
    string lsp = 3;                               // LSP (almacenado como JSON, en formato string)
    string path = 4;                              // Path (almacenado como JSON, en formato string)
    string associationlist = 5;                  // Lista de asociaciones (almacenada como JSON, en formato string)
}

// LSP database request from the client
+2 −2
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ export TFS_REGISTRY_IMAGES=${TFS_REGISTRY_IMAGES:-"http://localhost:32000/tfs/"}

# If not already set, set the list of components, separated by spaces, you want to build images for, and deploy.
# By default, only basic components are deployed
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui load_generator pcep"}
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device pathcomp service slice nbi webui pcep"}

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

# If TFS_SKIP_BUILD is "YES", select the containers to be build
# Any other container will use previous docker images
export TFS_QUICK_COMPONENTS="pcep webui"
export TFS_QUICK_COMPONENTS="webui"

# ----- CockroachDB ------------------------------------------------------------

Loading