diff --git a/deploy/subscription_ws_e2e.sh b/deploy/subscription_ws_e2e.sh index 6088871d19481c42ca16889b914e6ccacf2a284d..52a687f6f162f8d3bcce1f7d92ebfc53f3d41951 100755 --- a/deploy/subscription_ws_e2e.sh +++ b/deploy/subscription_ws_e2e.sh @@ -40,6 +40,3 @@ CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' kubectl patch daemonset nginx-ingress-microk8s-controller-e2e --namespace ingress --patch "${PATCH}" echo - - - diff --git a/deploy/subscription_ws_ip.sh b/deploy/subscription_ws_ip.sh index f5e775d457e6e31429a41e1e1c44c47c36a9c8ce..69239b2576f14ebea418e8d6834ad0946b0bc0cf 100755 --- a/deploy/subscription_ws_ip.sh +++ b/deploy/subscription_ws_ip.sh @@ -40,6 +40,3 @@ CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' kubectl patch daemonset nginx-ingress-microk8s-controller-ip --namespace ingress --patch "${PATCH}" echo - - - diff --git a/manifests/contextservice.yaml b/manifests/contextservice.yaml index 2c67ee3e0f43b77f22699032cf581ffb110a013a..ee2edfe03143576c984b7923fae76b9464ae957f 100644 --- a/manifests/contextservice.yaml +++ b/manifests/contextservice.yaml @@ -60,7 +60,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:1010"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m @@ -85,25 +85,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 4801ba1fb8c39d5f3a829d9e1f6899ffb88cbb24..e49ba23995b07f4e7e956a69f8d5383c8e976e89 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -53,7 +53,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:2020"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m diff --git a/manifests/e2e_orchestratorservice.yaml b/manifests/e2e_orchestratorservice.yaml index ca7bc98e0a425141a3977a5b1ac80dfe8c08af55..62a7559949a5119ab3ba33abd6b4403d7c698fc8 100644 --- a/manifests/e2e_orchestratorservice.yaml +++ b/manifests/e2e_orchestratorservice.yaml @@ -59,7 +59,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:10050"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m diff --git a/manifests/pathcompservice.yaml b/manifests/pathcompservice.yaml index 8184d900fbb5ad5033c56dd08eadf2ab15e7026a..754add3ae61aa4ecef44fecd264c0a48b31d2f00 100644 --- a/manifests/pathcompservice.yaml +++ b/manifests/pathcompservice.yaml @@ -47,7 +47,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:10020"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m @@ -100,25 +100,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 22a1f78287f20309cab6570385d48e92d6216f49..15718058b94d55a7b1ec299ea7440d95f077a95f 100644 --- a/manifests/serviceservice.yaml +++ b/manifests/serviceservice.yaml @@ -45,7 +45,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:3030"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m @@ -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 9eaa830bb4fc4db32d090908c0102f40cdda44a1..eb9b989d2b9e3be0fc5489cd3a702ee72817f04f 100644 --- a/manifests/sliceservice.yaml +++ b/manifests/sliceservice.yaml @@ -50,7 +50,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:4040"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m @@ -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/manifests/vnt_managerservice.yaml b/manifests/vnt_managerservice.yaml index cf042a7ae774963be49d6c53f83d404270659763..277895db28892b3bf4ea6ffd7c4515f9daf986f4 100644 --- a/manifests/vnt_managerservice.yaml +++ b/manifests/vnt_managerservice.yaml @@ -52,7 +52,7 @@ spec: command: ["/bin/grpc_health_probe", "-addr=:10080"] resources: requests: - cpu: 200m + cpu: 250m memory: 128Mi limits: cpu: 1000m diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index 85ae6917c9cf863f97211f164274af3814a0c05a..19317323f2a60293a33d740b28b3795627846642 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -61,44 +61,44 @@ spec: limits: cpu: 1000m memory: 1024Mi -# - name: grafana -# image: grafana/grafana:8.5.22 -# imagePullPolicy: IfNotPresent -# ports: -# - containerPort: 3000 -# name: http-grafana -# protocol: TCP -# env: -# - name: GF_SERVER_ROOT_URL -# value: "http://0.0.0.0:3000/grafana/" -# - name: GF_SERVER_SERVE_FROM_SUB_PATH -# value: "true" -# readinessProbe: -# failureThreshold: 60 -# httpGet: -# #path: /robots.txt -# path: /login -# port: 3000 -# scheme: HTTP -# initialDelaySeconds: 1 -# periodSeconds: 1 -# successThreshold: 1 -# timeoutSeconds: 2 -# livenessProbe: -# failureThreshold: 60 -# initialDelaySeconds: 1 -# periodSeconds: 1 -# successThreshold: 1 -# tcpSocket: -# port: 3000 -# timeoutSeconds: 1 -# resources: -# requests: -# cpu: 250m -# memory: 512Mi -# limits: -# cpu: 500m -# memory: 1024Mi + - name: grafana + image: grafana/grafana:8.5.22 + imagePullPolicy: IfNotPresent + ports: + - containerPort: 3000 + name: http-grafana + protocol: TCP + env: + - name: GF_SERVER_ROOT_URL + value: "http://0.0.0.0:3000/grafana/" + - name: GF_SERVER_SERVE_FROM_SUB_PATH + value: "true" + readinessProbe: + failureThreshold: 60 + httpGet: + #path: /robots.txt + path: /login + port: 3000 + scheme: HTTP + initialDelaySeconds: 1 + periodSeconds: 1 + successThreshold: 1 + timeoutSeconds: 2 + livenessProbe: + failureThreshold: 60 + initialDelaySeconds: 1 + periodSeconds: 1 + successThreshold: 1 + tcpSocket: + port: 3000 + timeoutSeconds: 1 + resources: + requests: + cpu: 250m + memory: 512Mi + limits: + cpu: 500m + memory: 1024Mi --- apiVersion: v1 kind: Service diff --git a/manifests/ztpservice.yaml b/manifests/ztpservice.yaml index 64b1a4505744b47f5cd2d8b427fd03a0dcbf4026..90c5c44a127240a89d9c199e6dd3fdec4b74581a 100644 --- a/manifests/ztpservice.yaml +++ b/manifests/ztpservice.yaml @@ -104,22 +104,22 @@ spec: limits: cpu: 2000m memory: 2048Mi -#--- -#apiVersion: autoscaling/v2 -#kind: HorizontalPodAutoscaler -#metadata: -# name: ztpservice-hpa -#spec: -# scaleTargetRef: -# apiVersion: apps/v1 -# kind: Deployment -# name: ztpservice -# minReplicas: 1 -# maxReplicas: 10 -# metrics: -# - type: Resource -# resource: -# name: cpu -# target: -# type: Utilization -# averageUtilization: 80 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: ztpservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: ztpservice + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/src/tests/ecoc24/deploy_e2e.sh b/src/tests/ecoc24/deploy_e2e.sh index 0e69bcdca23df0fbfafdfd291db92a3925099ae9..dbea63e434358aa2cbfe6f891a20050561a4d62a 100755 --- a/src/tests/ecoc24/deploy_e2e.sh +++ b/src/tests/ecoc24/deploy_e2e.sh @@ -28,6 +28,6 @@ source src/tests/ecoc24/deploy_specs_e2e.sh ./deploy/all.sh #Configure Subscription WS -./deploy/subscription_ws_e2e.sh +./src/tests/ecoc24/deploy/subscription_ws_e2e.sh mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_e2e.sh diff --git a/src/tests/ecoc24/deploy_ip.sh b/src/tests/ecoc24/deploy_ip.sh index e0af5721e359cd763ebe1d19c35ce95936e0e154..222c142f0290ed696b5ed25bb037d0aef68bfbb5 100755 --- a/src/tests/ecoc24/deploy_ip.sh +++ b/src/tests/ecoc24/deploy_ip.sh @@ -28,6 +28,6 @@ source src/tests/ecoc24/deploy_specs_ip.sh ./deploy/all.sh #Configure Subscription WS -./deploy/subscription_ws_ip.sh +./src/tests/ecoc24/subscription_ws_ip.sh mv tfs_runtime_env_vars.sh tfs_runtime_env_vars_ip.sh diff --git a/src/tests/ecoc24/subscription_ws_e2e.sh b/src/tests/ecoc24/subscription_ws_e2e.sh new file mode 100755 index 0000000000000000000000000000000000000000..6088871d19481c42ca16889b914e6ccacf2a284d --- /dev/null +++ b/src/tests/ecoc24/subscription_ws_e2e.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the namespace where CockroackDB will be deployed. +export SUBSCRIPTION_WS_NAMESPACE=${SUBSCRIPTION_WS_NAMESPACE:-"tfs-e2e"} + +# If not already set, set the external port interface will be exposed to. +export SUBSCRIPTION_WS_EXT_PORT=${SUBSCRIPTION_WS_EXT_PORT:-"8761"} + + +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + + +echo "Subscription WebSocket Port Mapping" +echo ">>> ExposeSubscription WebSocket port (${SUBSCRIPTION_WS_EXT_PORT}->${SUBSCRIPTION_WS_EXT_PORT})" +PATCH='{"data": {"'${SUBSCRIPTION_WS_EXT_PORT}'": "'${SUBSCRIPTION_WS_NAMESPACE}'/nbiservice:'${SUBSCRIPTION_WS_EXT_PORT}'"}}' +kubectl patch configmap nginx-ingress-tcp-microk8s-conf-e2e --namespace ingress --patch "${PATCH}" + +PORT_MAP='{"containerPort": '${SUBSCRIPTION_WS_EXT_PORT}', "hostPort": '${SUBSCRIPTION_WS_EXT_PORT}'}' +CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' +PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' +kubectl patch daemonset nginx-ingress-microk8s-controller-e2e --namespace ingress --patch "${PATCH}" +echo + + + diff --git a/src/tests/ecoc24/subscription_ws_ip.sh b/src/tests/ecoc24/subscription_ws_ip.sh new file mode 100755 index 0000000000000000000000000000000000000000..f5e775d457e6e31429a41e1e1c44c47c36a9c8ce --- /dev/null +++ b/src/tests/ecoc24/subscription_ws_ip.sh @@ -0,0 +1,45 @@ +#!/bin/bash +# Copyright 2022-2024 ETSI TeraFlowSDN - TFS OSG (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. + + +######################################################################################################################## +# Read deployment settings +######################################################################################################################## + +# If not already set, set the namespace where CockroackDB will be deployed. +export SUBSCRIPTION_WS_NAMESPACE=${SUBSCRIPTION_WS_NAMESPACE:-"tfs-ip"} + +# If not already set, set the external port interface will be exposed to. +export SUBSCRIPTION_WS_INT_PORT=${SUBSCRIPTION_WS_INT_PORT:-"8762"} +######################################################################################################################## +# Automated steps start here +######################################################################################################################## + + + + +echo "Subscription WebSocket Port Mapping" +echo ">>> ExposeSubscription WebSocket port (${SUBSCRIPTION_WS_INT_PORT}->${SUBSCRIPTION_WS_INT_PORT})" +PATCH='{"data": {"'${SUBSCRIPTION_WS_INT_PORT}'": "'${SUBSCRIPTION_WS_NAMESPACE}'/nbiservice:'${SUBSCRIPTION_WS_INT_PORT}'"}}' +kubectl patch configmap nginx-ingress-tcp-microk8s-conf-ip --namespace ingress --patch "${PATCH}" + +PORT_MAP='{"containerPort": '${SUBSCRIPTION_WS_INT_PORT}', "hostPort": '${SUBSCRIPTION_WS_INT_PORT}'}' +CONTAINER='{"name": "nginx-ingress-microk8s", "ports": ['${PORT_MAP}']}' +PATCH='{"spec": {"template": {"spec": {"containers": ['${CONTAINER}']}}}}' +kubectl patch daemonset nginx-ingress-microk8s-controller-ip --namespace ingress --patch "${PATCH}" +echo + + +