Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pdb support feature gate #3328

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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ mod-download-go:

.PHONY: mirror-licenses
mirror-licenses: mod-download-go; \
go install istio.io/tools/cmd/license-lint@latest; \
go install istio.io/tools/cmd/license-lint@1.19.7; \
cd licenses; \
rm -rf `ls ./ | grep -v LICENSE`; \
cd -; \
Expand Down
4 changes: 4 additions & 0 deletions config/license-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,7 @@ allowlisted_modules:
- github.com/google/cadvisor
# Apache-2.0: k8s.io/kubernetes@v1.27.2/logo/LICENSE
- k8s.io/kubernetes
# BSD: github.com/gogo/protobuf@v1.3.2/LICENSE
- github.com/gogo/protobuf
# MIT: sigs.k8s.io/yaml@v1.3.0/LICENSE
- sigs.k8s.io/yaml
12 changes: 8 additions & 4 deletions pkg/features/volcano_features.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const (
// VolcanoJobSupport can identify and schedule volcano job.
VolcanoJobSupport featuregate.Feature = "VolcanoJobSupport"

// PodDisruptionBudgetsSupport can cache and support PodDisruptionBudgets
PodDisruptionBudgetsSupport featuregate.Feature = "PodDisruptionBudgetsSupport"

// QueueCommandSync supports queue command sync.
QueueCommandSync featuregate.Feature = "QueueCommandSync"

Expand All @@ -47,10 +50,11 @@ func init() {
}

var defaultVolcanoFeatureGates = map[featuregate.Feature]featuregate.FeatureSpec{
WorkLoadSupport: {Default: true, PreRelease: featuregate.Alpha},
VolcanoJobSupport: {Default: true, PreRelease: featuregate.Alpha},
QueueCommandSync: {Default: true, PreRelease: featuregate.Alpha},
PriorityClass: {Default: true, PreRelease: featuregate.Alpha},
WorkLoadSupport: {Default: true, PreRelease: featuregate.Alpha},
VolcanoJobSupport: {Default: true, PreRelease: featuregate.Alpha},
PodDisruptionBudgetsSupport: {Default: true, PreRelease: featuregate.Alpha},
QueueCommandSync: {Default: true, PreRelease: featuregate.Alpha},
PriorityClass: {Default: true, PreRelease: featuregate.Alpha},
// CSIStorage is explicitly set to false by default.
CSIStorage: {Default: false, PreRelease: featuregate.Alpha},
ResourceTopology: {Default: true, PreRelease: featuregate.Alpha},
Expand Down
8 changes: 6 additions & 2 deletions pkg/scheduler/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -582,10 +582,9 @@ func (sc *SchedulerCache) addEventHandler() {
mySchedulerPodName, c := getMultiSchedulerInfo()

// explicitly register informers to the factory, otherwise resources listers cannot get anything
// even with no error returned. `PodDisruptionBudgets` informer is used by `Pdb` plugin
// even with no error returned.
// `Namespace` informer is used by `InterPodAffinity` plugin,
// `SelectorSpread` and `PodTopologySpread` plugins uses the following four so far.
informerFactory.Policy().V1().PodDisruptionBudgets().Informer()
informerFactory.Core().V1().Namespaces().Informer()
informerFactory.Core().V1().Services().Informer()
if utilfeature.DefaultFeatureGate.Enabled(features.WorkLoadSupport) {
Expand All @@ -594,6 +593,11 @@ func (sc *SchedulerCache) addEventHandler() {
informerFactory.Apps().V1().StatefulSets().Informer()
}

// `PodDisruptionBudgets` informer is used by `Pdb` plugin
if utilfeature.DefaultFeatureGate.Enabled(features.PodDisruptionBudgetsSupport) {
informerFactory.Policy().V1().PodDisruptionBudgets().Informer()
}

// create informer for node information
sc.nodeInformer = informerFactory.Core().V1().Nodes()
sc.nodeInformer.Informer().AddEventHandlerWithResyncPeriod(
Expand Down
Loading