From 8775d5a8d07df1ab0e99b28f67bdc4646ac6116d Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Sat, 17 Jun 2023 08:06:23 +0000
Subject: [PATCH] Deploy Specs script and Manifests:

- Added deploy-specs script
- Reduced request resources in components to fit in VM
- Activated DEBUG logs
- Deactivated horizontal pod autoscalers
---
 manifests/contextservice.yaml    | 50 +++++++++++++++---------------
 manifests/deviceservice.yaml     |  8 ++---
 manifests/monitoringservice.yaml |  2 +-
 manifests/pathcompservice.yaml   | 48 ++++++++++++++---------------
 manifests/serviceservice.yaml    | 52 ++++++++++++++++----------------
 manifests/sliceservice.yaml      | 50 +++++++++++++++---------------
 my_deploy.sh                     |  4 +--
 7 files changed, 107 insertions(+), 107 deletions(-)

diff --git a/manifests/contextservice.yaml b/manifests/contextservice.yaml
index 96735bf5f..288f0677a 100644
--- a/manifests/contextservice.yaml
+++ b/manifests/contextservice.yaml
@@ -54,11 +54,11 @@ spec:
             command: ["/bin/grpc_health_probe", "-addr=:1010"]
         resources:
           requests:
-            cpu: 250m
+            cpu: 150m
             memory: 128Mi
           limits:
-            cpu: 1000m
-            memory: 1024Mi
+            cpu: 500m
+            memory: 512Mi
 ---
 apiVersion: v1
 kind: Service
@@ -79,25 +79,25 @@ spec:
     protocol: TCP
     port: 9192
     targetPort: 9192
----
-apiVersion: autoscaling/v2
-kind: HorizontalPodAutoscaler
-metadata:
-  name: contextservice-hpa
-spec:
-  scaleTargetRef:
-    apiVersion: apps/v1
-    kind: Deployment
-    name: contextservice
-  minReplicas: 1
-  maxReplicas: 20
-  metrics:
-  - type: Resource
-    resource:
-      name: cpu
-      target:
-        type: Utilization
-        averageUtilization: 80
-  #behavior:
-  #  scaleDown:
-  #    stabilizationWindowSeconds: 30
+#---
+#apiVersion: autoscaling/v2
+#kind: HorizontalPodAutoscaler
+#metadata:
+#  name: contextservice-hpa
+#spec:
+#  scaleTargetRef:
+#    apiVersion: apps/v1
+#    kind: Deployment
+#    name: contextservice
+#  minReplicas: 1
+#  maxReplicas: 20
+#  metrics:
+#  - type: Resource
+#    resource:
+#      name: cpu
+#      target:
+#        type: Utilization
+#        averageUtilization: 80
+#  #behavior:
+#  #  scaleDown:
+#  #    stabilizationWindowSeconds: 30
diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml
index 22c0f5f9d..2984869bc 100644
--- a/manifests/deviceservice.yaml
+++ b/manifests/deviceservice.yaml
@@ -39,7 +39,7 @@ spec:
         - containerPort: 9192
         env:
         - name: LOG_LEVEL
-          value: "INFO"
+          value: "DEBUG"
         readinessProbe:
           exec:
             command: ["/bin/grpc_health_probe", "-addr=:2020"]
@@ -48,11 +48,11 @@ spec:
             command: ["/bin/grpc_health_probe", "-addr=:2020"]
         resources:
           requests:
-            cpu: 250m
+            cpu: 150m
             memory: 128Mi
           limits:
-            cpu: 1000m
-            memory: 1024Mi
+            cpu: 500m
+            memory: 512Mi
 ---
 apiVersion: v1
 kind: Service
diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml
index 4447a1427..06ac823a1 100644
--- a/manifests/monitoringservice.yaml
+++ b/manifests/monitoringservice.yaml
@@ -36,7 +36,7 @@ spec:
         - containerPort: 9192
         env:
         - name: LOG_LEVEL
-          value: "INFO"
+          value: "DEBUG"
         envFrom:
         - secretRef:
             name: qdb-data
diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml
index 3ba12750b..7b47c338b 100644
--- a/manifests/pathcompservice.yaml
+++ b/manifests/pathcompservice.yaml
@@ -36,7 +36,7 @@ spec:
         - containerPort: 9192
         env:
         - name: LOG_LEVEL
-          value: "INFO"
+          value: "DEBUG"
         readinessProbe:
           exec:
             command: ["/bin/grpc_health_probe", "-addr=:10020"]
@@ -72,7 +72,7 @@ spec:
             cpu: 100m
             memory: 256Mi
           limits:
-            cpu: 700m
+            cpu: 500m
             memory: 1024Mi
 ---
 apiVersion: v1
@@ -98,25 +98,25 @@ spec:
     protocol: TCP
     port: 9192
     targetPort: 9192
----
-apiVersion: autoscaling/v2
-kind: HorizontalPodAutoscaler
-metadata:
-  name: pathcompservice-hpa
-spec:
-  scaleTargetRef:
-    apiVersion: apps/v1
-    kind: Deployment
-    name: pathcompservice
-  minReplicas: 1
-  maxReplicas: 20
-  metrics:
-  - type: Resource
-    resource:
-      name: cpu
-      target:
-        type: Utilization
-        averageUtilization: 80
-  #behavior:
-  #  scaleDown:
-  #    stabilizationWindowSeconds: 30
+#---
+#apiVersion: autoscaling/v2
+#kind: HorizontalPodAutoscaler
+#metadata:
+#  name: pathcompservice-hpa
+#spec:
+#  scaleTargetRef:
+#    apiVersion: apps/v1
+#    kind: Deployment
+#    name: pathcompservice
+#  minReplicas: 1
+#  maxReplicas: 20
+#  metrics:
+#  - type: Resource
+#    resource:
+#      name: cpu
+#      target:
+#        type: Utilization
+#        averageUtilization: 80
+#  #behavior:
+#  #  scaleDown:
+#  #    stabilizationWindowSeconds: 30
diff --git a/manifests/serviceservice.yaml b/manifests/serviceservice.yaml
index 7d7bdaa4e..d71273aff 100644
--- a/manifests/serviceservice.yaml
+++ b/manifests/serviceservice.yaml
@@ -36,7 +36,7 @@ spec:
         - containerPort: 9192
         env:
         - name: LOG_LEVEL
-          value: "INFO"
+          value: "DEBUG"
         readinessProbe:
           exec:
             command: ["/bin/grpc_health_probe", "-addr=:3030"]
@@ -45,11 +45,11 @@ spec:
             command: ["/bin/grpc_health_probe", "-addr=:3030"]
         resources:
           requests:
-            cpu: 250m
+            cpu: 150m
             memory: 128Mi
           limits:
-            cpu: 1000m
-            memory: 1024Mi
+            cpu: 500m
+            memory: 512Mi
 ---
 apiVersion: v1
 kind: Service
@@ -70,25 +70,25 @@ spec:
     protocol: TCP
     port: 9192
     targetPort: 9192
----
-apiVersion: autoscaling/v2
-kind: HorizontalPodAutoscaler
-metadata:
-  name: serviceservice-hpa
-spec:
-  scaleTargetRef:
-    apiVersion: apps/v1
-    kind: Deployment
-    name: serviceservice
-  minReplicas: 1
-  maxReplicas: 20
-  metrics:
-  - type: Resource
-    resource:
-      name: cpu
-      target:
-        type: Utilization
-        averageUtilization: 80
-  #behavior:
-  #  scaleDown:
-  #    stabilizationWindowSeconds: 30
+#---
+#apiVersion: autoscaling/v2
+#kind: HorizontalPodAutoscaler
+#metadata:
+#  name: serviceservice-hpa
+#spec:
+#  scaleTargetRef:
+#    apiVersion: apps/v1
+#    kind: Deployment
+#    name: serviceservice
+#  minReplicas: 1
+#  maxReplicas: 20
+#  metrics:
+#  - type: Resource
+#    resource:
+#      name: cpu
+#      target:
+#        type: Utilization
+#        averageUtilization: 80
+#  #behavior:
+#  #  scaleDown:
+#  #    stabilizationWindowSeconds: 30
diff --git a/manifests/sliceservice.yaml b/manifests/sliceservice.yaml
index e7e5c1604..5ea63ad0c 100644
--- a/manifests/sliceservice.yaml
+++ b/manifests/sliceservice.yaml
@@ -50,11 +50,11 @@ spec:
             command: ["/bin/grpc_health_probe", "-addr=:4040"]
         resources:
           requests:
-            cpu: 250m
+            cpu: 150m
             memory: 128Mi
           limits:
-            cpu: 1000m
-            memory: 1024Mi
+            cpu: 500m
+            memory: 512Mi
 ---
 apiVersion: v1
 kind: Service
@@ -75,25 +75,25 @@ spec:
     protocol: TCP
     port: 9192
     targetPort: 9192
----
-apiVersion: autoscaling/v2
-kind: HorizontalPodAutoscaler
-metadata:
-  name: sliceservice-hpa
-spec:
-  scaleTargetRef:
-    apiVersion: apps/v1
-    kind: Deployment
-    name: sliceservice
-  minReplicas: 1
-  maxReplicas: 20
-  metrics:
-  - type: Resource
-    resource:
-      name: cpu
-      target:
-        type: Utilization
-        averageUtilization: 80
-  #behavior:
-  #  scaleDown:
-  #    stabilizationWindowSeconds: 30
+#---
+#apiVersion: autoscaling/v2
+#kind: HorizontalPodAutoscaler
+#metadata:
+#  name: sliceservice-hpa
+#spec:
+#  scaleTargetRef:
+#    apiVersion: apps/v1
+#    kind: Deployment
+#    name: sliceservice
+#  minReplicas: 1
+#  maxReplicas: 20
+#  metrics:
+#  - type: Resource
+#    resource:
+#      name: cpu
+#      target:
+#        type: Utilization
+#        averageUtilization: 80
+#  #behavior:
+#  #  scaleDown:
+#  #    stabilizationWindowSeconds: 30
diff --git a/my_deploy.sh b/my_deploy.sh
index 0b8b6d9e8..48ef64134 100755
--- a/my_deploy.sh
+++ b/my_deploy.sh
@@ -21,10 +21,10 @@ export TFS_REGISTRY_IMAGES="http://localhost:32000/tfs/"
 
 # Set the list of components, separated by spaces, you want to build images for, and deploy.
 #export TFS_COMPONENTS="context device pathcomp service slice compute webui load_generator"
-export TFS_COMPONENTS="context device pathcomp service slice compute webui"
+export TFS_COMPONENTS="context device pathcomp service slice webui"
 
 # Uncoment to activate Monitoring
-#export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
+export TFS_COMPONENTS="${TFS_COMPONENTS} monitoring"
 
 # Uncoment to activate Automation and Policy Manager
 #export TFS_COMPONENTS="${TFS_COMPONENTS} automation policy"
-- 
GitLab