Skip to content

Commit

Permalink
[radar-gateway] Made HorizontalPodAutoscaler configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
keyvaann committed Jun 21, 2024
1 parent d955250 commit 087e336
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion charts/radar-gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion charts/radar-gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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 |
Expand Down
22 changes: 15 additions & 7 deletions charts/radar-gateway/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
10 changes: 10 additions & 0 deletions charts/radar-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 087e336

Please sign in to comment.