diff --git a/manifests/deviceservice.yaml b/manifests/deviceservice.yaml index fdc3cea028a181b7dafbcfa6f3ef4e798939438e..6181fc63a7a3982273491da00d9d3bbb365da352 100644 --- a/manifests/deviceservice.yaml +++ b/manifests/deviceservice.yaml @@ -70,11 +70,30 @@ spec: selector: app: deviceservice ports: - - name: grpc - protocol: TCP - port: 2020 - targetPort: 2020 - - name: metrics - protocol: TCP - port: 9192 - targetPort: 9192 + - name: grpc + protocol: TCP + port: 2020 + targetPort: 2020 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: deviceservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: deviceservice + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/manifests/monitoringservice.yaml b/manifests/monitoringservice.yaml index 3a4d43cd9d17d645da4d70a22ec4dde12a8d7bc2..6700afdd64897149760f0c4effe02caf6045365f 100644 --- a/manifests/monitoringservice.yaml +++ b/manifests/monitoringservice.yaml @@ -65,11 +65,30 @@ spec: selector: app: monitoringservice ports: - - name: grpc - protocol: TCP - port: 7070 - targetPort: 7070 - - name: metrics - protocol: TCP - port: 9192 - targetPort: 9192 + - name: grpc + protocol: TCP + port: 7070 + targetPort: 7070 + - name: metrics + protocol: TCP + port: 9192 + targetPort: 9192 +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: monitoringservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: monitoringservice + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/manifests/webuiservice.yaml b/manifests/webuiservice.yaml index bb2573c454a7bf59364a7526a1b5193111daf892..87fe577196199924256c07f553307a3ec31a993e 100644 --- a/manifests/webuiservice.yaml +++ b/manifests/webuiservice.yaml @@ -111,9 +111,32 @@ spec: selector: app: webuiservice ports: - - name: webui - port: 8004 - targetPort: 8004 - - name: grafana - port: 3000 - targetPort: 3000 + - name: webui + port: 8004 + targetPort: 8004 + - name: grafana + port: 3000 + targetPort: 3000 +# TESTING +--- +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: webuiservice-hpa +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: webuiservice + minReplicas: 1 + maxReplicas: 20 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 50 + #behavior: + # scaleDown: + # stabilizationWindowSeconds: 30