Skip to content

Commit

Permalink
[stable/k8s-resources] update hpa to latest v2 version (deliveryhero#571
Browse files Browse the repository at this point in the history
)

* add option to override .apiVersion since latest changed

* Update hpa.yaml

* Update Chart.yaml

* Update README.md
  • Loading branch information
orkramer authored and fekaiser committed Oct 23, 2024
1 parent 283a04e commit b76b923
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion stable/k8s-resources/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v1
version: 0.6.5
version: 0.6.6
appVersion: 0.0.1
name: k8s-resources
description: |
Expand Down
2 changes: 1 addition & 1 deletion stable/k8s-resources/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# k8s-resources

![Version: 0.6.5](https://img.shields.io/badge/Version-0.6.5-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square)
![Version: 0.6.6](https://img.shields.io/badge/Version-0.6.6-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square)

Not an application but a Helm chart to create any and many resources in Kubernetes.

Expand Down
10 changes: 7 additions & 3 deletions stable/k8s-resources/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{- if .Values.HorizontalPodAutoscalers -}}
{{- range .Values.HorizontalPodAutoscalers }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
{{- if .namespace }}
Expand All @@ -26,13 +26,17 @@ spec:
- type: Resource
resource:
name: cpu
targetAverageUtilization: {{ .targetCPUUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .targetCPUUtilizationPercentage }}
{{- end }}
{{- if .targetMemoryUtilizationPercentage }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .targetMemoryUtilizationPercentage }}
target:
type: Utilization
averageUtilization: {{ .targetMemoryUtilizationPercentage }}
{{- end }}
---
{{- end }}
Expand Down

0 comments on commit b76b923

Please sign in to comment.