Skip to content

Commit 63ffc90

Browse files
feat: add nginx-no-snippets preset for OnlyOffice only (opencloud-eu#123)
- Add nginx-no-snippets support directly to OnlyOffice ingress template - No complex helper functions or changes to other ingresses - Minimal, focused solution for environments that forbid snippets - Document the new preset in values.yaml and README This is a simpler alternative to PR opencloud-eu#112 that adds the functionality only where it's needed (OnlyOffice) without over-engineering. Fixes opencloud-eu#105
1 parent 6b630be commit 63ffc90

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

charts/opencloud/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,38 @@ This ensures the `X-Forwarded-Proto: https` header is added as required by OnlyO
434434
| `collaboration.enabled` | Enable collaboration service | `true` |
435435
| `collaboration.resources` | CPU/Memory resource requests/limits | `{}` |
436436
437+
## Ingress Configuration
438+
439+
This chart supports standard Kubernetes Ingress resources for exposing services. For environments requiring specific ingress controller features, annotation presets are available.
440+
441+
### Ingress Settings
442+
443+
| Parameter | Description | Default |
444+
| --------- | ----------- | ------- |
445+
| `ingress.enabled` | Enable Ingress resources | `false` |
446+
| `ingress.ingressClassName` | Ingress class name (e.g., nginx, traefik) | `""` |
447+
| `ingress.annotationsPreset` | Preset for ingress controller annotations | `""` |
448+
| `ingress.annotations` | Custom annotations for all ingress resources | `{}` |
449+
450+
### Annotation Presets
451+
452+
The `annotationsPreset` parameter helps configure ingress controller-specific features, particularly for OnlyOffice which requires the X-Forwarded-Proto header:
453+
454+
- `nginx` - Uses configuration snippets to inject headers
455+
- `nginx-no-snippets` - For environments where snippets are forbidden (e.g., Rackspace)
456+
- `traefik` - Creates required Middleware resources
457+
- `haproxy` - Uses HAProxy-specific header injection
458+
- `contour` - Uses Contour request headers
459+
- `istio` - Uses Istio EnvoyFilter
460+
461+
Example for Rackspace or security-restricted environments:
462+
```yaml
463+
ingress:
464+
enabled: true
465+
ingressClassName: nginx
466+
annotationsPreset: nginx-no-snippets
467+
```
468+
437469
## Gateway API Configuration
438470
439471
This chart includes HTTPRoute resources that can be used to expose the OpenCloud, Keycloak, and MinIO services externally. The HTTPRoutes are configured to route traffic to the respective services.

charts/opencloud/templates/onlyoffice/ingress.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
{{- else if eq .Values.ingress.annotationsPreset "nginx" }}
1010
# NGINX: inject custom header via configuration-snippet
1111
{{- $_ := set $annotations "nginx.ingress.kubernetes.io/configuration-snippet" "more_set_headers \"X-Forwarded-Proto: https\";" }}
12+
{{- else if eq .Values.ingress.annotationsPreset "nginx-no-snippets" }}
13+
# NGINX without snippets: use built-in forwarded headers support
14+
{{- $_ := set $annotations "nginx.ingress.kubernetes.io/use-forwarded-headers" "true" }}
15+
{{- $_ := set $annotations "nginx.ingress.kubernetes.io/forwarded-for-header" "X-Forwarded-For" }}
1216
{{- else if eq .Values.ingress.annotationsPreset "haproxy" }}
1317
# HAProxy: inject custom header via request-set-headers
1418
{{- $_ := set $annotations "haproxy.ingress.kubernetes.io/request-set-headers" "X-Forwarded-Proto https" }}

charts/opencloud/values.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,11 @@ ingress:
712712
# Some components (e.g., OnlyOffice) require the X-Forwarded-Proto header to be set.
713713
#
714714
# Set 'annotationsPreset' to inject known ingress-controller-specific annotations
715-
# for injecting the header. Supported values: nginx, traefik, haproxy, contour, istio
715+
# for injecting the header. Supported values: nginx, nginx-no-snippets, traefik, haproxy, contour, istio
716+
#
717+
# Use 'nginx-no-snippets' for environments where NGINX configuration snippets are forbidden
718+
# (e.g., Rackspace, security-restricted clusters). This preset uses built-in NGINX features
719+
# instead of custom configuration snippets.
716720
#
717721
# If set to "traefik" and OnlyOffice is enabled, the chart will create a Middleware
718722
# named 'add-x-forwarded-proto-https' for use in both Ingress and Gateway HTTPRoute.

0 commit comments

Comments
 (0)