Repository navigation
feat(gateway): express mutual TLS in both directions - #313
Merged
Merged
Conversation
Adds spec.server.tls.clientCARef (inbound client certificate
verification) and spec.client.tls with caRef/certificateRef/keyRef
(outbound provider mTLS). Each reference is mounted read-only and the
matching SERVER_TLS_CLIENT_CA_PATH / CLIENT_TLS_{CA,CERT,KEY}_PATH is
emitted. Health probes drop to tcpSocket when a client CA is set, since
the kubelet has no client certificate for the handshake.
Closes #311
Co-authored-by: Eden Reich <[email protected]>
inference-gateway-maintainer
Bot
requested a review
from a team
as a code owner
November 1, 2026 13:12
This was referenced Nov 1, 2026
Closed
This was referenced Nov 1, 2026
inference-gateway-releaser Bot
added a commit
that referenced
this pull request
Nov 1, 2026
## [0.31.0](v0.30.0...v0.31.0) (2026-11-01) ### ✨ Features * **gateway:** express mutual TLS in both directions ([#313](#313)) ([3cd4b24](3cd4b24)), closes [#311](#311) * **gateway:** validate mutual TLS field combinations ([#315](#315)) ([d43a7ea](d43a7ea)) ### 🐛 Bug Fixes * **gateway:** probe over HTTPS when spec.server.tls is on ([#312](#312)) ([2e3400c](2e3400c))
Contributor
|
🎉 This PR is included in version 0.31.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A
GatewayCR can now express mutual TLS in both directions, so the mTLS example in inference-gateway/inference-gateway#818 no longer needs a hand-writtenDeployment.Inbound -
spec.server.tls.clientCARef(aSecretKeySelector, like the existingcertificateRef/keyRef) is mounted at/app/tls/client-ca/<key>and setsSERVER_TLS_CLIENT_CA_PATH. cert-manager writesca.crtinto the same Secret as the server keypair, so in practice this is one more key off one Secret.Outbound - new
spec.client.tlswithcaRef,certificateRefandkeyRef, mounted under/app/tls/client/{ca,cert,key}/<key>and emitted asCLIENT_TLS_CA_PATH/CLIENT_TLS_CERT_PATH/CLIENT_TLS_KEY_PATH. Each reference is independent, so a private provider CA works without a client certificate and vice versa.spec.clientis its own block (notspec.providers.tls, which is a list) and leaves room forCLIENT_TLS_MIN_VERSIONlater.Probes (point 3 of the issue) - when
clientCARefis set the liveness and readiness probes switch totcpSocketon the server port. The kubelet cannot present a client certificate, so anhttpGetprobe fails the handshake whatever the scheme. This builds on #312, which pickedscheme: HTTPSfor plain server TLS - that path is unchanged.Changes
api/v1alpha1/gateway_types.go:TLSConfig.ClientCARef, newClientSpec/ClientTLSConfig,GatewaySpec.Client.internal/controller/gateway_controller.go:secretKeyVolumesfactored out oftlsVolumesand reused for the client block,serverMTLSEnabled, the TCP probe fallback, and the four env vars.manifests/.spec.client.tlsmounts + env, and noCLIENT_TLS_leakage when unset.task test,task lint,task vetall pass.Not in this PR
examples/kubernetes/mtls) and moving it over to aGatewayCR belongs there.spec.client.tls(cert without key). The gateway already errors on that at startup.Downstream
New CRD fields reach
inference-gateway/docs(Gateway CRD reference) and the gateway repo's mTLS example. Docs ticket filed, see below.Closes #311
Generated with Claude Code