update
This commit is contained in:
40
pocketbase/templates/hpa.yaml
Normal file
40
pocketbase/templates/hpa.yaml
Normal file
@@ -0,0 +1,40 @@
|
||||
{{- /*
|
||||
Generate HPA for each PocketBase instance
|
||||
*/ -}}
|
||||
{{- if .Values.autoscaling.enabled }}
|
||||
{{- range .Values.instances }}
|
||||
---
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: pocketbase-{{ .id }}
|
||||
labels:
|
||||
app: pocketbase
|
||||
instance: {{ .id }}
|
||||
{{- include "pocketbase.labels" $ | nindent 4 }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
name: pocketbase-{{ .id }}
|
||||
minReplicas: {{ .replicaCount | default 1 }}
|
||||
maxReplicas: {{ $.Values.autoscaling.maxReplicas }}
|
||||
metrics:
|
||||
{{- if $.Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ $.Values.autoscaling.targetCPUUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- if $.Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ $.Values.autoscaling.targetMemoryUtilizationPercentage }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user