diff --git a/helm/api-platform/templates/hpa.yaml b/helm/api-platform/templates/hpa.yaml index d2b4f759..a8120171 100644 --- a/helm/api-platform/templates/hpa.yaml +++ b/helm/api-platform/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "api-platform.fullname" . }} diff --git a/helm/api-platform/templates/pwa-hpa.yaml b/helm/api-platform/templates/pwa-hpa.yaml new file mode 100644 index 00000000..2780a592 --- /dev/null +++ b/helm/api-platform/templates/pwa-hpa.yaml @@ -0,0 +1,28 @@ +{{- if .Values.autoscaling.enabled }} +apiVersion: autoscaling/v2 +kind: HorizontalPodAutoscaler +metadata: + name: {{ include "api-platform.fullname" . }}-pwa + labels: + {{- include "api-platform.labels" . | nindent 4 }} +spec: + scaleTargetRef: + apiVersion: apps/v1 + kind: Deployment + name: {{ include "api-platform.fullname" . }}-pwa + minReplicas: {{ .Values.autoscaling.minReplicas }} + maxReplicas: {{ .Values.autoscaling.maxReplicas }} + metrics: + {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} + - type: Resource + resource: + name: cpu + targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + {{- end }} + {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} + - type: Resource + resource: + name: memory + targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + {{- end }} +{{- end }} diff --git a/helm/api-platform/values.yaml b/helm/api-platform/values.yaml index 3eb755f4..18b885bb 100644 --- a/helm/api-platform/values.yaml +++ b/helm/api-platform/values.yaml @@ -30,17 +30,17 @@ pwa: pullPolicy: IfNotPresent # Overrides the image tag whose default is the chart appVersion. tag: "" - resources: + resources: requests: memory: 1400Mi cpu: 500m limits: - memory: 1400Mi + memory: 1400Mi podAnnotations: instrumentation.opentelemetry.io/inject-nodejs: "true" -next: +next: rootUrl: ChangeMe publicEventBriteId: ChangeMe publicMapboxKey: ChangeMe @@ -51,7 +51,7 @@ github: bucket: s3Upstream: ChangeMe s3Name: ChangeMe - + caddy: image: repository: "chart-example.local/api-platform/caddy" @@ -146,10 +146,10 @@ ingress: replicaCount: 1 autoscaling: - enabled: false + enabled: true minReplicas: 1 maxReplicas: 100 - targetCPUUtilizationPercentage: 80 + targetCPUUtilizationPercentage: 50 # targetMemoryUtilizationPercentage: 80 nodeSelector: {}