Skip to content

Commit 26918d4

Browse files
committed
add hpa
1 parent 66c3b2f commit 26918d4

2 files changed

Lines changed: 37 additions & 34 deletions

File tree

charts/bunkerweb/templates/bunkerweb-hpa.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ spec:
88
scaleTargetRef:
99
apiVersion: apps/v1
1010
kind: {{ .Values.bunkerweb.hpa.targetKind | default "Deployment" }}
11+
{{- if and .Values.bunkerweb.hpa.nameOverride (ne .Values.bunkerweb.hpa.nameOverride "") }}
12+
name: {{ .Values.bunkerweb.hpa.nameOverride }}
13+
{{- else }}
1114
name: {{ include "bunkerweb.fullname" . }}
15+
{{- end }}
1216
{{- if ne .Values.bunkerweb.hpa.targetKind "DaemonSet" }}
1317
minReplicas: {{ .Values.bunkerweb.hpa.minReplicas | default 2 }}
1418
maxReplicas: {{ .Values.bunkerweb.hpa.maxReplicas | default 10 }}

charts/bunkerweb/values.yaml

Lines changed: 33 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -186,16 +186,44 @@ bunkerweb:
186186
# Minimum 2 for high availability and PodDisruptionBudget
187187
replicas: 1
188188

189-
# Internal service for communication between components (scheduler, controller)
190-
service:
191-
# Use headless service (only for StatefulSet kind), don't forget to edit scheduler extraEnvs BUNKERWEB_INSTANCES
192-
headless: false
193-
194189
# Container image configuration
195190
repository: bunkerity/bunkerweb
196191
tag: 1.6.5
197192
pullPolicy: Always
198193

194+
# Resource requests and limits
195+
# RECOMMENDED: Uncomment and adjust for production
196+
# resources:
197+
# requests:
198+
# cpu: "2000m"
199+
# memory: "4096Mi"
200+
# limits:
201+
# cpu: "4000m"
202+
# memory: "8192Mi"
203+
204+
# Horizontal Pod Autoscaler (HPA) configuration
205+
# Make sure to set resources.requests for CPU and/or memory
206+
hpa:
207+
# Enable HPA for bunkerweb component
208+
enabled: false
209+
# Target kind for scaling (Deployment or StatefulSet)
210+
targetKind: "Deployment"
211+
# Optional name override for the target resource
212+
# If empty, uses the default release fullname
213+
nameOverride: ""
214+
# Minimum number of replicas (ignored for DaemonSet)
215+
minReplicas: 2
216+
# Maximum number of replicas
217+
maxReplicas: 10
218+
# CPU-based scaling configuration
219+
cpu:
220+
enabled: true
221+
targetAverageUtilization: 60
222+
# Memory-based scaling configuration
223+
memory:
224+
enabled: false
225+
targetAverageUtilization: 70
226+
199227
# Image pull secrets (overrides global setting)
200228
imagePullSecrets: []
201229

@@ -213,16 +241,6 @@ bunkerweb:
213241
# hard: Never schedules pods on same node
214242
podAntiAffinityPreset: "soft"
215243

216-
# Resource requests and limits
217-
# RECOMMENDED: Uncomment and adjust for production
218-
# resources:
219-
# requests:
220-
# cpu: "2000m"
221-
# memory: "4096Mi"
222-
# limits:
223-
# cpu: "4000m"
224-
# memory: "8192Mi"
225-
226244
# Additional pod annotations
227245
podAnnotations: {}
228246

@@ -263,22 +281,6 @@ bunkerweb:
263281
timeoutSeconds: 1
264282
failureThreshold: 3
265283

266-
# Horizontal Pod Autoscaler configuration
267-
# Automatically scales the number of pods based on CPU/memory usage
268-
# If targetKind is StatefulSet, make sure to set bunkerweb.service.headless to true and adjust scheduler extraEnvs BUNKERWEB_INSTANCES
269-
hpa:
270-
enabled: false
271-
targetKind: Deployment # Deployment or StatefulSet only
272-
minReplicas: 2
273-
maxReplicas: 10
274-
cpu:
275-
enabled: true
276-
targetAverageUtilization: 60
277-
memory:
278-
enabled: true
279-
targetAverageUtilization: 70
280-
281-
282284
# Custom volumes configuration
283285
# Allows mounting additional volumes to the BunkerWeb container
284286
volumes: []
@@ -804,9 +806,6 @@ scheduler:
804806
# Additional environment variables for advanced configuration
805807
# These will be merged with the feature configuration above
806808
extraEnvs: []
807-
# Example when using a headless service and StatefulSet:
808-
#- name: BUNKERWEB_INSTANCES
809-
# value: "bunkerweb-internal.bunkerweb.svc.cluster.local"
810809

811810
# Liveness probe configuration
812811
livenessProbe:

0 commit comments

Comments
 (0)