Skip to content

service-vault: bootstrap vault CA and expose vault via TCP gateway for relays - #1357

Open
ArnobKumarSaha wants to merge 1 commit into
masterfrom
arnob-vault-ca-fix
Open

ArnobKumarSaha wants to merge 1 commit into
masterfrom
arnob-vault-ca-fix

Conversation

@ArnobKumarSaha

@ArnobKumarSaha ArnobKumarSaha commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Problem

On a fresh ACE install (chart v2026.9.11, kubevault operator v0.25.0) the kubevault/vault VaultServer never gets pods:

  1. The VaultServer validating webhook rejects every update, including the operator's finalizer patch:
    spec.relayPlacementRef requires a "vault" service template of type: LoadBalancer or the "kubevault.com/server-address" annotation set to an externally-resolvable address
    The chart always emits relayPlacementRef, but defaults to serviceType: ClusterIP with no annotation.
  2. service-vault-ca-issuer is a CA Issuer on secret vault-ca, and nothing creates that secret (ErrGetKeyPair: secrets "vault-ca" not found), so vault TLS certs are never issued.
  3. The vault Gateway terminates HTTPS with service-vault-cert, which also doesn't exist (InvalidCertificateRef). Even with the cert, spokes would get a cert that the hub CA bundle doesn't validate.

Changes

  • CA bootstrap: when vaultServer.tls.caSecretName is empty (new default), the chart creates a selfSigned Issuer, an isCA Certificate (<fullname>-ca, rotationPolicy: Never), and a CA Issuer. A user-supplied caSecretName is still honored.
  • vaultServer.serverAddress (new): emitted as the kubevault.com/server-address annotation and as a server cert SAN (IP or DNS). The operator only adds LoadBalancer ingress to SANs, not this annotation. akp-installer defaults it to platform.host; the generated ace-installer and akp-installer-certified carry the same default.
  • relayPlacementRef/relayTemplate are emitted only when relay.clusterSet is set. Rendering fails early if relay is on without serviceType: LoadBalancer or serverAddress.
  • Gateway: replaces HTTPS termination with TCP passthrough (8200 API, 50053 relay gRPC proxy) via TCPRoutes, following the existing ace-nats TCPRoute pattern. Rendered only when serverAddress is set.

Testing

  • helm template checked for: defaults (fails with the guard message), serverAddress as an IP and as a DNS name, relay off with a custom CA, and serviceType=LoadBalancer.
  • kubectl apply --dry-run=server on the live cluster: the VaultServer update is accepted by the webhook, and the Gateway, TCPRoutes, Certificate and Issuers validate.
  • make gen, make fmt, go build ./... pass.

Upgrade note

The CA secret name changes from vault-ca to <fullname>-ca. On existing installs vault-ca never existed, so nothing is lost.

…r relays

- Bootstrap a CA (selfSigned Issuer -> isCA Certificate -> CA Issuer) when
  vaultServer.tls.caSecretName is empty; previously the issuer pointed at a
  vault-ca secret nothing created, so vault TLS certs were never issued.
- Add vaultServer.serverAddress, emitted as the kubevault.com/server-address
  annotation and as a server cert SAN; akp-installer (and the generated
  ace-installer) defaults it to platform.host. Without it the VaultServer
  validating webhook rejects every update when relayPlacementRef is set on a
  ClusterIP service.
- Emit relayPlacementRef/relayTemplate only when relay.clusterSet is set, and
  fail at template time if relay is on without LoadBalancer or serverAddress.
- Replace the HTTPS-terminating Gateway (referenced a missing
  service-vault-cert secret) with TCP passthrough on 8200 and 50053 so spokes
  reach vault with its own CA-signed cert.

Signed-off-by: Arnob kumar saha <arnob@appscode.com>
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.

1 participant