Skip to content

Commit

Permalink
[Follow-up] Remove unnecessary admission plugins from visibility serv…
Browse files Browse the repository at this point in the history
…er (#3923)

Remove unused plugins from visibility server.

Signed-off-by: Varsha Prasad Narsing <varshaprasad96@gmail.com>
  • Loading branch information
varshaprasad96 authored Jan 3, 2025
1 parent 62e94f7 commit 604f460
Show file tree
Hide file tree
Showing 39 changed files with 3,122 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pkg/visibility/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
"strings"

validatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/validating"
"k8s.io/apiserver/pkg/admission/plugin/resourcequota"
mutatingwebhook "k8s.io/apiserver/pkg/admission/plugin/webhook/mutating"
validatingwebhook "k8s.io/apiserver/pkg/admission/plugin/webhook/validating"
openapinamer "k8s.io/apiserver/pkg/endpoints/openapi"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
Expand All @@ -41,6 +44,14 @@ import (

var (
setupLog = ctrl.Log.WithName("visibility-server")
// Admission plugins that are enabled by default in the kubeapi server
// but are not required for the visibility server.
disabledPlugins = []string{
validatingadmissionpolicy.PluginName,
resourcequota.PluginName,
validatingwebhook.PluginName,
mutatingwebhook.PluginName,
}
)

// +kubebuilder:rbac:groups=flowcontrol.apiserver.k8s.io,resources=prioritylevelconfigurations,verbs=list;watch
Expand Down Expand Up @@ -78,7 +89,7 @@ func applyVisibilityServerOptions(config *genericapiserver.RecommendedConfig) er
o.SecureServing.BindPort = 8082
// The directory where TLS certs will be created
o.SecureServing.ServerCert.CertDirectory = "/tmp"
o.Admission.DisablePlugins = []string{validatingadmissionpolicy.PluginName}
o.Admission.DisablePlugins = disabledPlugins
if err := o.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{net.ParseIP("127.0.0.1")}); err != nil {
return fmt.Errorf("error creating self-signed certificates: %v", err)
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 604f460

Please sign in to comment.