Skip to content

[FEATURE] Expose gateway mutual TLS settings in the CRD #314

Description

@inference-gateway-maintainer

Summary

The gateway now supports mutual TLS in both directions through four environment variables: SERVER_TLS_CLIENT_CA_PATH (requires and verifies client certificates, on top of SERVER_TLS_CERT_PATH / SERVER_TLS_KEY_PATH) and CLIENT_TLS_CA_PATH / CLIENT_TLS_CERT_PATH / CLIENT_TLS_KEY_PATH for calls out to providers. The operator exposes spec.server.tls for plain server TLS only, so an operator-managed gateway cannot turn on inbound mTLS or present a client certificate to a provider declaratively - it needs a raw env override today.

Documented in inference-gateway/docs: the configuration reference now has a "Mutual TLS" section and the new variables in the Server and Client settings tables.

Acceptance Criteria

  • spec.server.tls gains a client CA bundle field, mounted into the pod and surfaced as SERVER_TLS_CLIENT_CA_PATH
  • A way to configure the outbound client certificate, key and extra CA bundle (CLIENT_TLS_*) for provider calls
  • Validation rejects a client CA without server certificate and key, and a client certificate without its key, matching the gateway's startup errors
  • Helm values and the operator CRD reference docs cover the new fields

Activity

  1. edenreich commented on Nov 1, 2026

    @edenreich
    Contributor

    @claude can you work on this? use /ponytail:ponytail

  2. moved this from Todo to No status in 2026on Nov 1, 2026
  3. added theissue type on Nov 1, 2026
  4. moved this to Todo in 2026on Nov 1, 2026
  5. inference-gateway-maintainer commented on Nov 1, 2026

    @inference-gateway-maintainer
    ContributorAuthor

    Claude finished @edenreich's task in 6m 44s —— View job • feat/issue-314-20261101-1328


    Done - PR #315

    What I found

    Most of this issue was already shipped. #313 mounts clientCARef and emits SERVER_TLS_CLIENT_CA_PATH (internal/controller/gateway_controller.go:800), mounts spec.client.tls and emits the three CLIENT_TLS_* vars (clientTLSEnv, line 553), and even switches the probes to tcpSocket under inbound mTLS. The API types in api/v1alpha1/gateway_types.go:386-432 are complete too.

    So the only real gap was criterion 3. I added two CEL rules rather than Go code, matching the existing pattern in orchestrator_types.go, so the API server rejects bad specs at admission instead of the gateway crash-looping:

    • spec.server.tls.clientCARef now requires enabled: true. Without it the controller emits no SERVER_TLS_* env vars at all, so inbound mTLS was silently ignored - the operator-side equivalent of the gateway's "client CA without server cert and key" startup error.
    • spec.client.tls requires certificateRef and keyRef together, in both directions. An outbound caRef on its own stays valid, since trusting a private CA does not need a client certificate.

    On the Helm criterion

    There is no Chart.yaml in any inference-gateway repo (gh search code --owner inference-gateway --filename Chart.yaml returns nothing). The operator installs via kustomize, and these are Gateway CR spec fields rather than operator deployment settings, so there is nothing to surface in values today. Called out in the PR body instead of inventing a chart.

    Create a PR - already open as #315.

    I did not write a new README section (this repo has never documented the gateway's server TLS fields, so there was no section to extend - the CRD reference in docs is the right home) and did not run task test:e2e, which needs a k3d cluster. Risk to know: the enabled CEL check is written defensively as has(self.enabled) && self.enabled, so if the +kubebuilder:default=false marker is ever dropped the rule still behaves, but an existing Gateway that already has clientCARef with enabled unset will now fail its next update until the field is fixed.
    | Branch

  6. moved this from Todo to In progress in 2026on Nov 1, 2026
  7. moved this from In progress to QA in 2026on Nov 1, 2026
  8. inference-gateway-releaser commented on Nov 1, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.31.0 🎉

    The release is available on GitHub release

    Your semantic-release bot 📦🚀

  9. moved this from QA to Done in 2026on Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementreleased

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions