Repository navigation
Restrict network access to Oxia and support TLS between Oxia processes - #727
Merged
Merged
Conversation
- The <release>-pulsar-oxia Service only exposes the public endpoint.
The Pulsar components connect through the headless
<release>-pulsar-oxia-svc Service, which keeps every port, and the
PodMonitors scrape the pods directly.
- New NetworkPolicy (oxia.networkPolicy, enabled by default). The
internal endpoints of the Oxia servers and the coordinator, and the
coordinator's admin endpoint, only accept the Oxia pods of the release.
The public and metrics endpoints stay open. The allowed sources are
configurable with oxia.networkPolicy.{public,metrics,internal}.from.
- tls.oxia (with tls.enabled) now takes effect. cert-manager issues a
certificate for the Oxia servers, which the servers and the coordinator
mount. The servers' internal endpoint, replication and the
coordinator's calls use TLS, optionally mTLS (tls.oxia.clientAuth).
The public endpoint stays plaintext, since the Oxia Java client only
trusts the JVM's default CA certificates. With TLS on, the server
probes use the public endpoint, because "oxia health" only speaks
plaintext.
- CI: an "Oxia TLS" scenario, the Oxia certificate in the SAN mode
checks, and the NetworkPolicy and Oxia mTLS in the all-values render.
lhotari
approved these changes
Oct 13, 2026
lhotari
left a comment
Member
There was a problem hiding this comment.
Thanks for tightening up the Oxia exposure and wiring up tls.oxia; the change is well scoped and the new CI scenario is a nice touch.
I rendered the chart at this head and checked the policy and the TLS wiring against the pod labels, the other templates and Oxia 0.16.11:
- The default NetworkPolicy does not block anything the chart itself needs. The
componentlabels in the selector match the server and coordinator pods, the Pulsar components and init jobs reach Oxia only on the public port through the headless Service, the probes are exec probes, and omittingfromon the public and metrics rules means "allow from anywhere". Server-to-server, coordinator-to-server and the 6651 admin port are limited to the release's Oxia pods. --internal-tls-*,--internal-tls-client-auth,--peer-tls-*and--peer-tls-server-nameall exist in Oxia 0.16.11. The certificate always contains the headless Service name, so the server-name override verifies in every SAN mode (.ci/test-certificate-san-modes.shpasses locally), and Oxia reloads the key pair on each handshake, so cert-manager renewals are picked up without restarts.oxia healthis plaintext only, and the health and readiness services are registered on the public server as well, so moving the probes to the public port when TLS is on works.- The 4.8.0 upgrade section of the README is left untouched.
There is one usability point inline on oxia.networkPolicy.public.from, and two smaller things:
- The default-on policy and the trimmed
<release>-pulsar-oxiaService are behavior changes for existing Oxia releases. Both are explained in the PR description but not in the README upgrade guidance. Since the 4.8.0 section is frozen, I assume a short note belongs in the section for the next chart version once it exists. It could also mention that a release that already hastls.oxia.enabled: true(a no-op until now) starts using TLS, and restarts the Oxia pods, on upgrade. - With
tls.oxiaon, the coordinator's internal endpoint and the 6651 admin endpoint remain plaintext and are only protected by the NetworkPolicy. I assume that is intentional because nothing in the chart connects to them over TLS, but a sentence in the README section saying so would avoid the wrong impression that all Oxia process-to-process traffic is encrypted.
The rolling restart when toggling tls.oxia on an existing release (servers on the new setting cannot replicate with servers on the old one) is described but, as you say, not tested on a cluster. A short manual check of that path before release would be reassuring.
…rom is set A non-empty oxia.networkPolicy.public.from replaced the open rule, so the release's own brokers, bookies, proxies and jobs lost access to the metadata store unless the list also selected them. The rule now always includes the release's pods, like the internal rule does.
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.
Motivation
When the chart deploys Oxia as the metadata store, Oxia's cluster-internal endpoints are more exposed than they need to be:
<release>-pulsar-oxiaClusterIP Service publishes the servers' internal endpoint (6649) and their metrics endpoint, not just the public endpoint. The internal endpoint serves the RPCs the Oxia servers use for replication and the coordinator uses to manage the shards, and it has no authentication by default. Nothing in the chart uses the extra ports through this Service: the Pulsar components connect to the public endpoint through the headless<release>-pulsar-oxia-svcService, and the PodMonitors scrape the pods directly.tls.oxia.enabledhas been invalues.yamlsince Oxia support was added (Add support for using Oxia as the metadata store for Pulsar and BookKeeper #544), but no template uses it.For example, with Oxia enabled, any pod in any namespace can open a connection to
<release>-pulsar-oxia:6649or<release>-pulsar-oxia-server-0.<release>-pulsar-oxia-svc:6649and call the internal RPCs.Modifications
oxia-server-service-public.yaml: the<release>-pulsar-oxiaService only exposes thepublicport. The headless Service is unchanged.New
oxia-networkpolicy.yaml, controlled byoxia.networkPolicy.enabled(defaulttrue). It selects the Oxia server and coordinator pods and allows:oxia.networkPolicy.public.fromcan restrict it),oxia.networkPolicy.metrics.from),oxia.networkPolicy.internal.from.The Pulsar components wait for Oxia with
nslookupand connect to the public endpoint, and the probes are exec probes, so the policy doesn't affect them. It needs a CNI plugin that enforces NetworkPolicy.tls.oxianow takes effect, together withtls.enabled:tls-certs-internal.yamlcreates the<release>-tls-oxiaCertificate throughpulsar.cert.template, for the server pods and the headless Service.createCert: false,dnsNames,ipAddresses,secretAnnotationsand everytls.common.sanModework as for the other components./pulsar/certs/oxia, and the CA at/pulsar/certs/ca.--internal-tls-*for their internal endpoint and--peer-tls-*for replication. The coordinator gets--peer-tls-*for its calls to the servers.tls.oxia.clientAuthadds--internal-tls-client-auth(mTLS).--peer-tls-server-name). The certificate contains that name in every SAN mode.oxia healthonly speaks plaintext, so with TLS on, the server probes use the public endpoint, which serves the same health service.README: a new "Oxia network access and TLS" section.
CI:
.ci/clusters/values-oxia-tls.yaml, with mTLS),.ci/test-certificate-san-modes.shfor all three SAN modes,fromlists and Oxia mTLS added to.ci/templates-all-values.yaml.Upgrade notes:
<release>-pulsar-oxia, needs to be added tooxia.networkPolicy.internal.fromor switched to the headless Service. NetworkPolicies are additive, so a release whose Oxia pods are already selected by stricter policies gets this policy's allowed sources added. Setoxia.networkPolicy.enabled: falseto keep the previous behavior.tls.oxiaon or off in an existing release restarts the Oxia pods. Servers on the new setting can't replicate with servers on the old one until all of them have restarted.Verifying this change
Make sure that the change passes the CI checks.
helm lint.helm templatediffed againstmaster:tls.oxia, the Oxia StatefulSet and Deployment add only the TLS flags, the cert mounts and the probe port, and there is a new Certificate..ci/test-certificate-san-modes.shpasses. A negative control with a wrong Oxia service name fails.I haven't run this chart on a cluster yet. The new "Oxia TLS" scenario covers a fresh install with mTLS, and the existing Oxia scenario now runs with the NetworkPolicy. The same NetworkPolicy and internal-endpoint mTLS setup was tested on kind with Oxia 0.16.11 in the equivalent oxia-db/helm-charts change (feat: restrict network exposure and add first-class TLS oxia-db/helm-charts#15): the cluster forms, and from other namespaces 6648 and metrics stay reachable while 6649 and 6651 are blocked. Plaintext connections, and TLS connections without a client certificate, are rejected on 6649.