Skip to content

Commit

Permalink
Cherry-pick #3908: Fix 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 Jan 16, 2025
1 parent 3c49a16 commit 96ebb1d
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 23 deletions.
10 changes: 0 additions & 10 deletions charts/kueue/templates/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,11 @@ rules:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- list
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingadmissionpolicies
- validatingadmissionpolicybindings
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling.x-k8s.io
resources:
Expand Down
10 changes: 0 additions & 10 deletions config/components/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,11 @@ rules:
- admissionregistration.k8s.io
resources:
- mutatingwebhookconfigurations
- validatingwebhookconfigurations
verbs:
- get
- list
- update
- watch
- apiGroups:
- admissionregistration.k8s.io
resources:
- validatingadmissionpolicies
- validatingadmissionpolicybindings
verbs:
- get
- list
- watch
- apiGroups:
- autoscaling.x-k8s.io
resources:
Expand Down
3 changes: 0 additions & 3 deletions pkg/util/cert/cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,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
2 changes: 2 additions & 0 deletions pkg/visibility/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package visibility
import (
"context"
"fmt"
validatingadmissionpolicy "k8s.io/apiserver/pkg/admission/plugin/policy/validating"
"net"
"os"
"strings"
Expand Down Expand Up @@ -81,6 +82,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 96ebb1d

Please sign in to comment.