diff --git a/cmd/kube-apiserver/app/aggregator.go b/cmd/kube-apiserver/app/aggregator.go index 6c0c23f83bb..30f3b01915e 100644 --- a/cmd/kube-apiserver/app/aggregator.go +++ b/cmd/kube-apiserver/app/aggregator.go @@ -120,6 +120,9 @@ func createAggregatorConfig( }, } + // we need to clear the poststarthooks so we don't add them multiple times to all the servers (that fails) + aggregatorConfig.GenericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{} + return aggregatorConfig, nil } diff --git a/cmd/kube-apiserver/app/apiextensions.go b/cmd/kube-apiserver/app/apiextensions.go index c2f8dab4ffd..438e8588c2b 100644 --- a/cmd/kube-apiserver/app/apiextensions.go +++ b/cmd/kube-apiserver/app/apiextensions.go @@ -92,6 +92,9 @@ func createAPIExtensionsConfig( }, } + // we need to clear the poststarthooks so we don't add them multiple times to all the servers (that fails) + apiextensionsConfig.GenericConfig.PostStartHooks = map[string]genericapiserver.PostStartHookConfigEntry{} + return apiextensionsConfig, nil }