Repository navigation
data plane: remove the Secret mode - #1541
Conversation
justinsb
left a comment
There was a problem hiding this comment.
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:
TestDataplane_AppliedRevisionEndpoint(pkg/gari/gari_test.go) now builds&Server{...}by hand, copies the health wiring fromNew, and calls the unexportedapplyDataplaneConfig. Start the server withNewin data-plane mode against an internal API server, asTestDataplane_RoutesAndCertificatesdoes. It also drops two errors:_ = server.healthProbeServer.Serve(ln)and_ = server.healthProbeServer.Close().- One check for the three flags.
Options.complete()ingari.goandSetupincmd/gateway-api-reference-implementation/main.goboth require them, with two messages. Keep the one incomplete(), which both binaries reach. - Leftovers in
pkg/gari/gari.go.!opts.DataplaneMode &&is always true after the early return.SetupWithManagerstill returns early for data-plane mode, whichNewno longer reaches. A comment still says "combined DataplanePublisher". pkg/testdataplane/dataplane.go.serverErris written and never read, so a failedServeis silent; report it at clean-up. Theenvparameter ofStartDataplaneis unused; remove it.generateTestCAAndServerCertandstaticTokenReviewercopy whatpkg/gari/internal_api_client_test.gohas; export them once frompkg/testdataplaneand remove the copies in the test file. Spell outdopts.- Names and prose. Rename the two tests named
...WhenSecretSyncsBeforeListenerStart. Indocs/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. - 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 getchecks above it already cover the Role and RoleBinding. Remove the string search.
|
(agent comment) The change that gives |
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.
2e2b1a0 to
f0b113a
Compare
justinsb
left a comment
There was a problem hiding this comment.
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.
Fixes #1533