diff --git a/charts/common/Chart.yaml b/charts/common/Chart.yaml index 777e07ed..eba8ef5d 100644 --- a/charts/common/Chart.yaml +++ b/charts/common/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: common description: A generic helm chart for Kubernetes type: application -version: 0.6.8 +version: 0.7.0 maintainers: - name: Parity url: https://github.com/paritytech/helm-charts diff --git a/charts/common/ci/kind-values.yaml b/charts/common/ci/kind-values.yaml index 09afde0a..87740165 100644 --- a/charts/common/ci/kind-values.yaml +++ b/charts/common/ci/kind-values.yaml @@ -12,6 +12,9 @@ service: targetPort: 80 protocol: TCP +autoscaling: + enabled: true + env: RANDOM_ENV_VAR: justsomerandom diff --git a/charts/common/templates/hpa.yaml b/charts/common/templates/hpa.yaml index f9abc24b..b3fa15cf 100644 --- a/charts/common/templates/hpa.yaml +++ b/charts/common/templates/hpa.yaml @@ -1,5 +1,9 @@ {{- if .Values.autoscaling.enabled }} +{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: autoscaling/v2 +{{- else -}} apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: {{ template "common.fullname" . }} @@ -18,12 +22,24 @@ spec: - type: Resource resource: name: cpu + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- else -}} targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- else -}} + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/node/Chart.yaml b/charts/node/Chart.yaml index 9169f3e5..78da359e 100644 --- a/charts/node/Chart.yaml +++ b/charts/node/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: node description: A Helm chart to deploy Substrate/Polkadot nodes type: application -version: 5.1.4 +version: 5.1.5 maintainers: - name: Parity url: https://github.com/paritytech/helm-charts diff --git a/charts/node/README.md b/charts/node/README.md index 7e07a4bf..8a8e61fe 100644 --- a/charts/node/README.md +++ b/charts/node/README.md @@ -18,7 +18,7 @@ This is intended behaviour. Make sure to run `git add -A` once again to stage ch # Substrate/Polkadot node helm chart -![Version: 5.1.4](https://img.shields.io/badge/Version-5.1.4-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 5.1.5](https://img.shields.io/badge/Version-5.1.5-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ## Maintainers diff --git a/charts/node/ci/kind-values.yaml b/charts/node/ci/kind-values.yaml index 28c0bdff..2e4cb49b 100644 --- a/charts/node/ci/kind-values.yaml +++ b/charts/node/ci/kind-values.yaml @@ -15,3 +15,8 @@ node: whenScaled: Delete image: tag: v0.9.43 +autoscaling: + enabled: true + targetCPU: 80 + targetMemory: 80 + maxReplicas: 2 diff --git a/charts/node/templates/hpa.yaml b/charts/node/templates/hpa.yaml index e5e6829d..b4bba780 100644 --- a/charts/node/templates/hpa.yaml +++ b/charts/node/templates/hpa.yaml @@ -1,6 +1,6 @@ {{ $fullname := include "node.fullname" . }} {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta2 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ $fullname }} diff --git a/charts/substrate-telemetry/Chart.yaml b/charts/substrate-telemetry/Chart.yaml index 14f8bf16..34b6f055 100644 --- a/charts/substrate-telemetry/Chart.yaml +++ b/charts/substrate-telemetry/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "2.3.0" +version: "2.3.1" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/substrate-telemetry/ci/kind-values.yaml b/charts/substrate-telemetry/ci/kind-values.yaml new file mode 100644 index 00000000..b7612b45 --- /dev/null +++ b/charts/substrate-telemetry/ci/kind-values.yaml @@ -0,0 +1,5 @@ +autoscaling: + shard: + enabled: true + frontend: + enabled: true diff --git a/charts/substrate-telemetry/templates/frontend-hpa.yaml b/charts/substrate-telemetry/templates/frontend-hpa.yaml index 6546c3f5..598e9d34 100644 --- a/charts/substrate-telemetry/templates/frontend-hpa.yaml +++ b/charts/substrate-telemetry/templates/frontend-hpa.yaml @@ -1,5 +1,9 @@ {{- if .Values.autoscaling.frontend.enabled }} +{{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: autoscaling/v2 +{{- else -}} apiVersion: autoscaling/v2beta1 +{{- end }} kind: HorizontalPodAutoscaler metadata: name: telemetry-frontend @@ -18,12 +22,24 @@ spec: - type: Resource resource: name: cpu + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.frontend.targetCPUUtilizationPercentage }} + {{- else -}} targetAverageUtilization: {{ .Values.autoscaling.frontend.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} {{- if .Values.autoscaling.frontend.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.frontend.targetMemoryUtilizationPercentage }} + {{- else -}} targetAverageUtilization: {{ .Values.autoscaling.frontend.targetMemoryUtilizationPercentage }} + {{- end }} {{- end }} {{- end }} diff --git a/charts/substrate-telemetry/templates/shard-hpa.yaml b/charts/substrate-telemetry/templates/shard-hpa.yaml index 5e2e106a..6e8528c6 100644 --- a/charts/substrate-telemetry/templates/shard-hpa.yaml +++ b/charts/substrate-telemetry/templates/shard-hpa.yaml @@ -22,12 +22,24 @@ spec: - type: Resource resource: name: cpu + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.shard.targetCPUUtilizationPercentage }} + {{- else -}} targetAverageUtilization: {{ .Values.autoscaling.shard.targetCPUUtilizationPercentage }} + {{- end }} {{- end }} {{- if .Values.autoscaling.shard.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory + {{- if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.shard.targetMemoryUtilizationPercentage }} + {{- else -}} targetAverageUtilization: {{ .Values.autoscaling.shard.targetMemoryUtilizationPercentage }} + {{- end }} {{- end }} {{- end }}