Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions charts/gpu-base-operator/templates/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods/eviction
verbs:
- create
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
8 changes: 8 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ limitations under the License.
package main

import (
"context"
"crypto/tls"
"flag"
"os"
Expand Down Expand Up @@ -346,6 +347,13 @@ func main() {
ModuleLoaderServiceAccountName: moduleLoaderSAName,
}

// Registered here rather than in a controller's SetupWithManager: the index is shared by
// every controller that drains a node, and controller-runtime allows only one registration.
if err := controller.SetupDrainIndices(context.Background(), mgr); err != nil {
setupLog.Error(err, "unable to set up drain cache indexes")
os.Exit(1)
}

if err := (&controller.ClusterPolicyReconciler{
Client: mgr.GetClient(),
Scheme: mgr.GetScheme(),
Expand Down
6 changes: 6 additions & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ rules:
- get
- list
- watch
- apiGroups:
- ""
resources:
- pods/eviction
verbs:
- create
- apiGroups:
- admissionregistration.k8s.io
resources:
Expand Down
Loading