Skip to content

Commit

Permalink
Merge pull request #42 from JacekZubielik/esphome
Browse files Browse the repository at this point in the history
test(hpa): code clean up
  • Loading branch information
JacekZubielik authored Jun 4, 2024
2 parents 3950d5c + 7a7b6f5 commit 31c9393
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion charts/esphome/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v2
appVersion: 2024.5.4
description: ESPHome
name: esphome
version: 0.0.7
version: 0.0.8
keywords:
- esphome
type: application
Expand Down
13 changes: 8 additions & 5 deletions charts/esphome/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,25 @@
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "app.fullname" . }}
name: {{ template "app.fullname" . }}
labels:
{{- include "app.labels" . | nindent 4 }}
app.kubernetes.io/name: {{ include "app.name" . }}
helm.sh/chart: {{ include "app.chart" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include "app.fullname" . }}
name: {{ include "app.name" . }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
metrics:
{{- if .Values.autoscaling.averageCPUUtilizationPercentage }}
- type: ContainerResource
containerResource:
name: cpu
container: {{ include "app.fullname" . }}
container: {{ include "app.name" . }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.averageCPUUtilizationPercentage }}
Expand All @@ -26,7 +29,7 @@ spec:
- type: ContainerResource
containerResource:
name: memory
container: {{ include "app.fullname" . }}
container: {{ include "app.name" . }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.averageMemoryUtilizationPercentage }}
Expand Down

0 comments on commit 31c9393

Please sign in to comment.