Emit path-based NATS address for Gateway installs#1287
Merged
Conversation
The platform config gated the path-based NATS endpoints (EXTERNAL_ADDR nats://<host>:4222, WEBSOCKET_ADDR wss://<host>/nats) behind ingress-nginx being enabled. Gateway-based installs fell into the else branch, which emits the subdomain form wss://nats.<host>. For deployments where global.platform.host is an IP (self-hosted, DNS-less), wss://nats.<ip> is unresolvable and not covered by the gateway cert SANs, so the audit/site-info NATS client can never connect. The Gateway already provisions an HTTPRoute matching PathPrefix /nats -> <release>-nats:443, i.e. the path-based endpoint. Take the path-based branch when either ingress-nginx or the gateway is enabled. Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
Imtiaz246
approved these changes
Jul 1, 2026
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.
The platform config (
charts/ace/templates/platform/config.yaml) gated the path-based NATS endpoints behindingress-nginxbeing enabled:Gateway-based installs (
ingress-nginx.enabled=false,gateway.enabled=true) fall into theelsebranch, which emits the subdomain formwss://nats.<host>.Problem
When
global.platform.hostis an IP (self-hosted, DNS-less), theelsebranch yieldswss://nats.<ip>(e.g.wss://nats.10.2.0.63), which:ace-nats.ace.svc…,IP:<ip>).So the audit / site-info NATS client (via
b3NATS.ExternalAddresses()→kube-ui-serverextended API) getswss://nats.<ip>back and can never connect:The Gateway already provisions the matching route — an HTTPRoute with
PathPrefix: /nats→<release>-nats:443— i.e. exactly the path-based endpoint theifbranch emits.Fix
Take the path-based branch when either
ingress-nginxorgatewayis enabled. Gateway+IP installs then renderwss://<host>/nats, which resolves (literal IP), TLS-validates (IP in cert SAN), and routes (existing/natsHTTPRoute).