Skip to content

feat(connectivities)!: route Ledger gRPC traffic through the stack Gateway - #576

Merged
flemzord merged 2 commits into
mainfrom
fix/connectivity-ledger-via-gateway
Nov 24, 2026
Merged

flemzord merged 2 commits into
mainfrom
fix/connectivity-ledger-via-gateway

Conversation

@flemzord

Copy link
Copy Markdown
Member

Summary

connectivity-core now reaches the Ledger v3 gRPC API through the stack Gateway instead of dialing the ledger-<stack> Service directly.

  • spec.ledgerAddress is set to gateway:8080 (new gateways.InClusterAddress).
  • spec.ledgerTLS is removed, including on already-provisioned delegated resources. The Gateway listener serves h2c in-cluster and handles the ledger backend TLS (CA trust pool + SNI) and the configured gRPC port.
  • The reconciler waits for a Gateway on the stack before provisioning (GatewayNotFound, or GatewayLookupFailed on a read error). The existing Gateway watch requeues the reconcile.
  • ledgers.V3GRPCBackendRef had no remaining caller and is removed. Its grpcPort override test now targets ledgerV3BaseSpec + ledgerV3GRPCBackendRef, which the Gateway backend still uses.
  • Module docs updated.

Compatibility checks (connectivity repo)

  • connectivity-core only uses ledger.BucketService, the service the Ledger v3 exposes through GatewayGRPCAPI.
  • ledgerTLS is optional in the connectivity CRD. Without it, the client dials with insecure credentials.
  • The Ed25519 TokenProvider and the protocol-version credentials return RequireTransportSecurity() == false, so they are sent over plaintext. Caddy forwards the authorization and ledger-protocol-version metadata unchanged. The gRPC route has no gateway auth directive, so the ledger still verifies the token.
  • NetworkPolicies: allow-same-namespace already covers connectivity pods → gateway.

Breaking change

The Connectivity module now requires a Gateway on the stack. Without one, the delegated Connectivity is not provisioned.

Notes for review

  • In-cluster hop connectivity → gateway is plaintext (h2c). The bearer token now crosses the pod network in clear on that hop. The gateway → ledger hop stays TLS. Previously the connection was TLS end to end.
  • Long-running streams now depend on the gateway's server timeouts (IdleTimeout, etc.).

Tests

  • go test ./... with envtest assets (setup-envtest use 1.32.0): pass.
  • golangci-lint run ./internal/...: 0 issues.
  • New: TestConnectivityReconcileWaitsForGatewayBeforeProvisioning. Updated: delegated spec assertions (gateway:8080, no ledgerTLS, legacy ledgerTLS removed on update).
  • Not verified on a live cluster.

@flemzord
flemzord requested a review from a team as a code owner November 10, 2026 16:05
@NumaryBot NumaryBot added risk: medium NumaryBot classified this pull request as medium risk. bot-reviewed review-approved The NumaryBot review gate is satisfied for the current head. labels Nov 10, 2026

@NumaryBot NumaryBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required automated review completed with no remaining findings.

…teway

connectivity-core now dials the Ledger v3 gRPC API through the stack
Gateway (gateway:8080, h2c) instead of the ledger Service directly. The
Gateway already routes ledger.BucketService, the only service
connectivity-core calls, and owns the ledger backend TLS and gRPC port.

- Set spec.ledgerAddress to the in-cluster Gateway address and remove
  spec.ledgerTLS, including on existing delegated resources.
- Wait for a Gateway on the stack (GatewayNotFound) before provisioning.
- Drop ledgers.V3GRPCBackendRef, which has no remaining caller. Keep its
  grpcPort test against the gateway backend helper.

BREAKING CHANGE: the Connectivity module now requires a Gateway on the
stack. Without one, the delegated Connectivity is not provisioned.
@flemzord
flemzord force-pushed the fix/connectivity-ledger-via-gateway branch from 03e907f to b52f5ed Compare November 19, 2026 21:57
@NumaryBot NumaryBot added review-approved The NumaryBot review gate is satisfied for the current head. and removed review-approved The NumaryBot review gate is satisfied for the current head. labels Nov 19, 2026
NumaryBot
NumaryBot previously approved these changes Nov 19, 2026

@NumaryBot NumaryBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required automated review completed with no remaining findings.

Upgrade the Uptrace Logrus bridge in the operator and its utility module. The 0.4 release uses attribute.Value in place of the removed log.Value API and keeps the OpenTelemetry security update.
@NumaryBot NumaryBot removed the review-approved The NumaryBot review gate is satisfied for the current head. label Nov 24, 2026
@flemzord

Copy link
Copy Markdown
Member Author

Dirty / Dirty, Tests / Test, and the five Kubernetes E2E jobs failed to compile with otelutil@v0.3.2: undefined: log.Value. The OpenTelemetry 1.47 update on main removed that API. Commit 148f547b updates the Uptrace Logrus bridge and otelutil to v0.4.0 in the operator and its utilities, keeping OpenTelemetry at v1.47.0.

All 18 local test suites passed. The operator and utilities build, and the pre-commit checks produced no generated changes.

@NumaryBot NumaryBot added the review-approved The NumaryBot review gate is satisfied for the current head. label Nov 24, 2026

@NumaryBot NumaryBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The required automated review completed with no remaining findings.

@flemzord
flemzord merged commit 02d8aa8 into main Nov 24, 2026
16 checks passed
@flemzord
flemzord deleted the fix/connectivity-ledger-via-gateway branch November 24, 2026 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-reviewed review-approved The NumaryBot review gate is satisfied for the current head. risk: medium NumaryBot classified this pull request as medium risk.

Development

Successfully merging this pull request may close these issues.

2 participants