Skip to content

Commit

Permalink
add/enable hpa (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfcoz authored Sep 9, 2024
1 parent 296637d commit ae9a9aa
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
2 changes: 1 addition & 1 deletion helm/api-platform/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: {{ include "api-platform.fullname" . }}
Expand Down
28 changes: 28 additions & 0 deletions helm/api-platform/templates/pwa-hpa.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
12 changes: 6 additions & 6 deletions helm/api-platform/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -51,7 +51,7 @@ github:
bucket:
s3Upstream: ChangeMe
s3Name: ChangeMe

caddy:
image:
repository: "chart-example.local/api-platform/caddy"
Expand Down Expand Up @@ -146,10 +146,10 @@ ingress:
replicaCount: 1

autoscaling:
enabled: false
enabled: true
minReplicas: 1
maxReplicas: 100
targetCPUUtilizationPercentage: 80
targetCPUUtilizationPercentage: 50
# targetMemoryUtilizationPercentage: 80

nodeSelector: {}
Expand Down

0 comments on commit ae9a9aa

Please sign in to comment.