From 4d9bce46b2e7519eaecdbc4c9492ba3c321db32c Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Wed, 2 Oct 2024 12:06:02 +0000 Subject: [PATCH] Pre-merge code cleanup --- deploy/tfs.sh | 9 --------- manifests/qos_profileservice.yaml | 30 ++++++++++++++++++++++++++++-- proto/qos_profile.proto | 12 ++++++------ 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/deploy/tfs.sh b/deploy/tfs.sh index 38acd8b75..ea9f9091d 100755 --- a/deploy/tfs.sh +++ b/deploy/tfs.sh @@ -163,15 +163,6 @@ kubectl create secret generic kfk-kpi-data --namespace ${TFS_K8S_NAMESPACE} --ty --from-literal=KFK_SERVER_PORT=${KFK_SERVER_PORT} printf "\n" -echo "Create secret with CockroachDB data for QoSProfile" -kubectl create secret generic crdb-qos-profile-data --namespace ${TFS_K8S_NAMESPACE} --type='Opaque' \ - --from-literal=CRDB_NAMESPACE=${CRDB_NAMESPACE} \ - --from-literal=CRDB_SQL_PORT=${CRDB_SQL_PORT} \ - --from-literal=CRDB_DATABASE=${CRDB_DATABASE_QOSPROFILE} \ - --from-literal=CRDB_USERNAME=${CRDB_USERNAME} \ - --from-literal=CRDB_PASSWORD=${CRDB_PASSWORD} \ - --from-literal=CRDB_SSLMODE=require -printf "\n" echo "Create secret with NATS data" NATS_CLIENT_PORT=$(kubectl --namespace ${NATS_NAMESPACE} get service ${NATS_NAMESPACE} -o 'jsonpath={.spec.ports[?(@.name=="client")].port}') diff --git a/manifests/qos_profileservice.yaml b/manifests/qos_profileservice.yaml index f6838b717..801607880 100644 --- a/manifests/qos_profileservice.yaml +++ b/manifests/qos_profileservice.yaml @@ -23,6 +23,8 @@ spec: #replicas: 1 template: metadata: + annotations: + config.linkerd.io/skip-outbound-ports: "4222" labels: app: qos-profileservice spec: @@ -37,9 +39,11 @@ spec: env: - name: LOG_LEVEL value: "INFO" + - name: CRDB_DATABASE + value: "tfs_qos_profile" envFrom: - secretRef: - name: crdb-qos-profile-data + name: crdb-data readinessProbe: exec: command: ["/bin/grpc_health_probe", "-addr=:20040"] @@ -72,4 +76,26 @@ spec: - name: metrics protocol: TCP port: 9192 - targetPort: 9192 \ No newline at end of file + targetPort: 9192 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: qos-profileservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: qos-profileservice + minReplicas: 1 + maxReplicas: 20 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 + #behavior: + # scaleDown: + # stabilizationWindowSeconds: 30 diff --git a/proto/qos_profile.proto b/proto/qos_profile.proto index dc8348766..d032addf4 100644 --- a/proto/qos_profile.proto +++ b/proto/qos_profile.proto @@ -49,10 +49,10 @@ message QoSProfile { service QoSProfileService { - rpc CreateQoSProfile (QoSProfile ) returns ( QoSProfile ) {} - rpc UpdateQoSProfile (QoSProfile ) returns ( QoSProfile ) {} - rpc DeleteQoSProfile (context.QoSProfileId ) returns ( context.Empty ) {} - rpc GetQoSProfile (context.QoSProfileId ) returns ( QoSProfile ) {} - rpc GetQoSProfiles (context.Empty ) returns (stream QoSProfile ) {} - rpc GetConstraintListFromQoSProfile (QoDConstraintsRequest) returns (stream context.Constraint ) {} + rpc CreateQoSProfile (QoSProfile ) returns ( QoSProfile ) {} + rpc UpdateQoSProfile (QoSProfile ) returns ( QoSProfile ) {} + rpc DeleteQoSProfile (context.QoSProfileId ) returns ( context.Empty ) {} + rpc GetQoSProfile (context.QoSProfileId ) returns ( QoSProfile ) {} + rpc GetQoSProfiles (context.Empty ) returns (stream QoSProfile ) {} + rpc GetConstraintListFromQoSProfile (QoDConstraintsRequest) returns (stream context.Constraint) {} } -- GitLab