Commit 67a0e621 authored by Carlos Natalino's avatar Carlos Natalino
Browse files

Fixing the service configuration to work within K8s.

parent 8d9d4125
Loading
Loading
Loading
Loading
+9 −9
Original line number Diff line number Diff line
apiVersion: apps/v1
kind: Deployment
metadata:
  name: opticalcentralizedattackdetectorervice
  name: opticalcentralizedattackdetectorservice
spec:
  selector:
    matchLabels:
      app: opticalcentralizedattackdetectorervice
      app: opticalcentralizedattackdetectorservice
  template:
    metadata:
      labels:
        app: opticalcentralizedattackdetectorervice
        app: opticalcentralizedattackdetectorservice
    spec:
      terminationGracePeriodSeconds: 5
      containers:
      - name: server
        image: registry.gitlab.com/teraflow-h2020/controller/opticalcentralizedattackdetectorervice:latest
        image: registry.gitlab.com/teraflow-h2020/controller/opticalcentralizedattackdetector:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 10005
@@ -42,11 +42,11 @@ spec:
apiVersion: v1
kind: Service
metadata:
  name: opticalcentralizedattackdetectorervice
  name: opticalcentralizedattackdetectorservice
spec:
  type: ClusterIP
  selector:
    app: opticalcentralizedattackdetectorervice
    app: opticalcentralizedattackdetectorservice
  ports:
  - name: grpc
    port: 10005
@@ -55,13 +55,13 @@ spec:
apiVersion: v1
kind: Service
metadata:
  name: opticalcentralizedattackdetectorervice-public
  name: opticalcentralizedattackdetectorservice-public
  labels:
    app: opticalcentralizedattackdetectorervice
    app: opticalcentralizedattackdetectorservice
spec:
  type: NodePort
  selector:
    app: opticalcentralizedattackdetectorervice
    app: opticalcentralizedattackdetectorservice
  ports:
  - name: grpc
    protocol: TCP
+8 −8
Original line number Diff line number Diff line
@@ -11,14 +11,14 @@ GRPC_GRACE_PERIOD = 60
# service settings
MONITORING_INTERVAL = 2  # monitoring interval in seconds
#TODO: adjust the addresses below for the specific case
# MONITORING_SERVICE_ADDRESS = 'monitoring'  # address/name of the monitoring service
MONITORING_SERVICE_ADDRESS = '10.98.180.171'  # address/name of the monitoring service
# CONTEXT_SERVICE_ADDRESS = 'context'  # address/name of the monitoring service
CONTEXT_SERVICE_ADDRESS = '10.97.61.5'  # address/name of the monitoring service
# SERVICE_SERVICE_ADDRESS = 'service'  # address/name of the service service
SERVICE_SERVICE_ADDRESS = '10.97.59.81'  # address/name of the service service
# INFERENCE_SERVICE_ADDRESS = 'dbscanserving'  # address/name of the inference service
INFERENCE_SERVICE_ADDRESS = 'localhost'  # address/name of the inference service
MONITORING_SERVICE_ADDRESS = 'monitoring'  # address/name of the monitoring service
# MONITORING_SERVICE_ADDRESS = '10.98.180.171'  # address/name of the monitoring service
CONTEXT_SERVICE_ADDRESS = 'contextservice'  # address/name of the monitoring service
# CONTEXT_SERVICE_ADDRESS = '10.97.61.5'  # address/name of the monitoring service
SERVICE_SERVICE_ADDRESS = 'serviceservice'  # address/name of the service service
# SERVICE_SERVICE_ADDRESS = '10.97.59.81'  # address/name of the service service
INFERENCE_SERVICE_ADDRESS = 'dbscanserving'  # address/name of the inference service
# INFERENCE_SERVICE_ADDRESS = 'localhost'  # address/name of the inference service

# Prometheus settings
METRICS_PORT = 9192
+2 −0
Original line number Diff line number Diff line
@@ -34,5 +34,7 @@ COPY monitoring/. monitoring
COPY service/. service
COPY opticalcentralizedattackdetector/. opticalcentralizedattackdetector

ENV PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python

# Start opticalcentralizedattackdetector service
ENTRYPOINT ["python", "-m", "opticalcentralizedattackdetector.service"]
+3 −1
Original line number Diff line number Diff line
@@ -4,4 +4,6 @@ prometheus-client
pytest
pytest-benchmark
redis
influxdb-client
# from the monitoring component
influxdb
python-json-logger