Skip to content

feat: add OpenShift / OKD support (Route template + deployment guide) - #344

Open
lokeshrangineni wants to merge 3 commits into
langfuse:mainfrom
lokeshrangineni:feat/openshift-support
Open

feat: add OpenShift / OKD support (Route template + deployment guide)#344
lokeshrangineni wants to merge 3 commits into
langfuse:mainfrom
lokeshrangineni:feat/openshift-support

Conversation

@lokeshrangineni

Copy link
Copy Markdown

Summary

Adds support for deploying Langfuse on OpenShift / OKD clusters, which use Route resources instead of Ingress and enforce pod security via Security Context Constraints (SCCs).

Changes

  • charts/langfuse/templates/route.yaml — new route.openshift.io/v1 Route template, disabled by default (langfuse.route.enabled: false), supports edge, reencrypt, and passthrough TLS termination
  • charts/langfuse/values.yaml — new langfuse.route section (host, TLS options, annotations, labels)
  • charts/langfuse/tests/route_test.yaml — 8 helm-unittest tests; all 69 existing tests still pass
  • examples/openshift/ — step-by-step README, annotated values.yaml, and secret template validated on OCP 4.20
  • TROUBLESHOOTING.md — new section on Bitnami SCC conflict with two remediation paths

Known Limitation — Bitnami sub-charts and OpenShift SCCs

Bitnami images (PostgreSQL, Redis, ClickHouse) run as fixed UID 1001, which conflicts with OpenShift's restricted-v2 SCC. Two options documented:

  • Option A (dev/demo): grant anyuid SCC to the langfuse and default service accounts
  • Option B (production): use an external PostgreSQL (postgresql.deploy: false) via CrunchyData PGO operator — eliminates the Bitnami dependency entirely

This is a limitation of the upstream Bitnami images, not the Langfuse chart itself.

Test plan

  • All 69 existing + 8 new helm-unittest tests pass
  • End-to-end deployment validated on OpenShift 4.20 — all pods Running, Route accessible via HTTPS

Made with Cursor

Adds first-class support for deploying Langfuse on OpenShift and OKD clusters.

Changes
-------
- charts/langfuse/templates/route.yaml
    New template that renders an `route.openshift.io/v1` Route resource when
    `langfuse.route.enabled: true`. Mirrors the existing ingress.yaml pattern
    and supports edge, reencrypt, and passthrough TLS termination modes.

- charts/langfuse/values.yaml
    New `langfuse.route` section with `enabled`, `host`, `annotations`,
    `additionalLabels`, and full TLS options (termination, policy, certs).
    Disabled by default; does not affect existing Kubernetes deployments.

- charts/langfuse/tests/route_test.yaml
    8 helm-unittest test cases covering: disabled (default), auto-generated host,
    explicit host, edge TLS (default), passthrough TLS, TLS disabled,
    custom annotations/labels, and mutual exclusion with ingress.

- examples/openshift/
    Step-by-step deployment guide (README.md), annotated values file
    (values.yaml), and secret template (secret.yaml).

- TROUBLESHOOTING.md
    New section documenting the Bitnami SCC conflict with OpenShift's
    restricted-v2 policy, with two remediation paths (see below).

Known limitation — Bitnami sub-charts and OpenShift SCCs
---------------------------------------------------------
The bundled PostgreSQL and Valkey/Redis sub-charts use Bitnami images that
run as a fixed UID (1001). OpenShift's default restricted-v2 SCC enforces
a namespace-allocated UID range and rejects this fixed UID, causing pods to
fail at startup.

Two options are documented in examples/openshift/ and TROUBLESHOOTING.md:

  Option A (dev/demo clusters only):
    Grant anyuid SCC to the chart service account:
      oc adm policy add-scc-to-user anyuid -z <release-name> -n <namespace>
    This bypasses UID isolation and is NOT recommended for production.

  Option B (recommended for production):
    Disable the bundled PostgreSQL sub-chart (`postgresql.deploy: false`)
    and provision an SCC-compliant PostgreSQL instance — e.g. via the
    CrunchyData PGO operator (available in OperatorHub) or any managed
    service. This removes the Bitnami dependency entirely.

A follow-up contribution to add a CrunchyData PGO example is planned.

Tested on OpenShift 4.20 (ai-dev02.kni.syseng.devcluster.openshift.com).
All 69 existing helm-unittest tests continue to pass; 8 new route tests added.

Made-with: Cursor
…P 4.20

Fixes discovered during actual deployment on OpenShift 4.20:

- secret.yaml: add missing clickhouse-password key (Langfuse v3 requires
  ClickHouse; omitting this key causes helm install to fail with
  "Configuring an existing secret or clickhouse.auth.password is required")

- values.yaml: remove podSecurityContext.runAsNonRoot: true from Langfuse
  web/worker section — the image uses a non-numeric user ("nextjs") which
  causes CreateContainerConfigError on OpenShift; leave podSecurityContext: {}
  and rely on the anyuid SCC grant instead

- values.yaml: add missing clickhouse.auth.existingSecret wiring

- README.md: grant anyuid to both 'langfuse' and 'default' service accounts
  (ClickHouse uses the default SA); add note about non-numeric user issue;
  use alphanumeric-only DB passwords to avoid ClickHouse special-char bug

Made-with: Cursor
@CLAassistant

CLAassistant commented Apr 28, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 28, 2026
@lokeshrangineni

Copy link
Copy Markdown
Author

@deejay1 or @MrOrz or @Steffen911 - Could you help me to review the PR and provide any feedback. I am happy to make any changes if it is needed.

@Steffen911

Copy link
Copy Markdown
Member

@lokeshrangineni As far as I can tell, openshift already supports the Ingress resource (https://docs.redhat.com/en/documentation/openshift_container_platform/4.9/html/networking/configuring-ingress) and translates it to a route internally. What's the added benefit of bringing this PR in aside from additional documentation on openshift?

@lokeshrangineni

Copy link
Copy Markdown
Author

@lokeshrangineni As far as I can tell, openshift already supports the Ingress resource (https://docs.redhat.com/en/documentation/openshift_container_platform/4.9/html/networking/configuring-ingress) and translates it to a route internally. What's the added benefit of bringing this PR in aside from additional documentation on openshift?

Hi @Steffen911, thanks for the review. You're right that OpenShift's Ingress controller auto-translates Ingress into Route objects, so a native Route template alone wouldn't justify this PR.

The main motivation is the SCC (Security Context Constraints) pain point, which is the real blocker for deploying Langfuse on OpenShift today:

  • The bundled Bitnami sub-charts (PostgreSQL, Valkey/Redis, ClickHouse) run as a fixed UID 1001, which OpenShift's default restricted-v2 SCC rejects — pods fail at startup.
  • The Langfuse web/worker image uses a non-numeric user (nextjs), so setting runAsNonRoot: true causes CreateContainerConfigError — this one was particularly tricky to debug.
  • ClickHouse silently fails with passwords containing special characters (%, @, #, etc.).

These issues took real debugging time on OCP 4.20. The TROUBLESHOOTING.md and examples/openshift/ sections document two remediation paths (anyuid SCC for dev, external PostgreSQL via CrunchyData PGO for production) so future OpenShift users don't hit the same walls.

The native Route template is a small addition on top — it's disabled by default with zero impact on existing deployments. Happy to adjust the scope if needed!

Copy link
Copy Markdown
Member

In that case, let's separate the route behaviour from the debugging assistance. I'm happy to merge the additional troubleshooting information, but would like to see upvotes or engagement from the wider community before adding the route into the helm chart.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants