Skip to content

Commit d79fcb7

Browse files
authored
Merge branch 'dev' into pull-request
2 parents 4a5877f + 2c61afb commit d79fcb7

11 files changed

Lines changed: 309 additions & 45 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Official [Helm chart](https://helm.sh/docs/) to deploy [BunkerWeb](https://www.b
1919
- Kubernetes 1.19+
2020
- Helm 3.8+
2121
- PV provisioner support in the underlying infrastructure (for persistence)
22+
- Kubernetes Gateway API CRDs installed (required for Gateway API support, see the [Gateway API install guide](https://gateway-api.sigs.k8s.io/guides/getting-started/#installing-gateway-api))
2223

2324
**Important**: Please first refer to the [BunkerWeb documentation](https://docs.bunkerweb.io/latest/?utm_campaign=self&utm_source=github), particularly the [Kubernetes integration](https://docs.bunkerweb.io/latest/integrations/?utm_campaign=self&utm_source=bunkerwebio#kubernetes) section.
2425

@@ -80,6 +81,8 @@ settings:
8081
8182
### Kubernetes Integration
8283
84+
**Controller selection**: The controller runs as either a `GatewayController` or an `IngressController`, never both. If both are configured, `GatewayController` takes priority.
85+
8386
```yaml
8487
settings:
8588
kubernetes:
@@ -262,4 +265,4 @@ See [`examples/`](examples/) directory for complete configuration examples.
262265

263266
## License
264267

265-
This Helm chart is licensed under the same terms as BunkerWeb itself.
268+
This Helm chart is licensed under the same terms as BunkerWeb itself.

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.12
18+
version: 1.0.13
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
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if .Values.settings.api.httpRoutes.enabled -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: api-{{ include "bunkerweb.fullname" . }}-httproute
6+
namespace: {{ include "bunkerweb.namespace" . }}
7+
labels:
8+
{{- include "bunkerweb.labels" . | nindent 4 }}
9+
annotations:
10+
bunkerweb.io/USE_TEMPLATE: "api"
11+
{{- with .Values.settings.api.httpRoutes.extraAnnotations }}
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
parentRefs:
16+
- name: {{ include "bunkerweb.fullname" . }}-gateway
17+
namespace: {{ include "bunkerweb.namespace" . }}
18+
{{- if .Values.settings.api.httpRoutes.serverName }}
19+
hostnames:
20+
- {{ .Values.settings.api.httpRoutes.serverName | quote }}
21+
{{- end }}
22+
rules:
23+
- matches:
24+
- path:
25+
type: PathPrefix
26+
value: {{ .Values.settings.api.httpRoutes.serverPath | default "/" }}
27+
backendRefs:
28+
- name: api-{{ include "bunkerweb.fullname" . }}
29+
port: 8888
30+
{{- end }}

charts/bunkerweb/templates/clusterrole.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,20 @@ rules:
1313
verbs: ["get", "watch", "list"]
1414
- apiGroups: ["networking.k8s.io"]
1515
resources: ["ingresses/status"]
16-
verbs: ["get", "watch", "list", "patch"]
16+
verbs: ["get", "watch", "list", "patch"]
17+
- apiGroups: ["gateway.networking.k8s.io"]
18+
resources:
19+
- gatewayclasses
20+
- gatewayclasses/status
21+
- gateways
22+
- gateways/status
23+
- httproutes
24+
- httproutes/status
25+
- tlsroutes
26+
- tlsroutes/status
27+
- tcproutes
28+
- tcproutes/status
29+
- udproutes
30+
- udproutes/status
31+
- referencegrants
32+
verbs: ["get", "watch", "list", "patch", "update"]

charts/bunkerweb/templates/controller-deployment.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ spec:
4444
# Mandatory for k8s integration
4545
- name: KUBERNETES_MODE
4646
value: "yes"
47+
- name: KUBERNETES_REVERSE_PROXY_SUFFIX_START
48+
value: "0"
49+
{{- if .Values.gatewayClass.enabled }}
50+
- name: KUBERNETES_GATEWAY_MODE
51+
value: "yes"
52+
{{- end }}
4753
- name: DATABASE_URI
4854
{{- if not (empty .Values.settings.existingSecret) }}
4955
valueFrom:
@@ -61,9 +67,7 @@ spec:
6167
value: "{{ .Values.settings.kubernetes.domainName }}"
6268
- name: KUBERNETES_IGNORE_ANNOTATIONS
6369
value: "{{ .Values.settings.kubernetes.ignoreAnnotations }}"
64-
{{- if .Values.controller.extraEnvs }}
65-
{{- toYaml .Values.controller.extraEnvs | nindent 12 }}
66-
{{- end }}
70+
{{- toYaml .Values.controller.extraEnvs | nindent 12 }}
6771
{{- if .Values.ui.logs.enabled }}
6872
- name: LOG_TYPES
6973
value: "stderr syslog"
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
{{- if and .Values.gatewayClass.enabled (or .Values.settings.ui.httpRoutes.enabled .Values.settings.api.httpRoutes.enabled) -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: Gateway
4+
metadata:
5+
name: {{ include "bunkerweb.fullname" . }}-gateway
6+
namespace: {{ include "bunkerweb.namespace" . }}
7+
labels:
8+
{{- include "bunkerweb.labels" . | nindent 4 }}
9+
{{- if or .Values.settings.ui.httpRoutes.extraAnnotations .Values.settings.api.httpRoutes.extraAnnotations }}
10+
annotations:
11+
{{- with .Values.settings.ui.httpRoutes.extraAnnotations }}
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
{{- with .Values.settings.api.httpRoutes.extraAnnotations }}
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
{{- end }}
18+
spec:
19+
gatewayClassName: {{ .Values.gatewayClass.name }}
20+
listeners:
21+
{{- if .Values.settings.ui.httpRoutes.enabled }}
22+
- name: ui-http
23+
protocol: HTTP
24+
port: 80
25+
{{- if .Values.settings.ui.httpRoutes.serverName }}
26+
hostname: {{ .Values.settings.ui.httpRoutes.serverName | quote }}
27+
{{- end }}
28+
allowedRoutes:
29+
namespaces:
30+
from: Same
31+
{{- if .Values.settings.ui.httpRoutes.tlsSecretName }}
32+
- name: ui-https
33+
protocol: HTTPS
34+
port: 443
35+
{{- if .Values.settings.ui.httpRoutes.serverName }}
36+
hostname: {{ .Values.settings.ui.httpRoutes.serverName | quote }}
37+
{{- end }}
38+
tls:
39+
mode: Terminate
40+
certificateRefs:
41+
- name: {{ .Values.settings.ui.httpRoutes.tlsSecretName }}
42+
allowedRoutes:
43+
namespaces:
44+
from: Same
45+
{{- end }}
46+
{{- end }}
47+
{{- if .Values.settings.api.httpRoutes.enabled }}
48+
- name: api-http
49+
protocol: HTTP
50+
port: 80
51+
{{- if .Values.settings.api.httpRoutes.serverName }}
52+
hostname: {{ .Values.settings.api.httpRoutes.serverName | quote }}
53+
{{- end }}
54+
allowedRoutes:
55+
namespaces:
56+
from: Same
57+
{{- if .Values.settings.api.httpRoutes.tlsSecretName }}
58+
- name: api-https
59+
protocol: HTTPS
60+
port: 443
61+
{{- if .Values.settings.api.httpRoutes.serverName }}
62+
hostname: {{ .Values.settings.api.httpRoutes.serverName | quote }}
63+
{{- end }}
64+
tls:
65+
mode: Terminate
66+
certificateRefs:
67+
- name: {{ .Values.settings.api.httpRoutes.tlsSecretName }}
68+
allowedRoutes:
69+
namespaces:
70+
from: Same
71+
{{- end }}
72+
{{- end }}
73+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{- if .Values.gatewayClass.enabled -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: GatewayClass
4+
metadata:
5+
name: {{ .Values.gatewayClass.name }}
6+
labels:
7+
{{- include "bunkerweb.labels" . | nindent 4 }}
8+
app.kubernetes.io/component: controller
9+
spec:
10+
controllerName: {{ .Values.gatewayClass.controller }}
11+
{{- end }}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if .Values.settings.ui.httpRoutes.enabled -}}
2+
apiVersion: gateway.networking.k8s.io/v1
3+
kind: HTTPRoute
4+
metadata:
5+
name: ui-{{ include "bunkerweb.fullname" . }}-httproute
6+
namespace: {{ include "bunkerweb.namespace" . }}
7+
labels:
8+
{{- include "bunkerweb.labels" . | nindent 4 }}
9+
annotations:
10+
bunkerweb.io/USE_TEMPLATE: "ui"
11+
{{- with .Values.settings.ui.httpRoutes.extraAnnotations }}
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
parentRefs:
16+
- name: {{ include "bunkerweb.fullname" . }}-gateway
17+
namespace: {{ include "bunkerweb.namespace" . }}
18+
{{- if .Values.settings.ui.httpRoutes.serverName }}
19+
hostnames:
20+
- {{ .Values.settings.ui.httpRoutes.serverName | quote }}
21+
{{- end }}
22+
rules:
23+
- matches:
24+
- path:
25+
type: PathPrefix
26+
value: {{ .Values.settings.ui.httpRoutes.serverPath | default "/" }}
27+
backendRefs:
28+
- name: ui-{{ include "bunkerweb.fullname" . }}
29+
port: 7000
30+
{{- end }}

charts/bunkerweb/values.yaml

Lines changed: 54 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,25 +108,39 @@ settings:
108108
# Enable the setup wizard on first launch
109109
wizard: true
110110

111+
# if using new Gateway API integration instead of ingress resources
112+
# HTTP routes configuration for UI access
113+
httpRoutes:
114+
# Enable HTTP routes for UI access
115+
enabled: false
116+
# GatewayClass name to use
117+
gatewayClassName: ""
118+
# Domain name for UI access
119+
# Example: "bunkerweb-ui.example.com"
120+
serverName: ""
121+
# Path for UI access
122+
serverPath: "/"
123+
# Additional annotations for the httpRoute resource
124+
# Example: {"cert-manager.io/cluster-issuer": "letsencrypt-prod"}
125+
extraAnnotations: {}
126+
# Secret name containing TLS certificate
127+
# Leave empty to disable HTTPS
128+
tlsSecretName: ""
129+
111130
# Ingress configuration for UI access
112131
ingress:
113132
# Set to true to create an Ingress resource for the UI
114133
enabled: false
115-
116134
# IngressClass name to use
117135
ingressClassName: ""
118-
119136
# Domain name for UI access
120137
# Example: "bunkerweb-ui.example.com"
121138
serverName: ""
122-
123139
# Path for UI access (usually "/")
124140
serverPath: "/"
125-
126141
# Additional annotations for the Ingress resource
127142
# Example: {"cert-manager.io/cluster-issuer": "letsencrypt-prod"}
128143
extraAnnotations: {}
129-
130144
# Secret name containing TLS certificate
131145
# Leave empty to disable HTTPS
132146
tlsSecretName: ""
@@ -198,25 +212,39 @@ settings:
198212
# https://limits.readthedocs.io/en/stable/quickstart.html#rate-limit-string-notation
199213
defaults: ["100/minute"]
200214

215+
# if using new Gateway API integration instead of ingress resources
216+
# HTTP routes configuration for API access
217+
httpRoutes:
218+
# Enable HTTP routes for API access
219+
enabled: false
220+
# GatewayClass name to use
221+
gatewayClassName: ""
222+
# Domain name for API access
223+
# Example: "bunkerweb-api.example.com"
224+
serverName: ""
225+
# Path for API access
226+
serverPath: "/admin"
227+
# Additional annotations for the Ingress resource
228+
# Example: {"cert-manager.io/cluster-issuer": "letsencrypt-prod"}
229+
extraAnnotations: {}
230+
# Secret name containing TLS certificate
231+
# Leave empty to disable HTTPS
232+
tlsSecretName: ""
233+
201234
# Ingress configuration for API access
202235
ingress:
203236
# Set to true to create an Ingress resource for the API
204237
enabled: false
205-
206238
# IngressClass name to use
207239
ingressClassName: ""
208-
209240
# Domain name for API access
210241
# Example: "bunkerweb-api.example.com"
211242
serverName: ""
212-
213243
# Path for API access (usually "/")
214244
serverPath: "/"
215-
216245
# Additional annotations for the Ingress resource
217246
# Example: {"cert-manager.io/cluster-issuer": "letsencrypt-prod"}
218247
extraAnnotations: {}
219-
220248
# Secret name containing TLS certificate
221249
# Leave empty to disable HTTPS
222250
tlsSecretName: ""
@@ -1334,6 +1362,22 @@ redis:
13341362
# cpu: "500m"
13351363
# memory: "1024Mi"
13361364

1365+
# =============================================================================
1366+
# GATEWAY CLASS
1367+
# =============================================================================
1368+
# Kubernetes GatewayClass resource for BunkerWeb
1369+
1370+
gatewayClass:
1371+
# Create GatewayClass resource
1372+
# Requires Kubernetes Gateway API CRDs to be installed in the cluster: https://gateway-api.sigs.k8s.io/guides/getting-started/#installing-gateway-api
1373+
enabled: false
1374+
1375+
# GatewayClass name (used in gateway resources)
1376+
name: "bunkerweb"
1377+
1378+
# Controller identifier for this GatewayClass
1379+
controller: "bunkerweb.io/gateway-controller"
1380+
13371381
# =============================================================================
13381382
# INGRESS CLASS
13391383
# =============================================================================

0 commit comments

Comments
 (0)