Skip to content

Commit b356cac

Browse files
authored
Merge pull request #40 from bunkerity/dev
Dev
2 parents e5a3ae6 + 10cc8c8 commit b356cac

File tree

5 files changed

+105
-24
lines changed

5 files changed

+105
-24
lines changed

charts/bunkerweb/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 1.0.6
18+
version: 1.0.7
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/bunkerweb/templates/bunkerweb-hpa.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,41 @@ spec:
3434
type: Utilization
3535
averageUtilization: {{ .Values.bunkerweb.hpa.memory.targetAverageUtilization | default 70 }}
3636
{{- end }}
37+
{{- if .Values.bunkerweb.hpa.behavior }}
38+
behavior:
39+
{{- if .Values.bunkerweb.hpa.behavior.scaleUp }}
40+
scaleUp:
41+
{{- if .Values.bunkerweb.hpa.behavior.scaleUp.stabilizationWindowSeconds }}
42+
stabilizationWindowSeconds: {{ .Values.bunkerweb.hpa.behavior.scaleUp.stabilizationWindowSeconds }}
43+
{{- end }}
44+
{{- if .Values.bunkerweb.hpa.behavior.scaleUp.policies }}
45+
policies:
46+
{{- range .Values.bunkerweb.hpa.behavior.scaleUp.policies }}
47+
- type: {{ .type }}
48+
value: {{ .value }}
49+
periodSeconds: {{ .periodSeconds }}
50+
{{- end }}
51+
{{- end }}
52+
{{- if .Values.bunkerweb.hpa.behavior.scaleUp.selectPolicy }}
53+
selectPolicy: {{ .Values.bunkerweb.hpa.behavior.scaleUp.selectPolicy }}
54+
{{- end }}
55+
{{- end }}
56+
{{- if .Values.bunkerweb.hpa.behavior.scaleDown }}
57+
scaleDown:
58+
{{- if .Values.bunkerweb.hpa.behavior.scaleDown.stabilizationWindowSeconds }}
59+
stabilizationWindowSeconds: {{ .Values.bunkerweb.hpa.behavior.scaleDown.stabilizationWindowSeconds }}
60+
{{- end }}
61+
{{- if .Values.bunkerweb.hpa.behavior.scaleDown.policies }}
62+
policies:
63+
{{- range .Values.bunkerweb.hpa.behavior.scaleDown.policies }}
64+
- type: {{ .type }}
65+
value: {{ .value }}
66+
periodSeconds: {{ .periodSeconds }}
67+
{{- end }}
68+
{{- end }}
69+
{{- if .Values.bunkerweb.hpa.behavior.scaleDown.selectPolicy }}
70+
selectPolicy: {{ .Values.bunkerweb.hpa.behavior.scaleDown.selectPolicy }}
71+
{{- end }}
72+
{{- end }}
73+
{{- end }}
3774
{{- end }}

charts/bunkerweb/templates/controller-deployment.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ spec:
5858
value: "{{ .Values.settings.kubernetes.ingressClass }}"
5959
- name: KUBERNETES_DOMAIN_NAME
6060
value: "{{ .Values.settings.kubernetes.domainName }}"
61+
- name: KUBERNETES_IGNORE_ANNOTATIONS
62+
value: "{{ .Values.settings.kubernetes.ignoreAnnotations }}"
63+
{{- if .Values.controller.extraEnvs }}
64+
{{- toYaml .Values.controller.extraEnvs | nindent 12 }}
65+
{{- end }}
6166
{{- if .Values.controller.nodeSelector }}
6267
{{- with .Values.controller.nodeSelector }}
6368
nodeSelector:

charts/bunkerweb/values.yaml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ settings:
6969
# Kubernetes cluster domain name for service discovery
7070
domainName: "cluster.local"
7171

72+
# Annotations to be ignored by bunkerweb-controller when multiple ingress controllers (comma-separated)
73+
ignoreAnnotations: ""
74+
7275
# ----- GENERAL CONFIGURATION -----
7376
misc:
7477
# Database connection URI (auto-generated if using internal MariaDB)
@@ -218,11 +221,42 @@ bunkerweb:
218221
# CPU-based scaling configuration
219222
cpu:
220223
enabled: true
221-
targetAverageUtilization: 60
224+
targetAverageUtilization: 90
222225
# Memory-based scaling configuration
223226
memory:
224227
enabled: false
225-
targetAverageUtilization: 70
228+
targetAverageUtilization: 90
229+
# HPA behavior configuration
230+
# Controls the scaling speed and stabilization
231+
behavior:
232+
scaleUp:
233+
# Stabilization before scale up: waits for constant threshold crossing
234+
stabilizationWindowSeconds: 60
235+
policies:
236+
# Policy 1: Max +100% of current replicas per minute
237+
- type: Percent
238+
value: 100
239+
periodSeconds: 60
240+
# Policy 2: Max +2 pods per minute
241+
- type: Pods
242+
value: 2
243+
periodSeconds: 60
244+
# Takes the MOST CONSERVATIVE of the 2 policies
245+
selectPolicy: Min
246+
scaleDown:
247+
# Stabilization before scale down: waits for under-utilization
248+
stabilizationWindowSeconds: 300
249+
policies:
250+
# Policy 1: Max -50% of current replicas per minute
251+
- type: Percent
252+
value: 50
253+
periodSeconds: 60
254+
# Policy 2: Max -1 pod per minute
255+
- type: Pods
256+
value: 1
257+
periodSeconds: 60
258+
# Takes the MOST CONSERVATIVE of the 2 policies
259+
selectPolicy: Min
226260

227261
# Internal service configuration (for inter-pod communication)
228262
service:

docs/values.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,31 +50,33 @@ Main reverse proxy and WAF component
5050
| `bunkerweb.enableInstance` | Pod annotations for Kubernetes integration (required) This enables BunkerWeb to be managed by the co... | `bool` | `true` |
5151
| `bunkerweb.extraEnvs` | Additional environment variables | `list` | `[]` |
5252
| `bunkerweb.hostPorts` | Use host ports for direct traffic (only for DaemonSet) Allows binding to ports 80/443 on each node | `bool` | `true` |
53-
| `bunkerweb.hpa` | Horizontal Pod Autoscaler configuration Automatically scales the number of pods based on CPU/memory ... | `object` | See nested values |
53+
| `bunkerweb.hpa` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | See nested values |
5454
| `bunkerweb.imagePullSecrets` | Image pull secrets (overrides global setting) | `list` | `[]` |
5555
| `bunkerweb.kind` | Deployment type: "DaemonSet" or "Deployment" or "StatefulSet" DaemonSet: Runs one pod per node (reco... | `string` | `"Deployment"` |
5656
| `bunkerweb.livenessProbe` | Liveness probe configuration | `object` | See nested values |
5757
| `bunkerweb.nodeSelector` | Node selector (overrides global setting) | `object` | `{}` |
5858
| `bunkerweb.pdb` | volumeMounts: - name: shared-data mountPath: /var/lib/bunkerweb/shared # PodDisruptionBudget for def... | `object` | See nested values |
59-
| `bunkerweb.podAnnotations` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | `{}` |
59+
| `bunkerweb.podAnnotations` | Additional pod annotations | `object` | `{}` |
6060
| `bunkerweb.podAntiAffinityPreset` | Anti-affinity preset: "soft" or "hard" soft: Prefers not to schedule pods on same node hard: Never s... | `string` | `"soft"` |
6161
| `bunkerweb.podLabels` | Additional pod labels | `object` | `{}` |
6262
| `bunkerweb.pullPolicy` | Configuration for pullPolicy | `string` | `"Always"` |
6363
| `bunkerweb.readinessProbe` | Readiness probe configuration | `object` | See nested values |
6464
| `bunkerweb.replicas` | Number of replicas (for Deployment & StatefulSet kind) Minimum 2 for high availability and PodDisrup... | `int` | `1` |
6565
| `bunkerweb.repository` | Container image configuration | `string` | `"bunkerity/bunkerweb"` |
6666
| `bunkerweb.securityContext` | Security context for BunkerWeb container | `object` | See nested values |
67-
| `bunkerweb.service` | Internal service for communication between components (scheduler, controller) | `object` | See nested values |
67+
| `bunkerweb.service` | Internal service configuration (for inter-pod communication) | `object` | See nested values |
6868
| `bunkerweb.tag` | Configuration for tag | `string` | `"1.6.5"` |
6969
| `bunkerweb.tolerations` | Tolerations (overrides global setting) | `list` | `[]` |
7070
| `bunkerweb.volumeMounts` | volumes: - name: shared-data persistentVolumeClaim: claimName: shared-pvc Custom volume mounts confi... | `list` | `[]` |
7171
| `bunkerweb.volumes` | Custom volumes configuration Allows mounting additional volumes to the BunkerWeb container | `list` | `[]` |
72-
| `bunkerweb.hpa.cpu` | Configuration for cpu | `object` | See nested values |
73-
| `bunkerweb.hpa.enabled` | Configuration for enabled | `bool` | `false` |
74-
| `bunkerweb.hpa.maxReplicas` | Configuration for maxReplicas | `int` | `10` |
75-
| `bunkerweb.hpa.memory` | Configuration for memory | `object` | See nested values |
76-
| `bunkerweb.hpa.minReplicas` | Configuration for minReplicas | `int` | `2` |
77-
| `bunkerweb.hpa.targetKind` | Configuration for targetKind | `string` | `"Deployment"` |
72+
| `bunkerweb.hpa.behavior` | HPA behavior configuration Controls the scaling speed and stabilization | `object` | See nested values |
73+
| `bunkerweb.hpa.cpu` | CPU-based scaling configuration | `object` | See nested values |
74+
| `bunkerweb.hpa.enabled` | Enable HPA for bunkerweb component | `bool` | `false` |
75+
| `bunkerweb.hpa.maxReplicas` | Maximum number of replicas | `int` | `10` |
76+
| `bunkerweb.hpa.memory` | Memory-based scaling configuration | `object` | See nested values |
77+
| `bunkerweb.hpa.minReplicas` | Minimum number of replicas (ignored for DaemonSet) | `int` | `2` |
78+
| `bunkerweb.hpa.nameOverride` | Optional name override for the target resource If empty, uses the default release fullname | `string` | `""` |
79+
| `bunkerweb.hpa.targetKind` | Target kind for scaling (Deployment or StatefulSet) | `string` | `"Deployment"` |
7880
| `bunkerweb.livenessProbe.exec` | Configuration for exec | `object` | See nested values |
7981
| `bunkerweb.livenessProbe.failureThreshold` | Configuration for failureThreshold | `int` | `3` |
8082
| `bunkerweb.livenessProbe.initialDelaySeconds` | Configuration for initialDelaySeconds | `int` | `30` |
@@ -92,10 +94,12 @@ Main reverse proxy and WAF component
9294
| `bunkerweb.securityContext.capabilities` | Configuration for capabilities | `object` | See nested values |
9395
| `bunkerweb.securityContext.runAsGroup` | Configuration for runAsGroup | `int` | `101` |
9496
| `bunkerweb.securityContext.runAsUser` | Configuration for runAsUser | `int` | `101` |
95-
| `bunkerweb.service.headless` | Use headless service (only for StatefulSet kind), don't forget to edit scheduler extraEnvs BUNKERWEB... | `bool` | `false` |
97+
| `bunkerweb.service.headless` | Use headless service (clusterIP: None) for service discovery If false, creates a ClusterIP service w... | `bool` | `true` |
98+
| `bunkerweb.hpa.behavior.scaleDown` | Configuration for scaleDown | `object` | See nested values |
99+
| `bunkerweb.hpa.behavior.scaleUp` | Configuration for scaleUp | `object` | See nested values |
96100
| `bunkerweb.hpa.cpu.enabled` | Set to true to create an Ingress resource for the UI | `bool` | `true` |
97101
| `bunkerweb.hpa.cpu.targetAverageUtilization` | Configuration for targetAverageUtilization | `int` | `60` |
98-
| `bunkerweb.hpa.memory.enabled` | Set to true to create an Ingress resource for the UI | `bool` | `true` |
102+
| `bunkerweb.hpa.memory.enabled` | Set to true to create an Ingress resource for the UI | `bool` | `false` |
99103
| `bunkerweb.hpa.memory.targetAverageUtilization` | Configuration for targetAverageUtilization | `int` | `70` |
100104
| `bunkerweb.livenessProbe.exec.command` | Configuration for command | `list` | `['/usr/share/bunkerweb/helpers/healthcheck.sh']` |
101105
| `bunkerweb.readinessProbe.exec.command` | Configuration for command | `list` | `['/usr/share/bunkerweb/helpers/healthcheck.sh', 'ok']` |
@@ -116,7 +120,7 @@ Web interface for BunkerWeb management and monitoring
116120
| `ui.livenessProbe` | Liveness probe configuration | `object` | See nested values |
117121
| `ui.logs` | Log collection configuration | `object` | See nested values |
118122
| `ui.nodeSelector` | Node selector (overrides global setting) | `object` | `{}` |
119-
| `ui.podAnnotations` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | `{}` |
123+
| `ui.podAnnotations` | Additional pod annotations | `object` | `{}` |
120124
| `ui.podLabels` | Additional pod labels | `object` | `{}` |
121125
| `ui.pullPolicy` | Configuration for pullPolicy | `string` | `"Always"` |
122126
| `ui.readinessProbe` | Readiness probe configuration | `object` | See nested values |
@@ -129,7 +133,7 @@ Web interface for BunkerWeb management and monitoring
129133
| `ui.livenessProbe.initialDelaySeconds` | Configuration for initialDelaySeconds | `int` | `30` |
130134
| `ui.livenessProbe.periodSeconds` | Configuration for periodSeconds | `int` | `5` |
131135
| `ui.livenessProbe.timeoutSeconds` | Configuration for timeoutSeconds | `int` | `1` |
132-
| `ui.logs.enabled` | Configuration for enabled | `bool` | `false` |
136+
| `ui.logs.enabled` | Enable HPA for bunkerweb component | `bool` | `false` |
133137
| `ui.logs.persistence` | Persistent storage for logs | `object` | See nested values |
134138
| `ui.logs.pullPolicy` | Configuration for pullPolicy | `string` | `"Always"` |
135139
| `ui.logs.repository` | Syslog-ng container for log collection | `string` | `"balabit/syslog-ng"` |
@@ -163,7 +167,7 @@ Manages BunkerWeb configuration and coordination
163167
| `scheduler.imagePullSecrets` | Image pull secrets (overrides global setting) | `list` | `[]` |
164168
| `scheduler.livenessProbe` | Liveness probe configuration | `object` | See nested values |
165169
| `scheduler.nodeSelector` | Node selector (overrides global setting) | `object` | `{}` |
166-
| `scheduler.podAnnotations` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | `{}` |
170+
| `scheduler.podAnnotations` | Additional pod annotations | `object` | `{}` |
167171
| `scheduler.podLabels` | Additional pod labels | `object` | `{}` |
168172
| `scheduler.proLicenseKey` | PRO Features configuration BunkerWeb PRO license key for advanced features | `string` | `""` |
169173
| `scheduler.pullPolicy` | Configuration for pullPolicy | `string` | `"Always"` |
@@ -369,7 +373,7 @@ Kubernetes controller for automatic Ingress management
369373
| `controller.imagePullSecrets` | Image pull secrets (overrides global setting) | `list` | `[]` |
370374
| `controller.livenessProbe` | Liveness probe configuration | `object` | See nested values |
371375
| `controller.nodeSelector` | Node selector (overrides global setting) | `object` | `{}` |
372-
| `controller.podAnnotations` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | `{}` |
376+
| `controller.podAnnotations` | Additional pod annotations | `object` | `{}` |
373377
| `controller.podLabels` | Additional pod labels | `object` | `{}` |
374378
| `controller.pullPolicy` | Configuration for pullPolicy | `string` | `"Always"` |
375379
| `controller.readinessProbe` | Readiness probe configuration | `object` | See nested values |
@@ -466,18 +470,18 @@ Dashboards and visualization
466470
| `grafana.extraEnvs` | Additional environment variables | `list` | `[]` |
467471
| `grafana.ingress` | Ingress configuration for external access | `object` | See nested values |
468472
| `grafana.persistence` | Persistent storage configuration | `object` | See nested values |
469-
| `grafana.podAnnotations` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | `{}` |
473+
| `grafana.podAnnotations` | Additional pod annotations | `object` | `{}` |
470474
| `grafana.podLabels` | Additional pod labels | `object` | `{}` |
471475
| `grafana.prometheusDatasource` | Additional annotations for the PVC annotations: {} Prometheus data source configuration Automaticall... | `object` | See nested values |
472476
| `grafana.pullPolicy` | Configuration for pullPolicy | `string` | `"IfNotPresent"` |
473477
| `grafana.replicas` | Number of replicas (for Deployment & StatefulSet kind) Minimum 2 for high availability and PodDisrup... | `int` | `1` |
474478
| `grafana.repository` | Container image configuration | `string` | `"grafana/grafana"` |
475479
| `grafana.securityContext` | Security context for BunkerWeb container | `object` | `{}` |
476-
| `grafana.service` | Internal service for communication between components (scheduler, controller) | `object` | See nested values |
480+
| `grafana.service` | Internal service configuration (for inter-pod communication) | `object` | See nested values |
477481
| `grafana.tag` | Configuration for tag | `string` | `"latest"` |
478-
| `grafana.ingress.enabled` | Configuration for enabled | `bool` | `false` |
482+
| `grafana.ingress.enabled` | Enable HPA for bunkerweb component | `bool` | `false` |
479483
| `grafana.persistence.accessModes` | Access modes for the persistent volume | `list` | `['ReadWriteOnce']` |
480-
| `grafana.persistence.enabled` | Configuration for enabled | `bool` | `false` |
484+
| `grafana.persistence.enabled` | Enable HPA for bunkerweb component | `bool` | `false` |
481485
| `grafana.persistence.size` | Storage size for database | `string` | `"10Gi"` |
482486
| `grafana.persistence.storageClass` | Storage class for database persistence Leave empty for default storage class | `string` | `""` |
483487
| `grafana.prometheusDatasource.access` | Configuration for access | `string` | `"proxy"` |
@@ -499,15 +503,15 @@ Metrics collection and storage
499503
| `prometheus` | Metrics collection and storage | `object` | See nested values |
500504
| `prometheus.enabled` | Enable external service creation | `bool` | `false` |
501505
| `prometheus.persistence` | Persistent storage configuration | `object` | See nested values |
502-
| `prometheus.podAnnotations` | Resource requests and limits RECOMMENDED: Uncomment and adjust for production resources: requests: c... | `object` | `{}` |
506+
| `prometheus.podAnnotations` | Additional pod annotations | `object` | `{}` |
503507
| `prometheus.podLabels` | Additional pod labels | `object` | `{}` |
504508
| `prometheus.pullPolicy` | Configuration for pullPolicy | `string` | `"Always"` |
505509
| `prometheus.replicas` | Number of replicas (for Deployment & StatefulSet kind) Minimum 2 for high availability and PodDisrup... | `int` | `1` |
506510
| `prometheus.repository` | Container image configuration | `string` | `"prom/prometheus"` |
507511
| `prometheus.securityContext` | Security context for BunkerWeb container | `object` | See nested values |
508512
| `prometheus.tag` | Configuration for tag | `string` | `"v3.3.1"` |
509513
| `prometheus.persistence.accessModes` | Access modes for the persistent volume | `list` | `['ReadWriteOnce']` |
510-
| `prometheus.persistence.enabled` | Configuration for enabled | `bool` | `true` |
514+
| `prometheus.persistence.enabled` | Enable HPA for bunkerweb component | `bool` | `true` |
511515
| `prometheus.persistence.size` | Storage size for database | `string` | `"8Gi"` |
512516
| `prometheus.persistence.storageClass` | Storage class for database persistence Leave empty for default storage class | `string` | `""` |
513517
| `prometheus.securityContext.fsGroup` | Configuration for fsGroup | `int` | `65534` |
@@ -572,6 +576,7 @@ Configuration for BunkerWeb behavior in Kubernetes environment
572576
| `settings.redis` | Configuration for redis | `object` | See nested values |
573577
| `settings.ui` | Configuration for ui | `object` | See nested values |
574578
| `settings.kubernetes.domainName` | Kubernetes cluster domain name for service discovery | `string` | `"cluster.local"` |
579+
| `settings.kubernetes.ignoreAnnotations` | Annotations to be ignored by bunkerweb-controller when multiple ingress controllers (comma-separated... | `string` | `""` |
575580
| `settings.kubernetes.ingressClass` | Ingress class name that BunkerWeb will handle Must match the IngressClass resource name | `string` | `""` |
576581
| `settings.kubernetes.namespaces` | Comma-separated list of namespaces to monitor for Ingress resources Empty string means all namespace... | `string` | `""` |
577582
| `settings.misc.apiWhitelistIp` | IP ranges allowed to access BunkerWeb API (space-separated CIDR blocks) Includes common Kubernetes a... | `string` | `"127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16"` |

0 commit comments

Comments
 (0)