Skip to content

Commit

Permalink
[Fix] Remove the requirement for VAP
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 committed Dec 25, 2024
1 parent 95bc3b2 commit 81ec4ac
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 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
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

0 comments on commit 81ec4ac

Please sign in to comment.