Skip to content

Commit

Permalink
FakeClientset: bump watch channel size
Browse files Browse the repository at this point in the history
Huge clusters with thousands of pods can quickly exceed the default
watch channel size of the fake clientset. Causing the channel
to panic with "channel full".
  • Loading branch information
ingvagabund committed Jun 15, 2023
1 parent 5462a59 commit 4c272e6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/descheduler/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (

"github.com/spf13/cobra"

"k8s.io/apimachinery/pkg/watch"
apiserver "k8s.io/apiserver/pkg/server"
"k8s.io/apiserver/pkg/server/mux"
restclient "k8s.io/client-go/rest"
Expand Down Expand Up @@ -111,6 +112,9 @@ func NewDeschedulerCommand(out io.Writer) *cobra.Command {
}

func Run(ctx context.Context, rs *options.DeschedulerServer) error {
// increase the fake watch channel so the dry-run mode can be run
// over a cluster with thousands of pods
watch.DefaultChanSize = 100000
return descheduler.Run(ctx, rs)
}

Expand Down

0 comments on commit 4c272e6

Please sign in to comment.