With users configured and jetstream.enabled true, the chart enables
JetStream on the server but generates account A without it, so every
JetStream call from those users fails with error 10039, "JetStream not
enabled for account". The generated account now gets jetstream: true
unless it already sets JetStream itself. nats-server matches config keys
case-insensitively and walks the account map in no fixed order, so a
JetStream key in any casing counts as set. Otherwise the account would
carry both keys and the server would apply either one, changing from
restart to restart.
Assisted-by: LLM
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
These cases picked a document by position and then asserted only that
something is absent from it. When a template gains or reorders a
document, the index lands on a different object that lacks the field
just as well, and the case stays green while the property it names is
no longer checked. Selecting by kind or metadata.name keeps each case on
the object it names, and fails with "document not found" when that
object stops rendering.
Assisted-by: LLM
Signed-off-by: Aleksei Sviridkin <f@lex.la>
With users set the chart emitted accounts.A.users from the generated
passwords and then appended .Values.config.merge verbatim. A tenant that
also put an accounts block into config.merge, which is the only place to
enable JetStream for the generated account, got the key twice in the
rendered values and the release failed at post-render.
The generated users are now merged into config.merge before it is
rendered: the generated list wins for account A, everything else the
tenant put under config.merge is kept, and a config.merge without users
passes through unchanged.
Signed-off-by: Yan Bondarenko <202671653+yankawai@users.noreply.github.com>
The comment claimed a visibility label on either cert-manager Certificate
would hand its private key to every tenant subject. It would not, today:
tenantsecrets serves only what the lineage webhook marked
tenantresource=true, and lineage resolves through ownerReferences or the
Flux helm label, neither of which a cert-manager Secret carries while
enableCertificateOwnerRef stays false.
The assertions stay -- they become load-bearing as soon as either gate
moves, and one of them is not this chart's to hold.
Signed-off-by: Aleksei Sviridkin <3811295@gmail.com>
hasDocuments counts rendered documents, not list entries, so a second
projection naming tls.key as its source rendered inside the same
document and left the suite green. The controller refuses a sentinel
carrying more than one entry, which makes that a silent loss of the
tenant's trust anchor.
Assert the list length alongside the entry it pins.
Signed-off-by: Aleksei Sviridkin <3811295@gmail.com>
The ResourceDefinition and the dashboard Role are the tenant-facing half of
the trust-anchor delivery path, and neither is a chart template, so the
helm-unittest suite covers neither. Deleting the tenant-CA selector or
granting a key-bearing Secret by name both left the suite fully green.
nats-<name>-ca holds the CA private key and nats-<name>-tls the server key.
Granting either to a tenant would let the holder issue certificates rather
than merely verify them. What a client needs is ca.crt alone, delivered as
the key-free <release>.tenant-ca projection and selected by label, since a
label is stamped only on an object the platform produced while a name grant
conveys whatever occupies the name.
The include set is asserted as a whitelist so a key-bearing Secret cannot
slip in under a spelling the test did not anticipate.
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Assisted-By: Claude <noreply@anthropic.com>
A tenant enabling TLS had no way to obtain the CA certificate without
also being granted a Secret that carries a private key, so the server
certificate could not actually be verified.
Render a TenantProjection sentinel naming the chart's CA Secret as the
source of a key-free CACert projection. The CA-extraction controller
publishes that projection as <release>.tenant-ca, and a label selector
on the application definition surfaces it to the tenant through
tenantsecrets. The key-bearing <release>-ca stays tenant-invisible.
The sentinel is gated on the chart's effective TLS state, the same
condition that governs the cert-manager objects, because the source
Secret exists only while TLS is on. It deliberately carries no
ownerReferences, namespace or chart-added labels: the controller derives
the published name from the helm.toolkit.fluxcd.io/name label Flux
stamps, and an ownerReference would short-circuit that lineage walk.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
RSA is slower and produces larger keys and certificates than ECDSA. P-256
provides equivalent security with smaller cert size and faster TLS handshakes,
which matters for frequent cluster-internal reconnections.
CA retains rotationPolicy: Never; leaf retains rotationPolicy: Always.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Arsolitt <arsolitt@gmail.com>
The upstream NATS chart defaults routeURLs.useFQDN to false, which causes
peer routes to resolve as tls://<release>-N.<release>-headless:6222 (short
form). The cert SAN wildcard *.<release>-headless.<ns>.svc.<cluster> matches
FQDN forms but not the short form, so inter-pod cluster traffic runs in
encryption-only mode without hostname verification.
Setting useFQDN: true when TLS is enabled makes peer routes use the FQDN
form that matches the wildcard SAN, restoring authenticated TLS for cluster
routing.
Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Arsolitt <arsolitt@gmail.com>