Skip to content

Commit

Permalink
[Fix] Remove the requirement for VAP (kubernetes-sigs#3908)
Browse files Browse the repository at this point in the history
VAP is a default admission plugin enabled while
starting an API server for visibility. The Kueue
controller has additional permissions to watch those
GVKs even though it is not required. Disabling the plugin
from api server helps in keeping it minimal and maintaining
compatibility with previous versions of K8s.

Signed-off-by: Varsha Prasad Narsing <[email protected]>
  • Loading branch information
varshaprasad96 authored and ChristianZaccaria committed Jan 13, 2025
1 parent 89c7aaf commit c9a483e
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 23 deletions.
9 changes: 0 additions & 9 deletions charts/kueue/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,15 +79,6 @@ rules:
- list
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingadmissionpolicies
- validatingadmissionpolicybindings
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
Expand Down
2 changes: 1 addition & 1 deletion cmd/kueue/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ func main() {

features.LogFeatureGates(setupLog)

options, cfg, err := apply(configFile)
options, cfg, err = apply(configFile)
if err != nil {
setupLog.Error(err, "Unable to load the configuration")
os.Exit(1)
Expand Down
9 changes: 0 additions & 9 deletions config/components/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ rules:
- list
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingadmissionpolicies
- validatingadmissionpolicybindings
verbs:
- get
- list
- watch
- apiGroups:
- apps
resources:
Expand Down
2 changes: 0 additions & 2 deletions pkg/util/cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ const (
// +kubebuilder:rbac:groups="",resources=secrets,verbs=get;list;watch;update
// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=mutatingwebhookconfigurations,verbs=get;list;watch;update
// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=validatingwebhookconfigurations,verbs=get;list;watch;update
// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=validatingadmissionpolicies,verbs=get;list;watch
// +kubebuilder:rbac:groups="admissionregistration.k8s.io",resources=validatingadmissionpolicybindings,verbs=get;list;watch

// ManageCerts creates all certs for webhooks. This function is called from main.go.
func ManageCerts(mgr ctrl.Manager, cfg config.Configuration, setupFinished chan struct{}) error {
Expand Down
3 changes: 2 additions & 1 deletion pkg/visibility/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"os"
"strings"

validatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/validating"
openapinamer "k8s.io/apiserver/pkg/endpoints/openapi"
genericapiserver "k8s.io/apiserver/pkg/server"
genericoptions "k8s.io/apiserver/pkg/server/options"
Expand Down Expand Up @@ -77,7 +78,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}
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.

0 comments on commit c9a483e

Please sign in to comment.