diff --git a/services/apiserver.go b/services/apiserver.go index c71fbef42e5c64b6d3356995aa1fb6110b70a737..8dbaf508abb66504c70539e08e694131fce1ef07 100644 --- a/services/apiserver.go +++ b/services/apiserver.go @@ -94,6 +94,17 @@ func buildConfig(c *Cluster) (config *server.Config, clients *Clients, err error sets.NewString("attach", "exec", "proxy", "log", "portforward"), ) + // Disable unneeded post start hooks, these cannot be easily disabled except at runtime, which still takes up + // space in the binary sadly + config.DisabledPostStartHooks = sets.NewString( + // bootstrap-controller : TODO replace endpoint reconciler logic if required + "generic-apiserver-start-informers", // they are started manually + "start-apiextensions-informers", // started manually also + "storage-object-count-tracker-hook", // unused + "start-legacy-token-tracking-controller", // legacy and unused + "rbac/bootstrap-roles", // TODO replaced with our own simpler RBAC + ) + // Setup listener listener, err := net.Listen("tcp6", fmt.Sprintf("[%s]:%d", c.networking.NodeAddress.IP.String(), apiserverPort)) if err != nil { @@ -328,6 +339,7 @@ var kubeApiserver = &Unit{ // Finally start the apiserver server := apiServer.GenericAPIServer.PrepareRun() + go clients.Start(ctx) return server.Run(ctx.Done()) }, Ready: func(u *Unit, c *Cluster) bool {