Skip to content

feat(chart): extra CAs for the egress gateway's upstream TLS - #101

Open
fiunchinho wants to merge 1 commit into
kagent-dev:mainfrom
giantswarm:upstream/atenet-egress-upstream-trust-2
Open

fiunchinho wants to merge 1 commit into
kagent-dev:mainfrom
giantswarm:upstream/atenet-egress-upstream-trust-2

Conversation

@fiunchinho

@fiunchinho fiunchinho commented Oct 26, 2026 •

Copy link
Copy Markdown

Fixes #100

Problem

The egress gateway dials the upstream of an https rule with the image's public roots only, so an upstream behind a private CA (for example an in-cluster model gateway) fails with UnknownIssuer. Setting backendTLS.root to the private CA replaces the public roots.

Change

  • atenetEgress.upstreamTrust.caBundle renders a PEM bundle as the ConfigMap <release>-atenet-egress-upstream-trust.
  • The agentgateway container mounts it at /run/egress-upstream-trust and sets SSL_CERT_DIR to that path, beside SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt.
  • With a bundle set, the dynamic HTTPS backend renders backendTLS: {} without root, so agentgateway builds its roots from rustls-native-certs, which loads both locations.
  • checksum/upstream-trust on the pod template rolls the gateway when the bundle changes.
  • Empty by default. The default render is byte-identical to main.

Testing

helm unittest charts/substrate
helm lint charts/substrate
helm template rel charts/substrate --output-dir out-default
helm template rel charts/substrate -f bundle-values.yaml --output-dir out-bundle
  • helm unittest: 44 of 44 tests pass. charts/substrate/tests/atenet_egress_upstream_trust_test.yaml covers both cases: root: /etc/ssl/certs/ca-certificates.crt on the dynamic backend by default, and backendTLS: {} with no reference to the image bundle in the gateway config when a bundle is set. The second case fails without the root change.
  • helm lint: 0 charts failed.
  • diff -r of the default render against a render of main: no differences.
  • With a bundle: the dynamic backend has backendTLS: {}, the container has SSL_CERT_FILE and SSL_CERT_DIR=/run/egress-upstream-trust, and the ConfigMap, volume, mount and checksum annotation are present.

The change was prepared with an AI coding agent (cherry-pick, conflict resolution, the root change and the chart tests). I reviewed the diff and the rendered output.

The egress gateway terminates the actors' TLS and dials the upstream itself with the public roots of its agentgateway image, so an endpoint behind a private CA fails every call with UnknownIssuer, whatever the actor's runtime trusts. The route's backendTLS.root would replace the public roots rather than add to them. atenetEgress.upstreamTrust.caBundle renders a PEM bundle as a ConfigMap, mounts it on the egress agentgateway and sets SSL_CERT_DIR next to SSL_CERT_FILE, the image's public bundle; rustls-native-certs then loads both. With a bundle set, the dynamic HTTPS backend leaves out backendTLS.root, because agentgateway reads the native roots only when root is unset. A checksum annotation rolls the gateway on a change. Empty by default, which leaves the rendered manifests unchanged.

(cherry picked from commit 175664c)
Signed-off-by: Jose Armesto <github@armesto.net>
fiunchinho added a commit to giantswarm/substrate that referenced this pull request Oct 26, 2026
egress-gateway-trusts-extra-cas-actors-upstream moves from to-file to open: the issue
kagent-dev#100 and the chart PR kagent-dev#101 were filed on 2026-10-26
from a cherry-pick of the prepared commit onto upstream main, with the dynamic backend's
backendTLS.root left out when a bundle is set.

Signed-off-by: Jose Armesto <github@armesto.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Egress gateway: trust extra CAs for upstream TLS without replacing the public roots

2 participants