diff --git a/charts/radar-gateway/Chart.yaml b/charts/radar-gateway/Chart.yaml index bf259008..8fa3f52f 100644 --- a/charts/radar-gateway/Chart.yaml +++ b/charts/radar-gateway/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "0.7.1" description: A Helm chart for RADAR-base gateway. REST Gateway to Kafka, for incoming participant data. It performs authentication, authorization, content validation and decompression. For more details of the configurations, see https://github.com/RADAR-base/RADAR-Gateway/blob/master/gateway.yml. name: radar-gateway -version: 1.1.4 +version: 1.1.5 icon: "http://radar-base.org/wp-content/uploads/2022/09/Logo_RADAR-Base-RGB.png" sources: - https://github.com/RADAR-base/radar-helm-charts/tree/main/charts/radar-gateway diff --git a/charts/radar-gateway/README.md b/charts/radar-gateway/README.md index 73d7836d..0f811dc2 100644 --- a/charts/radar-gateway/README.md +++ b/charts/radar-gateway/README.md @@ -3,7 +3,7 @@ # radar-gateway [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/radar-gateway)](https://artifacthub.io/packages/helm/radar-base/radar-gateway) -![Version: 1.1.4](https://img.shields.io/badge/Version-1.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.1](https://img.shields.io/badge/AppVersion-0.7.1-informational?style=flat-square) +![Version: 1.1.5](https://img.shields.io/badge/Version-1.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.1](https://img.shields.io/badge/AppVersion-0.7.1-informational?style=flat-square) A Helm chart for RADAR-base gateway. REST Gateway to Kafka, for incoming participant data. It performs authentication, authorization, content validation and decompression. For more details of the configurations, see https://github.com/RADAR-base/RADAR-Gateway/blob/master/gateway.yml. @@ -69,6 +69,10 @@ A Helm chart for RADAR-base gateway. REST Gateway to Kafka, for incoming partici | readinessProbe.failureThreshold | int | `3` | Failure threshold for readinessProbe | | networkpolicy | object | check `values.yaml` | Network policy defines who can access this application and who this applications has access to | | serviceMonitor.enabled | bool | `true` | Enable metrics to be collected via Prometheus-operator | +| hpa.enabled | bool | `true` | Enable HPA | +| hpa.maxReplicas | string | `"5"` | Maximum number of replicas | +| hpa.targetCPU | string | `"50"` | Target CPU utilization percentage | +| hpa.targetMemory | string | `"1Gi"` | Target Memory utilization percentage | | managementportal_url | string | `"http://management-portal:8080/managementportal"` | URL of the management portal application | | schemaRegistry | string | `"http://cp-schema-registry:8081"` | Schema Registry URL | | max_requests | int | `1000` | Not used. To be confirmed | diff --git a/charts/radar-gateway/templates/hpa.yaml b/charts/radar-gateway/templates/hpa.yaml index 1146f300..56b5833e 100644 --- a/charts/radar-gateway/templates/hpa.yaml +++ b/charts/radar-gateway/templates/hpa.yaml @@ -1,24 +1,32 @@ -{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}} +{{- if .Values.hpa.enabled }} apiVersion: autoscaling/v2 -{{- else -}} -apiVersion: autoscaling/v2beta2 -{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ include "radar-gateway.fullname" . }} labels: {{ include "radar-gateway.labels" . | indent 4 }} spec: - maxReplicas: 5 - minReplicas: 1 scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "radar-gateway.fullname" . }} + minReplicas: {{ .Values.replicaCount }} + maxReplicas: {{ .Values.hpa.maxReplicas }} metrics: + {{- if .Values.hpa.targetCPU }} - type: Resource resource: name: cpu target: type: Utilization - averageUtilization: 50 + averageUtilization: {{ .Values.hpa.targetCPU }} + {{- end }} + {{- if .Values.hpa.targetMemory }} + - type: Resource + resource: + name: memory + target: + type: Utilization + averageUtilization: {{ .Values.hpa.targetMemory }} + {{- end }} +{{- end }} diff --git a/charts/radar-gateway/values.yaml b/charts/radar-gateway/values.yaml index ce5be25d..8c051351 100644 --- a/charts/radar-gateway/values.yaml +++ b/charts/radar-gateway/values.yaml @@ -183,6 +183,16 @@ serviceMonitor: # -- Enable metrics to be collected via Prometheus-operator enabled: true +hpa: + # -- Enable HPA + enabled: true + # -- Maximum number of replicas + maxReplicas: "5" + # -- Target CPU utilization percentage + targetCPU: "50" + # -- Target Memory utilization percentage + targetMemory: "1Gi" + # -- URL of the management portal application managementportal_url: http://management-portal:8080/managementportal # -- Schema Registry URL