Skip to content

data plane: remove the Secret mode - #1541

Merged
justinsb merged 4 commits into
gke-labs:mainfrom
codebot-robot:issue_1533
Nov 22, 2026
Merged

justinsb merged 4 commits into
gke-labs:mainfrom
codebot-robot:issue_1533

Conversation

@codebot-robot

@codebot-robot codebot-robot commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #1533

@justinsb justinsb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The removal in pkg/gari is right: in data-plane mode gari.New builds no manager and uses no Kubernetes client. go vet and the unit tests of the touched packages pass locally. The first commit is the problem, and one test moved off the start-up path.

The first commit is not a move, and it is being delivered on its own. It copies PublishDataplaneConfig into localgateway/pkg/dnsconfig with a different field manager (gateway.gke-labs.io/singlepod, where main applies with gari-provisioner), and about 100 of its lines cannot run from its one caller, which passes no owner and a []byte. A separate, small change gives dnsconfig its own Secret writer. Do not change this pull request until that has merged. Then rebase, drop the first commit, and let this pull request only delete from singlepod.

After the rebase, also fix these:

  1. TestDataplane_AppliedRevisionEndpoint (pkg/gari/gari_test.go) now builds &Server{...} by hand, copies the health wiring from New, and calls the unexported applyDataplaneConfig. Start the server with New in data-plane mode against an internal API server, as TestDataplane_RoutesAndCertificates does. It also drops two errors: _ = server.healthProbeServer.Serve(ln) and _ = server.healthProbeServer.Close().
  2. One check for the three flags. Options.complete() in gari.go and Setup in cmd/gateway-api-reference-implementation/main.go both require them, with two messages. Keep the one in complete(), which both binaries reach.
  3. Leftovers in pkg/gari/gari.go. !opts.DataplaneMode && is always true after the early return. SetupWithManager still returns early for data-plane mode, which New no longer reaches. A comment still says "combined DataplanePublisher".
  4. pkg/testdataplane/dataplane.go. serverErr is written and never read, so a failed Serve is silent; report it at clean-up. The env parameter of StartDataplane is unused; remove it. generateTestCAAndServerCert and staticTokenReviewer copy what pkg/gari/internal_api_client_test.go has; export them once from pkg/testdataplane and remove the copies in the test file. Spell out dopts.
  5. Names and prose. Rename the two tests named ...WhenSecretSyncsBeforeListenerStart. In docs/dataplane-config-push.md, the numbered rollout list still says "alongside Secret publishing", "when unset, it watches the Secret" and "Remove Secret path"; state the design or remove the list.
  6. e2e. The new block searches the JSON of every RoleBinding for a name string, which also matches a binding's own name. The two kubectl get checks above it already cover the Role and RoleBinding. Remove the string search.

@justinsb

Copy link
Copy Markdown
Collaborator

(agent comment) The change that gives localgateway/pkg/dnsconfig its own Secret writer has merged (#1543). Rebase onto main, drop the first commit, and apply the six points of the last review.

Remove the Secret mode and reconciler from the data plane. gari.New
requires --internal-api-address, --internal-api-ca-file, and
--internal-api-token-file in data-plane mode and builds no manager.

Update pkg/testdataplane to start against an internal API push server
instead of a Secret. Remove singlepod.PublishDataplaneConfig and
singlepod.DataplaneSecretDataKey.

Update docs/dataplane-config-push.md to describe the design rather than
what it replaced.

Assert in e2e tests that the data-plane pod serves traffic with no Role
bound to its ServiceAccount.

Fixes gke-labs#1533
Add test in gcpgateway verifying that running in data-plane mode
without internal API flags returns an error naming --internal-api-address.

@justinsb justinsb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

In data-plane mode the binary builds no manager and uses no Kubernetes client; it requires the three internal API flags and exits with an error that names them.
The data plane's ServiceAccount has no RBAC, and the e2e test checks that no Role, RoleBinding or config Secret exists for a Gateway.
pkg/testdataplane now starts an internal API server for the subprocess data plane, which is where most of the added lines are.

@justinsb justinsb self-assigned this Nov 22, 2026
@justinsb
justinsb merged commit 790b0fa into gke-labs:main Nov 22, 2026
14 checks passed
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.

data plane: remove the Secret mode

2 participants