Commit f8c3a52f authored by Waleed Akbar's avatar Waleed Akbar
Browse files

changes for integration with TFS (service is running)

parent 9f94eb55
Loading
Loading
Loading
Loading
+1 −1
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 ztp monitoring pathcomp service slice nbi webui load_generator"}
export TFS_COMPONENTS=${TFS_COMPONENTS:-"context device ztp monitoring pathcomp service slice nbi webui load_generator kpi_manager"}

# If not already set, set the tag you want to use for your images.
export TFS_IMAGE_TAG=${TFS_IMAGE_TAG:-"dev"}
+14 −14
Original line number Diff line number Diff line
@@ -15,26 +15,26 @@
apiVersion: apps/v1
kind: Deployment
metadata:
  name: kpi_managerservice
  name: kpi-managerservice
spec:
  selector:
    matchLabels:
      app: kpi_managerservice
      app: kpi-managerservice
  #replicas: 1
  template:
    metadata:
      annotations:
        config.linkerd.io/skip-outbound-ports: "4222"
      labels:
        app: kpi_managerservice
        app: kpi-managerservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
        - name: server
          image: labs.etsi.org:5050/tfs/controller/context:latest
          image: labs.etsi.org:5050/tfs/controller/kpi_manager:latest
          imagePullPolicy: Always
          ports:
            - containerPort: 7071
            - containerPort: 30010
            - containerPort: 9192
          env:
            - name: LOG_LEVEL
@@ -44,10 +44,10 @@ spec:
                name: crdb-data
          readinessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:7071"]
              command: ["/bin/grpc_health_probe", "-addr=:30010"]
          livenessProbe:
            exec:
              command: ["/bin/grpc_health_probe", "-addr=:7071"]
              command: ["/bin/grpc_health_probe", "-addr=:30010"]
          resources:
            requests:
              cpu: 250m
@@ -59,18 +59,18 @@ spec:
apiVersion: v1
kind: Service
metadata:
  name: kpi_managerservice
  name: kpi-managerservice
  labels:
    app: kpi_managerservice
    app: kpi-managerservice
spec:
  type: ClusterIP
  selector:
    app: kpi_managerservice
    app: kpi-managerservice
  ports:
    - name: grpc
      protocol: TCP
      port: 7071
      targetPort: 7071
      port: 30010
      targetPort: 30010
    - name: metrics
      protocol: TCP
      port: 9192
@@ -79,12 +79,12 @@ spec:
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: kpi_managerservice-hpa
  name: kpi-managerservice-hpa
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: kpi_managerservice
    name: kpi-managerservice
  minReplicas: 1
  maxReplicas: 20
  metrics:
+1 −1
Original line number Diff line number Diff line
@@ -14,7 +14,7 @@

from common.Constants import ServiceNameEnum
from common.Settings import get_service_port_grpc
from monitoring.service.NameMapping import NameMapping
from .NameMapping import NameMapping
from common.tools.service.GenericGrpcService import GenericGrpcService
from common.proto.kpi_manager_pb2_grpc import add_KpiManagerServiceServicer_to_server
from kpi_manager.service.KpiManagerServiceServicerImpl import KpiManagerServiceServicerImpl
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_m
from common.proto.context_pb2 import Empty
from common.proto.kpi_manager_pb2_grpc import KpiManagerServiceServicer
from common.proto.kpi_manager_pb2 import KpiId, KpiDescriptor, KpiDescriptorFilter, KpiDescriptorList
from monitoring.service.NameMapping import NameMapping
from .NameMapping import NameMapping
from kpi_manager.database.Kpi_DB import KpiDB
from kpi_manager.database.KpiModel import Kpi as KpiModel

+1 −2
Original line number Diff line number Diff line
@@ -19,8 +19,7 @@ from common.Settings import (
    ENVVAR_SUFIX_SERVICE_HOST, ENVVAR_SUFIX_SERVICE_PORT_GRPC, get_env_var_name, get_log_level, get_metrics_port,
    wait_for_environment_variables)
from common.proto import monitoring_pb2
from monitoring.service.EventTools import EventsDeviceCollector # import updated
from monitoring.service.NameMapping import NameMapping          # import updated
from .NameMapping import NameMapping          # import updated
from .KpiManagerService import KpiManagerService

terminate = threading.Event()