From ad6f25d155441c8fa01db05c3431f6c2724f6e2e Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Wed, 9 Jul 2025 18:13:25 +0300 Subject: [PATCH 01/10] chore: add HorizontalPodAutoscalers to UIs and services On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/templates/hpa.yaml | 19 +++++++++++++++++++ charts/kubernetes-graphql-gateway/Chart.yaml | 2 +- .../templates/hpa.yaml | 19 +++++++++++++++++++ charts/portal/Chart.yaml | 2 +- charts/portal/templates/hpa.yaml | 19 +++++++++++++++++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 charts/example-content/templates/hpa.yaml create mode 100644 charts/kubernetes-graphql-gateway/templates/hpa.yaml create mode 100644 charts/portal/templates/hpa.yaml diff --git a/charts/example-content/templates/hpa.yaml b/charts/example-content/templates/hpa.yaml new file mode 100644 index 000000000..b0038a076 --- /dev/null +++ b/charts/example-content/templates/hpa.yaml @@ -0,0 +1,19 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "common.entity.name" . }} + namespace: {{ .Release.Namespace }} +spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "common.entity.name" . }} diff --git a/charts/kubernetes-graphql-gateway/Chart.yaml b/charts/kubernetes-graphql-gateway/Chart.yaml index cfc3c2587..14bfec558 100644 --- a/charts/kubernetes-graphql-gateway/Chart.yaml +++ b/charts/kubernetes-graphql-gateway/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -version: 0.20.34 +version: 0.20.35 appVersion: v0.83.5 name: kubernetes-graphql-gateway description: Basic helm chart that contains listener and gateway diff --git a/charts/kubernetes-graphql-gateway/templates/hpa.yaml b/charts/kubernetes-graphql-gateway/templates/hpa.yaml new file mode 100644 index 000000000..b0038a076 --- /dev/null +++ b/charts/kubernetes-graphql-gateway/templates/hpa.yaml @@ -0,0 +1,19 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "common.entity.name" . }} + namespace: {{ .Release.Namespace }} +spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "common.entity.name" . }} diff --git a/charts/portal/Chart.yaml b/charts/portal/Chart.yaml index 449a4d42f..9f88e5d54 100644 --- a/charts/portal/Chart.yaml +++ b/charts/portal/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 description: Helm Chart for the openmfp Portal name: portal -version: 0.74.11 +version: 0.74.12 appVersion: "v0.377.193" dependencies: - name: common diff --git a/charts/portal/templates/hpa.yaml b/charts/portal/templates/hpa.yaml new file mode 100644 index 000000000..b0038a076 --- /dev/null +++ b/charts/portal/templates/hpa.yaml @@ -0,0 +1,19 @@ +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "common.entity.name" . }} + namespace: {{ .Release.Namespace }} +spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "common.entity.name" . }} From 359f23c4b71d0c538bde2c4b2d098111e39bef3d Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Wed, 9 Jul 2025 18:17:13 +0300 Subject: [PATCH 02/10] fix typo in Chart.yaml On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/kubernetes-graphql-gateway/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kubernetes-graphql-gateway/Chart.yaml b/charts/kubernetes-graphql-gateway/Chart.yaml index 14bfec558..9b1af74b0 100644 --- a/charts/kubernetes-graphql-gateway/Chart.yaml +++ b/charts/kubernetes-graphql-gateway/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -version: 0.20.35 +version: 0.20.36 appVersion: v0.83.5 name: kubernetes-graphql-gateway description: Basic helm chart that contains listener and gateway From 7647c0c28ae0a3bbeee565969f1879fa6701f6dc Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Wed, 9 Jul 2025 18:19:26 +0300 Subject: [PATCH 03/10] update test snapshot On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- .../__snapshot__/snapshot_test.yaml.snap | 48 +++++++++++++++-- .../__snapshot__/test_values_test.yaml.snap | 32 +++++++++--- .../tests/__snapshot__/istio_test.yaml.snap | 52 ++++++++++++++++--- 3 files changed, 116 insertions(+), 16 deletions(-) diff --git a/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap b/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap index 6836f6035..91b5b81b6 100644 --- a/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap +++ b/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap @@ -118,6 +118,26 @@ matches the snapshot: - emptyDir: {} name: run-volume 4: | + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: RELEASE-NAME-example-content + namespace: NAMESPACE + spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: RELEASE-NAME-example-content + 5: | apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: @@ -137,7 +157,7 @@ matches the snapshot: host: RELEASE-NAME-example-content.NAMESPACE.svc.cluster.local port: number: 8080 - 5: | + 6: | apiVersion: v1 imagePullSecrets: - name: github @@ -145,7 +165,7 @@ matches the snapshot: metadata: name: RELEASE-NAME-example-content namespace: NAMESPACE - 6: | + 7: | apiVersion: v1 kind: Service metadata: @@ -279,6 +299,26 @@ matches the snapshot (internalUrl): - emptyDir: {} name: run-volume 4: | + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: RELEASE-NAME-example-content + namespace: NAMESPACE + spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: RELEASE-NAME-example-content + 5: | apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: @@ -298,7 +338,7 @@ matches the snapshot (internalUrl): host: RELEASE-NAME-example-content.NAMESPACE.svc.cluster.local port: number: 8080 - 5: | + 6: | apiVersion: v1 imagePullSecrets: - name: github @@ -306,7 +346,7 @@ matches the snapshot (internalUrl): metadata: name: RELEASE-NAME-example-content namespace: NAMESPACE - 6: | + 7: | apiVersion: v1 kind: Service metadata: diff --git a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap index 83e85a54e..98cedd113 100644 --- a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap +++ b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap @@ -175,6 +175,26 @@ match the Snapshot: name: virtual-workspaces-config name: virtual-workspaces-config-volume 2: | + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: openmfp-kubernetes-graphql-gateway + namespace: openmfp-system + spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: openmfp-kubernetes-graphql-gateway + 3: | apiVersion: security.istio.io/v1 kind: AuthorizationPolicy metadata: @@ -202,7 +222,7 @@ match the Snapshot: selector: matchLabels: app: openmfp-kubernetes-graphql-gateway - 3: | + 4: | apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: @@ -213,7 +233,7 @@ match the Snapshot: trafficPolicy: tls: mode: ISTIO_MUTUAL - 4: | + 5: | apiVersion: security.istio.io/v1beta1 kind: PeerAuthentication metadata: @@ -225,7 +245,7 @@ match the Snapshot: selector: matchLabels: app: openmfp-kubernetes-graphql-gateway - 5: | + 6: | apiVersion: security.istio.io/v1beta1 kind: RequestAuthentication metadata: @@ -236,7 +256,7 @@ match the Snapshot: selector: matchLabels: app: openmfp-kubernetes-graphql-gateway - 6: | + 7: | apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: @@ -268,7 +288,7 @@ match the Snapshot: host: openmfp-kubernetes-graphql-gateway.openmfp-system.svc.cluster.local port: number: 8080 - 7: | + 8: | apiVersion: v1 imagePullSecrets: - name: github @@ -276,7 +296,7 @@ match the Snapshot: metadata: name: openmfp-kubernetes-graphql-gateway namespace: openmfp-system - 8: | + 9: | apiVersion: v1 kind: Service metadata: diff --git a/charts/portal/tests/__snapshot__/istio_test.yaml.snap b/charts/portal/tests/__snapshot__/istio_test.yaml.snap index 4696ddf7b..da79fd437 100644 --- a/charts/portal/tests/__snapshot__/istio_test.yaml.snap +++ b/charts/portal/tests/__snapshot__/istio_test.yaml.snap @@ -135,6 +135,26 @@ matches the snapshot: terminationGracePeriodSeconds: 10 volumes: null 2: | + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: portal + namespace: NAMESPACE + spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: portal + 3: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -148,7 +168,7 @@ matches the snapshot: - get - watch - list - 3: | + 4: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -161,14 +181,14 @@ matches the snapshot: - kind: ServiceAccount name: portal namespace: NAMESPACE - 4: | + 5: | apiVersion: v1 imagePullSecrets: - name: github kind: ServiceAccount metadata: name: portal - 5: | + 6: | apiVersion: v1 kind: Service metadata: @@ -318,6 +338,26 @@ matches the snapshot with istio disabled: terminationGracePeriodSeconds: 10 volumes: null 2: | + apiVersion: autoscaling/v2 + kind: HorizontalPodAutoscaler + metadata: + name: portal + namespace: NAMESPACE + spec: + maxReplicas: 5 + metrics: + - resource: + name: cpu + target: + averageUtilization: 50 + type: Utilization + type: Resource + minReplicas: 1 + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: portal + 3: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -331,7 +371,7 @@ matches the snapshot with istio disabled: - get - watch - list - 3: | + 4: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -344,14 +384,14 @@ matches the snapshot with istio disabled: - kind: ServiceAccount name: portal namespace: NAMESPACE - 4: | + 5: | apiVersion: v1 imagePullSecrets: - name: github kind: ServiceAccount metadata: name: portal - 5: | + 6: | apiVersion: v1 kind: Service metadata: From 285b1feefd865570b42e1eab1510537646250477 Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Mon, 21 Jul 2025 16:00:54 +0300 Subject: [PATCH 04/10] chore: update version numbers in Chart.yaml files On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/Chart.yaml | 2 +- charts/kubernetes-graphql-gateway/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/example-content/Chart.yaml b/charts/example-content/Chart.yaml index 0b98a7c13..81ae71981 100644 --- a/charts/example-content/Chart.yaml +++ b/charts/example-content/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "v0.158.15" description: Helm Chart for the openmfp Portal name: example-content -version: 0.114.39 +version: 0.114.40 dependencies: - name: common version: 0.5.2 diff --git a/charts/kubernetes-graphql-gateway/Chart.yaml b/charts/kubernetes-graphql-gateway/Chart.yaml index 9b1af74b0..55d7ff8d4 100644 --- a/charts/kubernetes-graphql-gateway/Chart.yaml +++ b/charts/kubernetes-graphql-gateway/Chart.yaml @@ -1,5 +1,5 @@ apiVersion: v2 -version: 0.20.36 +version: 0.20.37 appVersion: v0.83.5 name: kubernetes-graphql-gateway description: Basic helm chart that contains listener and gateway From a45e6375559480460038827f93387edd1a657b1a Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Mon, 11 Aug 2025 13:21:51 +0300 Subject: [PATCH 05/10] feat(hpa): add Horizontal Pod Autoscaler configuration with customizable replicas and metrics On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/templates/hpa.yaml | 20 +++++++++++-------- .../__snapshot__/snapshot_test.yaml.snap | 8 ++++---- charts/example-content/values.yaml | 13 ++++++++++++ .../templates/hpa.yaml | 20 +++++++++++-------- .../__snapshot__/test_values_test.yaml.snap | 4 ++-- charts/kubernetes-graphql-gateway/values.yaml | 12 +++++++++++ charts/portal/templates/hpa.yaml | 20 +++++++++++-------- .../tests/__snapshot__/istio_test.yaml.snap | 8 ++++---- charts/portal/values.yaml | 13 ++++++++++++ 9 files changed, 84 insertions(+), 34 deletions(-) diff --git a/charts/example-content/templates/hpa.yaml b/charts/example-content/templates/hpa.yaml index b0038a076..58fed2109 100644 --- a/charts/example-content/templates/hpa.yaml +++ b/charts/example-content/templates/hpa.yaml @@ -1,19 +1,23 @@ +{{- if .Values.hpa.enabled }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: - maxReplicas: 5 + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} metrics: - - resource: - name: cpu - target: - averageUtilization: 50 - type: Utilization - type: Resource - minReplicas: 1 + {{- range .Values.hpa.metrics }} + - type: {{ .type }} + resource: + name: {{ .resource.name }} + target: + type: {{ .resource.target.type }} + averageUtilization: {{ .resource.target.averageUtilization }} + {{- end }} scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "common.entity.name" . }} +{{- end }} diff --git a/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap b/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap index 91b5b81b6..9db51a081 100644 --- a/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap +++ b/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap @@ -124,12 +124,12 @@ matches the snapshot: name: RELEASE-NAME-example-content namespace: NAMESPACE spec: - maxReplicas: 5 + maxReplicas: 10 metrics: - resource: name: cpu target: - averageUtilization: 50 + averageUtilization: 80 type: Utilization type: Resource minReplicas: 1 @@ -305,12 +305,12 @@ matches the snapshot (internalUrl): name: RELEASE-NAME-example-content namespace: NAMESPACE spec: - maxReplicas: 5 + maxReplicas: 10 metrics: - resource: name: cpu target: - averageUtilization: 50 + averageUtilization: 80 type: Utilization type: Resource minReplicas: 1 diff --git a/charts/example-content/values.yaml b/charts/example-content/values.yaml index deb635102..2714ebdb4 100644 --- a/charts/example-content/values.yaml +++ b/charts/example-content/values.yaml @@ -33,3 +33,16 @@ contentConfigurations: # internalUrl: null contentProtocolDomain: https://example-content.some-domain.com + +hpa: + # Horizontal Pod Autoscaler configuration + enabled: true + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/charts/kubernetes-graphql-gateway/templates/hpa.yaml b/charts/kubernetes-graphql-gateway/templates/hpa.yaml index b0038a076..58fed2109 100644 --- a/charts/kubernetes-graphql-gateway/templates/hpa.yaml +++ b/charts/kubernetes-graphql-gateway/templates/hpa.yaml @@ -1,19 +1,23 @@ +{{- if .Values.hpa.enabled }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: - maxReplicas: 5 + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} metrics: - - resource: - name: cpu - target: - averageUtilization: 50 - type: Utilization - type: Resource - minReplicas: 1 + {{- range .Values.hpa.metrics }} + - type: {{ .type }} + resource: + name: {{ .resource.name }} + target: + type: {{ .resource.target.type }} + averageUtilization: {{ .resource.target.averageUtilization }} + {{- end }} scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "common.entity.name" . }} +{{- end }} diff --git a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap index 98cedd113..d2114cc66 100644 --- a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap +++ b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap @@ -181,12 +181,12 @@ match the Snapshot: name: openmfp-kubernetes-graphql-gateway namespace: openmfp-system spec: - maxReplicas: 5 + maxReplicas: 10 metrics: - resource: name: cpu target: - averageUtilization: 50 + averageUtilization: 80 type: Utilization type: Resource minReplicas: 1 diff --git a/charts/kubernetes-graphql-gateway/values.yaml b/charts/kubernetes-graphql-gateway/values.yaml index 9c138b2d4..058286457 100644 --- a/charts/kubernetes-graphql-gateway/values.yaml +++ b/charts/kubernetes-graphql-gateway/values.yaml @@ -111,3 +111,15 @@ health: path: "/readyz" failureThreshold: 30 periodSeconds: 10 +hpa: + # Horizontal Pod Autoscaler configuration + enabled: true + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 diff --git a/charts/portal/templates/hpa.yaml b/charts/portal/templates/hpa.yaml index b0038a076..58fed2109 100644 --- a/charts/portal/templates/hpa.yaml +++ b/charts/portal/templates/hpa.yaml @@ -1,19 +1,23 @@ +{{- if .Values.hpa.enabled }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "common.entity.name" . }} namespace: {{ .Release.Namespace }} spec: - maxReplicas: 5 + minReplicas: {{ .Values.hpa.minReplicas }} + maxReplicas: {{ .Values.hpa.maxReplicas }} metrics: - - resource: - name: cpu - target: - averageUtilization: 50 - type: Utilization - type: Resource - minReplicas: 1 + {{- range .Values.hpa.metrics }} + - type: {{ .type }} + resource: + name: {{ .resource.name }} + target: + type: {{ .resource.target.type }} + averageUtilization: {{ .resource.target.averageUtilization }} + {{- end }} scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "common.entity.name" . }} +{{- end }} diff --git a/charts/portal/tests/__snapshot__/istio_test.yaml.snap b/charts/portal/tests/__snapshot__/istio_test.yaml.snap index da79fd437..0b69d851e 100644 --- a/charts/portal/tests/__snapshot__/istio_test.yaml.snap +++ b/charts/portal/tests/__snapshot__/istio_test.yaml.snap @@ -141,12 +141,12 @@ matches the snapshot: name: portal namespace: NAMESPACE spec: - maxReplicas: 5 + maxReplicas: 10 metrics: - resource: name: cpu target: - averageUtilization: 50 + averageUtilization: 80 type: Utilization type: Resource minReplicas: 1 @@ -344,12 +344,12 @@ matches the snapshot with istio disabled: name: portal namespace: NAMESPACE spec: - maxReplicas: 5 + maxReplicas: 10 metrics: - resource: name: cpu target: - averageUtilization: 50 + averageUtilization: 80 type: Utilization type: Resource minReplicas: 1 diff --git a/charts/portal/values.yaml b/charts/portal/values.yaml index c1d2d5d54..3b665a688 100644 --- a/charts/portal/values.yaml +++ b/charts/portal/values.yaml @@ -77,3 +77,16 @@ health: startup: # -- path used for the startup probe path: /rest/health + +hpa: + # Horizontal Pod Autoscaler configuration + enabled: true + minReplicas: 1 + maxReplicas: 10 + metrics: + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: 80 From 9f55ed32e9f054cf38a3179dd92a221a9f276c2d Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Mon, 11 Aug 2025 13:25:42 +0300 Subject: [PATCH 06/10] update docs On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/README.md | 7 +++++++ charts/kubernetes-graphql-gateway/README.md | 7 +++++++ charts/portal/README.md | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/charts/example-content/README.md b/charts/example-content/README.md index 4379b54a3..5f47e0538 100644 --- a/charts/example-content/README.md +++ b/charts/example-content/README.md @@ -15,6 +15,13 @@ Helm Chart for the openmfp Portal | contentConfigurations.wc.internalUrl | string | `"http://openmfp-example-content.openmfp-system.svc.cluster.local:8080/ui/example-content/wc/assets/config.json"` | | | contentConfigurations.wc.url | string | `"http://localhost:8000/ui/example-content/wc/assets/config.json"` | | | contentProtocolDomain | string | `"https://example-content.some-domain.com"` | | +| hpa.enabled | bool | `true` | | +| hpa.maxReplicas | int | `10` | | +| hpa.metrics[0].resource.name | string | `"cpu"` | | +| hpa.metrics[0].resource.target.averageUtilization | int | `80` | | +| hpa.metrics[0].resource.target.type | string | `"Utilization"` | | +| hpa.metrics[0].type | string | `"Resource"` | | +| hpa.minReplicas | int | `1` | | | image.name | string | `"ghcr.io/openmfp/example-content"` | The image name | | istio.enabled | bool | `true` | | | istio.virtualService.hosts[0] | string | `"*"` | | diff --git a/charts/kubernetes-graphql-gateway/README.md b/charts/kubernetes-graphql-gateway/README.md index 2c8135264..1c79db72c 100644 --- a/charts/kubernetes-graphql-gateway/README.md +++ b/charts/kubernetes-graphql-gateway/README.md @@ -46,6 +46,13 @@ kubeConfig: | health.startup.failureThreshold | int | `30` | | | health.startup.path | string | `"/readyz"` | | | health.startup.periodSeconds | int | `10` | | +| hpa.enabled | bool | `true` | | +| hpa.maxReplicas | int | `10` | | +| hpa.metrics[0].resource.name | string | `"cpu"` | | +| hpa.metrics[0].resource.target.averageUtilization | int | `80` | | +| hpa.metrics[0].resource.target.type | string | `"Utilization"` | | +| hpa.metrics[0].type | string | `"Resource"` | | +| hpa.minReplicas | int | `1` | | | image.name | string | `"ghcr.io/openmfp/kubernetes-graphql-gateway"` | | | image.pullPolicy | string | `"IfNotPresent"` | | | istio.enabled | bool | `true` | | diff --git a/charts/portal/README.md b/charts/portal/README.md index 97d6324a8..bccd1dd24 100644 --- a/charts/portal/README.md +++ b/charts/portal/README.md @@ -21,6 +21,13 @@ Helm Chart for the openmfp Portal | health.port | int | `9000` | health port to be used by probes | | health.readiness.path | string | `"/rest/health"` | path used for the readiness probe | | health.startup.path | string | `"/rest/health"` | path used for the startup probe | +| hpa.enabled | bool | `true` | | +| hpa.maxReplicas | int | `10` | | +| hpa.metrics[0].resource.name | string | `"cpu"` | | +| hpa.metrics[0].resource.target.averageUtilization | int | `80` | | +| hpa.metrics[0].resource.target.type | string | `"Utilization"` | | +| hpa.metrics[0].type | string | `"Resource"` | | +| hpa.minReplicas | int | `1` | | | http.protocol | string | `"http"` | protocol | | image.name | string | `"ghcr.io/openmfp/portal"` | | | image.pullPolicyOverride | string | `"IfNotPresent"` | | From 2aef5c7f933fd0a027cd3b60821070a5829ebe26 Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Mon, 11 Aug 2025 13:27:19 +0300 Subject: [PATCH 07/10] fix: update snapshot for virtual workspaces configuration On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- .../tests/__snapshot__/test_values_test.yaml.snap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap index d2114cc66..bdd1dfe6e 100644 --- a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap +++ b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap @@ -313,7 +313,7 @@ match the Snapshot: selector: app: openmfp-kubernetes-graphql-gateway type: ClusterIP - 9: | + 10: | apiVersion: v1 data: virtual-workspaces.yaml: "virtualWorkspaces:\n - name: custom-ws\n url: https://example.com\n kubeconfig: /etc/kubeconfig/kubeconfig " From baf1d6914169a1dde1ba6d8adedbb17f11d9eae2 Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Tue, 12 Aug 2025 17:26:44 +0300 Subject: [PATCH 08/10] refactor: update Horizontal Pod Autoscaler configuration for consistency and clarity On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/templates/hpa.yaml | 4 +- .../__snapshot__/snapshot_test.yaml.snap | 48 ++--------------- charts/example-content/values.yaml | 24 ++++----- .../templates/hpa.yaml | 4 +- .../__snapshot__/test_values_test.yaml.snap | 34 +++--------- charts/kubernetes-graphql-gateway/values.yaml | 25 ++++----- charts/portal/templates/hpa.yaml | 4 +- .../tests/__snapshot__/istio_test.yaml.snap | 52 +++---------------- charts/portal/values.yaml | 24 ++++----- 9 files changed, 60 insertions(+), 159 deletions(-) diff --git a/charts/example-content/templates/hpa.yaml b/charts/example-content/templates/hpa.yaml index 58fed2109..25e1ae7d8 100644 --- a/charts/example-content/templates/hpa.yaml +++ b/charts/example-content/templates/hpa.yaml @@ -1,4 +1,4 @@ -{{- if .Values.hpa.enabled }} +{{- if ((.Values).hpa).enabled | default false }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -20,4 +20,4 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "common.entity.name" . }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap b/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap index 9db51a081..6836f6035 100644 --- a/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap +++ b/charts/example-content/tests/__snapshot__/snapshot_test.yaml.snap @@ -118,26 +118,6 @@ matches the snapshot: - emptyDir: {} name: run-volume 4: | - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: RELEASE-NAME-example-content - namespace: NAMESPACE - spec: - maxReplicas: 10 - metrics: - - resource: - name: cpu - target: - averageUtilization: 80 - type: Utilization - type: Resource - minReplicas: 1 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: RELEASE-NAME-example-content - 5: | apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: @@ -157,7 +137,7 @@ matches the snapshot: host: RELEASE-NAME-example-content.NAMESPACE.svc.cluster.local port: number: 8080 - 6: | + 5: | apiVersion: v1 imagePullSecrets: - name: github @@ -165,7 +145,7 @@ matches the snapshot: metadata: name: RELEASE-NAME-example-content namespace: NAMESPACE - 7: | + 6: | apiVersion: v1 kind: Service metadata: @@ -299,26 +279,6 @@ matches the snapshot (internalUrl): - emptyDir: {} name: run-volume 4: | - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: RELEASE-NAME-example-content - namespace: NAMESPACE - spec: - maxReplicas: 10 - metrics: - - resource: - name: cpu - target: - averageUtilization: 80 - type: Utilization - type: Resource - minReplicas: 1 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: RELEASE-NAME-example-content - 5: | apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: @@ -338,7 +298,7 @@ matches the snapshot (internalUrl): host: RELEASE-NAME-example-content.NAMESPACE.svc.cluster.local port: number: 8080 - 6: | + 5: | apiVersion: v1 imagePullSecrets: - name: github @@ -346,7 +306,7 @@ matches the snapshot (internalUrl): metadata: name: RELEASE-NAME-example-content namespace: NAMESPACE - 7: | + 6: | apiVersion: v1 kind: Service metadata: diff --git a/charts/example-content/values.yaml b/charts/example-content/values.yaml index 2714ebdb4..7ee919061 100644 --- a/charts/example-content/values.yaml +++ b/charts/example-content/values.yaml @@ -34,15 +34,15 @@ contentConfigurations: contentProtocolDomain: https://example-content.some-domain.com -hpa: - # Horizontal Pod Autoscaler configuration - enabled: true - minReplicas: 1 - maxReplicas: 10 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 80 +# Horizontal Pod Autoscaler configuration +# hpa: +# enabled: true +# minReplicas: 1 +# maxReplicas: 10 +# metrics: +# - type: Resource +# resource: +# name: cpu +# target: +# type: Utilization +# averageUtilization: 80 \ No newline at end of file diff --git a/charts/kubernetes-graphql-gateway/templates/hpa.yaml b/charts/kubernetes-graphql-gateway/templates/hpa.yaml index 58fed2109..25e1ae7d8 100644 --- a/charts/kubernetes-graphql-gateway/templates/hpa.yaml +++ b/charts/kubernetes-graphql-gateway/templates/hpa.yaml @@ -1,4 +1,4 @@ -{{- if .Values.hpa.enabled }} +{{- if ((.Values).hpa).enabled | default false }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -20,4 +20,4 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "common.entity.name" . }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap index bdd1dfe6e..83e85a54e 100644 --- a/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap +++ b/charts/kubernetes-graphql-gateway/tests/__snapshot__/test_values_test.yaml.snap @@ -175,26 +175,6 @@ match the Snapshot: name: virtual-workspaces-config name: virtual-workspaces-config-volume 2: | - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: openmfp-kubernetes-graphql-gateway - namespace: openmfp-system - spec: - maxReplicas: 10 - metrics: - - resource: - name: cpu - target: - averageUtilization: 80 - type: Utilization - type: Resource - minReplicas: 1 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: openmfp-kubernetes-graphql-gateway - 3: | apiVersion: security.istio.io/v1 kind: AuthorizationPolicy metadata: @@ -222,7 +202,7 @@ match the Snapshot: selector: matchLabels: app: openmfp-kubernetes-graphql-gateway - 4: | + 3: | apiVersion: networking.istio.io/v1alpha3 kind: DestinationRule metadata: @@ -233,7 +213,7 @@ match the Snapshot: trafficPolicy: tls: mode: ISTIO_MUTUAL - 5: | + 4: | apiVersion: security.istio.io/v1beta1 kind: PeerAuthentication metadata: @@ -245,7 +225,7 @@ match the Snapshot: selector: matchLabels: app: openmfp-kubernetes-graphql-gateway - 6: | + 5: | apiVersion: security.istio.io/v1beta1 kind: RequestAuthentication metadata: @@ -256,7 +236,7 @@ match the Snapshot: selector: matchLabels: app: openmfp-kubernetes-graphql-gateway - 7: | + 6: | apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: @@ -288,7 +268,7 @@ match the Snapshot: host: openmfp-kubernetes-graphql-gateway.openmfp-system.svc.cluster.local port: number: 8080 - 8: | + 7: | apiVersion: v1 imagePullSecrets: - name: github @@ -296,7 +276,7 @@ match the Snapshot: metadata: name: openmfp-kubernetes-graphql-gateway namespace: openmfp-system - 9: | + 8: | apiVersion: v1 kind: Service metadata: @@ -313,7 +293,7 @@ match the Snapshot: selector: app: openmfp-kubernetes-graphql-gateway type: ClusterIP - 10: | + 9: | apiVersion: v1 data: virtual-workspaces.yaml: "virtualWorkspaces:\n - name: custom-ws\n url: https://example.com\n kubeconfig: /etc/kubeconfig/kubeconfig " diff --git a/charts/kubernetes-graphql-gateway/values.yaml b/charts/kubernetes-graphql-gateway/values.yaml index 058286457..4c059e9a4 100644 --- a/charts/kubernetes-graphql-gateway/values.yaml +++ b/charts/kubernetes-graphql-gateway/values.yaml @@ -111,15 +111,16 @@ health: path: "/readyz" failureThreshold: 30 periodSeconds: 10 -hpa: - # Horizontal Pod Autoscaler configuration - enabled: true - minReplicas: 1 - maxReplicas: 10 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 80 + +# Horizontal Pod Autoscaler configuration +# hpa: +# enabled: true +# minReplicas: 1 +# maxReplicas: 10 +# metrics: +# - type: Resource +# resource: +# name: cpu +# target: +# type: Utilization +# averageUtilization: 80 diff --git a/charts/portal/templates/hpa.yaml b/charts/portal/templates/hpa.yaml index 58fed2109..25e1ae7d8 100644 --- a/charts/portal/templates/hpa.yaml +++ b/charts/portal/templates/hpa.yaml @@ -1,4 +1,4 @@ -{{- if .Values.hpa.enabled }} +{{- if ((.Values).hpa).enabled | default false }} apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: @@ -20,4 +20,4 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ include "common.entity.name" . }} -{{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/portal/tests/__snapshot__/istio_test.yaml.snap b/charts/portal/tests/__snapshot__/istio_test.yaml.snap index 0b69d851e..4696ddf7b 100644 --- a/charts/portal/tests/__snapshot__/istio_test.yaml.snap +++ b/charts/portal/tests/__snapshot__/istio_test.yaml.snap @@ -135,26 +135,6 @@ matches the snapshot: terminationGracePeriodSeconds: 10 volumes: null 2: | - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: portal - namespace: NAMESPACE - spec: - maxReplicas: 10 - metrics: - - resource: - name: cpu - target: - averageUtilization: 80 - type: Utilization - type: Resource - minReplicas: 1 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: portal - 3: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -168,7 +148,7 @@ matches the snapshot: - get - watch - list - 4: | + 3: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -181,14 +161,14 @@ matches the snapshot: - kind: ServiceAccount name: portal namespace: NAMESPACE - 5: | + 4: | apiVersion: v1 imagePullSecrets: - name: github kind: ServiceAccount metadata: name: portal - 6: | + 5: | apiVersion: v1 kind: Service metadata: @@ -338,26 +318,6 @@ matches the snapshot with istio disabled: terminationGracePeriodSeconds: 10 volumes: null 2: | - apiVersion: autoscaling/v2 - kind: HorizontalPodAutoscaler - metadata: - name: portal - namespace: NAMESPACE - spec: - maxReplicas: 10 - metrics: - - resource: - name: cpu - target: - averageUtilization: 80 - type: Utilization - type: Resource - minReplicas: 1 - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: portal - 3: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: @@ -371,7 +331,7 @@ matches the snapshot with istio disabled: - get - watch - list - 4: | + 3: | apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -384,14 +344,14 @@ matches the snapshot with istio disabled: - kind: ServiceAccount name: portal namespace: NAMESPACE - 5: | + 4: | apiVersion: v1 imagePullSecrets: - name: github kind: ServiceAccount metadata: name: portal - 6: | + 5: | apiVersion: v1 kind: Service metadata: diff --git a/charts/portal/values.yaml b/charts/portal/values.yaml index 3b665a688..0ea97e221 100644 --- a/charts/portal/values.yaml +++ b/charts/portal/values.yaml @@ -78,15 +78,15 @@ health: # -- path used for the startup probe path: /rest/health -hpa: - # Horizontal Pod Autoscaler configuration - enabled: true - minReplicas: 1 - maxReplicas: 10 - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 80 +# Horizontal Pod Autoscaler configuration +# hpa: +# enabled: true +# minReplicas: 1 +# maxReplicas: 10 +# metrics: +# - type: Resource +# resource: +# name: cpu +# target: +# type: Utilization +# averageUtilization: 80 From 7f397e18b4a25f8a1f1a8222729bc1782e17a2df Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Tue, 12 Aug 2025 17:28:41 +0300 Subject: [PATCH 09/10] update docs On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/README.md | 7 ------- charts/kubernetes-graphql-gateway/README.md | 7 ------- charts/portal/README.md | 7 ------- 3 files changed, 21 deletions(-) diff --git a/charts/example-content/README.md b/charts/example-content/README.md index 5f47e0538..4379b54a3 100644 --- a/charts/example-content/README.md +++ b/charts/example-content/README.md @@ -15,13 +15,6 @@ Helm Chart for the openmfp Portal | contentConfigurations.wc.internalUrl | string | `"http://openmfp-example-content.openmfp-system.svc.cluster.local:8080/ui/example-content/wc/assets/config.json"` | | | contentConfigurations.wc.url | string | `"http://localhost:8000/ui/example-content/wc/assets/config.json"` | | | contentProtocolDomain | string | `"https://example-content.some-domain.com"` | | -| hpa.enabled | bool | `true` | | -| hpa.maxReplicas | int | `10` | | -| hpa.metrics[0].resource.name | string | `"cpu"` | | -| hpa.metrics[0].resource.target.averageUtilization | int | `80` | | -| hpa.metrics[0].resource.target.type | string | `"Utilization"` | | -| hpa.metrics[0].type | string | `"Resource"` | | -| hpa.minReplicas | int | `1` | | | image.name | string | `"ghcr.io/openmfp/example-content"` | The image name | | istio.enabled | bool | `true` | | | istio.virtualService.hosts[0] | string | `"*"` | | diff --git a/charts/kubernetes-graphql-gateway/README.md b/charts/kubernetes-graphql-gateway/README.md index 1c79db72c..2c8135264 100644 --- a/charts/kubernetes-graphql-gateway/README.md +++ b/charts/kubernetes-graphql-gateway/README.md @@ -46,13 +46,6 @@ kubeConfig: | health.startup.failureThreshold | int | `30` | | | health.startup.path | string | `"/readyz"` | | | health.startup.periodSeconds | int | `10` | | -| hpa.enabled | bool | `true` | | -| hpa.maxReplicas | int | `10` | | -| hpa.metrics[0].resource.name | string | `"cpu"` | | -| hpa.metrics[0].resource.target.averageUtilization | int | `80` | | -| hpa.metrics[0].resource.target.type | string | `"Utilization"` | | -| hpa.metrics[0].type | string | `"Resource"` | | -| hpa.minReplicas | int | `1` | | | image.name | string | `"ghcr.io/openmfp/kubernetes-graphql-gateway"` | | | image.pullPolicy | string | `"IfNotPresent"` | | | istio.enabled | bool | `true` | | diff --git a/charts/portal/README.md b/charts/portal/README.md index bccd1dd24..97d6324a8 100644 --- a/charts/portal/README.md +++ b/charts/portal/README.md @@ -21,13 +21,6 @@ Helm Chart for the openmfp Portal | health.port | int | `9000` | health port to be used by probes | | health.readiness.path | string | `"/rest/health"` | path used for the readiness probe | | health.startup.path | string | `"/rest/health"` | path used for the startup probe | -| hpa.enabled | bool | `true` | | -| hpa.maxReplicas | int | `10` | | -| hpa.metrics[0].resource.name | string | `"cpu"` | | -| hpa.metrics[0].resource.target.averageUtilization | int | `80` | | -| hpa.metrics[0].resource.target.type | string | `"Utilization"` | | -| hpa.metrics[0].type | string | `"Resource"` | | -| hpa.minReplicas | int | `1` | | | http.protocol | string | `"http"` | protocol | | image.name | string | `"ghcr.io/openmfp/portal"` | | | image.pullPolicyOverride | string | `"IfNotPresent"` | | From 611323583cddbfd9ee5939a0a646672fef68c79f Mon Sep 17 00:00:00 2001 From: Angel Kafazov Date: Tue, 12 Aug 2025 17:33:30 +0300 Subject: [PATCH 10/10] fix: add missing newline at end of values.yaml On-behalf-of: @SAP angel.kafazov@sap.com Signed-off-by: Angel Kafazov --- charts/example-content/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/example-content/values.yaml b/charts/example-content/values.yaml index 7ee919061..352496c58 100644 --- a/charts/example-content/values.yaml +++ b/charts/example-content/values.yaml @@ -45,4 +45,4 @@ contentProtocolDomain: https://example-content.some-domain.com # name: cpu # target: # type: Utilization -# averageUtilization: 80 \ No newline at end of file +# averageUtilization: 80