From 7a7b6f52fec8a6f273c44f7ab6f224aa60c56ee4 Mon Sep 17 00:00:00 2001 From: JacekZubielik Date: Tue, 4 Jun 2024 21:30:36 +0200 Subject: [PATCH] test(hpa): code clean up --- charts/esphome/Chart.yaml | 2 +- charts/esphome/templates/hpa.yaml | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/charts/esphome/Chart.yaml b/charts/esphome/Chart.yaml index 7b8bee3..0d01cdf 100644 --- a/charts/esphome/Chart.yaml +++ b/charts/esphome/Chart.yaml @@ -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 diff --git a/charts/esphome/templates/hpa.yaml b/charts/esphome/templates/hpa.yaml index de3889c..7b76841 100644 --- a/charts/esphome/templates/hpa.yaml +++ b/charts/esphome/templates/hpa.yaml @@ -2,14 +2,17 @@ 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: @@ -17,7 +20,7 @@ spec: - type: ContainerResource containerResource: name: cpu - container: {{ include "app.fullname" . }} + container: {{ include "app.name" . }} target: type: Utilization averageUtilization: {{ .Values.autoscaling.averageCPUUtilizationPercentage }} @@ -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 }}