Skip to content

Commit

Permalink
Default hpa (#21)
Browse files Browse the repository at this point in the history
* feature: new defaults and optional parameters

Signed-off-by: Dmitriy Safronov <zimniy@cyberbrain.pw>

* chart version bump

Signed-off-by: Dmitriy Safronov <zimniy@cyberbrain.pw>

---------

Signed-off-by: Dmitriy Safronov <zimniy@cyberbrain.pw>
  • Loading branch information
dmitriysafronov authored Dec 23, 2024
1 parent b5299ea commit 0ae022d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/default/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 3.1.0
version: 3.2.0

# 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
Expand Down
6 changes: 4 additions & 2 deletions charts/default/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ spec:
apiVersion: apps/v1
kind: Deployment
name: {{ include "default.fullname" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
minReplicas: {{ default 1 .Values.autoscaling.minReplicas }}
maxReplicas: {{ default 2 .Values.autoscaling.maxReplicas }}
{{- if or .Values.autoscaling.targetCPUUtilizationPercentage .Values.autoscaling.targetMemoryUtilizationPercentage }}
metrics:
{{- if .Values.autoscaling.targetCPUUtilizationPercentage }}
- type: Resource
Expand All @@ -29,4 +30,5 @@ spec:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 0ae022d

Please sign in to comment.