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

Resync 20211223 #14

Closed
wants to merge 27 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
c64a750
0.21 chart should go with v1beta1
Huang-Wei Nov 18, 2021
7fb25a6
avoid instantiate core resource's informers
Huang-Wei Nov 20, 2021
7c21f6f
NodeResourceTopology: Update README with NRT CR dependency information
swatisehgal Nov 24, 2021
67e87eb
Merge pull request #304 from k8stopologyawareschedwg/nrt-doc-update
k8s-ci-robot Nov 30, 2021
7c14051
Merge pull request #302 from Huang-Wei/rm-extra-informer
k8s-ci-robot Nov 30, 2021
e51daae
feat: activate sibling pods of a PodGroup
Huang-Wei Nov 18, 2021
b13a39d
images: use k8s-staging-test-infra/gcb-docker-gcloud
spiffxp Nov 30, 2021
9943664
Merge pull request #305 from spiffxp/use-k8s-infra-for-gcb-image
k8s-ci-robot Nov 30, 2021
eebcd60
images: fix invalid k8s-staging-test-infra/gcb-docker-gcloud tag
spiffxp Nov 30, 2021
6fafbb6
fixup: address comments
Huang-Wei Nov 20, 2021
4e7064b
Merge pull request #306 from spiffxp/fix-gcb-image
k8s-ci-robot Dec 1, 2021
6b3642f
Merge pull request #299 from Huang-Wei/activate-podgroup-pods
k8s-ci-robot Dec 1, 2021
822c324
coscheduling: PostFilter handles both Filter and PreFilter
mateuszlitwin Dec 3, 2021
37e7699
Merge pull request #307 from mateuszlitwin/mlitwin-post-filter-on-eve…
k8s-ci-robot Dec 8, 2021
da8c3d1
Fix controller reconcile PodGroup status
lianghao208 Dec 7, 2021
7cf6512
Merge pull request #298 from Huang-Wei/chart-v1beta1
k8s-ci-robot Dec 10, 2021
1c74486
Nominate denkensk as an approver
Huang-Wei Dec 14, 2021
3220240
Merge pull request #310 from Huang-Wei/nominate-alex
k8s-ci-robot Dec 14, 2021
3a5a8ef
PreemptionToleration: define PreemptionTolerationArgs in v1beta2
everpeace Dec 15, 2021
f497cde
PreemptionToleration: Migrated required unexported functions from Def…
everpeace Dec 15, 2021
2090734
PreemptionToleration: plugin implementation and unit/integration tests
everpeace Dec 15, 2021
407b2d1
Merge pull request #224 from everpeace/preemption-toleration-impl
k8s-ci-robot Dec 15, 2021
77279bf
Merge pull request #308 from lianghao208/pod_group_reconcile
k8s-ci-robot Dec 16, 2021
15e4bf7
Add PreemptionToleration to Plugin List in README
everpeace Dec 21, 2021
5f63e9c
Merge pull request #313 from everpeace/patch-1
k8s-ci-robot Dec 21, 2021
3ad05e0
Merge remote-tracking branch 'upstream/master' into resync-20211223
Tal-or Dec 23, 2021
2709abb
[KNI] resync: update resync entry
Tal-or Dec 23, 2021
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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ The kube-scheduler binary includes the below list of plugins. They can be config
* [Coscheduling](pkg/coscheduling/README.md)
* [Node Resources](pkg/noderesources/README.md)
* [Node Resource Topology](pkg/noderesourcetopology/README.md)
* [Preemption Toleration](pkg/preemptiontoleration/README.md)
* [Trimaran](pkg/trimaran/README.md)

Additionally the kube-scheduler binary includes the below list of sample plugins. These plugins are not intended for use in production
Expand Down
10 changes: 6 additions & 4 deletions RESYNC.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ at the beginning of the commit message.

For the sake of transparency, for every resync process we should update the following table:

| Resync Date | Merge With Upstream Tag/Commit | Author |
|-------------|------------------------------------------------------------------------------------------------------|--------|
| 12.11.2021 | https://github.com/kubernetes-sigs/scheduler-plugins/commit/b8d13e17a3e1f633d72d71276a3da6fecf89f2e3 | Tal-or |
| Resync Date | Merge With Upstream Tag/Commit | Author|
|--------------|-------------------------------------------------------------------------------------------------------|-------|
| 23.12.2021 | https://github.com/kubernetes-sigs/scheduler-plugins/commit/5f63e9cc7af2fda28ff1f0ba0dff0cb847c36179 | Tal-or|
| 12.11.2021 | https://github.com/kubernetes-sigs/scheduler-plugins/commit/b8d13e17a3e1f633d72d71276a3da6fecf89f2e3 | Tal-or|

The newest resync should appear in the first row.

The newest resync should appear in the first row.
2 changes: 1 addition & 1 deletion cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ timeout: 2400s
options:
substitution_option: ALLOW_LOOSE
steps:
- name: 'gcr.io/k8s-testimages/gcb-docker-gcloud:v20190906-745fed4'
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20211118-2f2d816b90'
entrypoint: make
env:
- DOCKER_CLI_EXPERIMENTAL=enabled
Expand Down
3 changes: 3 additions & 0 deletions cmd/scheduler/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ import (
"sigs.k8s.io/scheduler-plugins/pkg/noderesources"
"sigs.k8s.io/scheduler-plugins/pkg/noderesourcetopology"
"sigs.k8s.io/scheduler-plugins/pkg/podstate"
"sigs.k8s.io/scheduler-plugins/pkg/preemptiontoleration"
"sigs.k8s.io/scheduler-plugins/pkg/qos"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/loadvariationriskbalancing"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/targetloadpacking"

// Ensure scheme package is initialized.
_ "sigs.k8s.io/scheduler-plugins/pkg/apis/config/scheme"
)
Expand All @@ -49,6 +51,7 @@ func main() {
app.WithPlugin(loadvariationriskbalancing.Name, loadvariationriskbalancing.New),
app.WithPlugin(noderesources.AllocatableName, noderesources.NewAllocatable),
app.WithPlugin(noderesourcetopology.Name, noderesourcetopology.New),
app.WithPlugin(preemptiontoleration.Name, preemptiontoleration.New),
app.WithPlugin(targetloadpacking.Name, targetloadpacking.New),
// Sample plugins below.
app.WithPlugin(crossnodepreemption.Name, crossnodepreemption.New),
Expand Down
5 changes: 0 additions & 5 deletions kep/205-preemption-toleration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,6 @@ kind: PriorityClass
metadata:
name: toleration-policy-sample
annotation:
# this key is needed to enable preemption toleration policy for distinguishing
# between no toleration policy and empty toleration policy (all fields will be default)
preemption-toleration.scheduling.sigs.k8s.io/enabled: ""
preemption-toleration.scheduling.sigs.k8s.io/minimum-preemptable-priority: "10000"
preemption-toleration.scheduling.sigs.k8s.io/toleration-seconds: "3600"
value: 8000
Expand Down Expand Up @@ -155,7 +152,6 @@ kind: PriorityClass
metadata:
name: low-non-preempted
annotation:
preemption-toleration.scheduling.sigs.k8s.io/enabled: ""
# This priority class can tolerate preemption by priority with p < 10000.
preemption-toleration.scheduling.sigs.k8s.io/minimum-preemptable-priority: "10000"
# This priority class can tolerate preemption forever by priority with p < 10000(=minimum-preemptable-priority)
Expand Down Expand Up @@ -189,7 +185,6 @@ kind: PriorityClass
metadata:
name: low-non-preempted-10min
annotation:
preemption-toleration.scheduling.sigs.k8s.io/enabled: ""
# This priority class can tolerate preemption by priority with p < 10000.
preemption-toleration.scheduling.sigs.k8s.io/minimum-preemptable-priority: "10000"
# This priority class can tolerate preemption for 10 minutes (600 seconds)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
namespace: {{ .Values.scheduler.namespace }}
data:
scheduler-config.yaml: |
apiVersion: kubescheduler.config.k8s.io/v1beta2
apiVersion: kubescheduler.config.k8s.io/v1beta1
kind: KubeSchedulerConfiguration
leaderElection:
leaderElect: false
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/config/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&TargetLoadPackingArgs{},
&LoadVariationRiskBalancingArgs{},
&NodeResourceTopologyMatchArgs{},
&PreemptionTolerationArgs{},
)
return nil
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/apis/config/scheme/scheme_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"sigs.k8s.io/scheduler-plugins/pkg/apis/config/v1beta1"
"sigs.k8s.io/scheduler-plugins/pkg/coscheduling"
"sigs.k8s.io/scheduler-plugins/pkg/noderesources"
"sigs.k8s.io/scheduler-plugins/pkg/preemptiontoleration"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/loadvariationriskbalancing"
"sigs.k8s.io/scheduler-plugins/pkg/trimaran/targetloadpacking"
"sigs.k8s.io/yaml"
Expand Down Expand Up @@ -357,6 +358,10 @@ profiles:
safeVarianceMargin: 1.0
safeVarianceSensitivity: 1.0
watcherAddress: http://deadbeef:2020
- name: PreemptionToleration
args:
minCandidateNodesPercentage: 20
minCandidateNodesAbsolute: 200
`),
wantProfiles: []defaultconfig.KubeSchedulerProfile{
{
Expand Down Expand Up @@ -407,6 +412,10 @@ profiles:
},
},
},
{
Name: preemptiontoleration.Name,
Args: &config.PreemptionTolerationArgs{MinCandidateNodesPercentage: 20, MinCandidateNodesAbsolute: 200},
},
{
Name: "DefaultPreemption",
Args: &defaultconfig.DefaultPreemptionArgs{MinCandidateNodesPercentage: 10, MinCandidateNodesAbsolute: 100},
Expand Down Expand Up @@ -460,6 +469,8 @@ profiles:
args:
- name: LoadVariationRiskBalancing
args:
- name: PreemptionToleration
args:
`),
wantProfiles: []defaultconfig.KubeSchedulerProfile{
{
Expand Down Expand Up @@ -512,6 +523,10 @@ profiles:
},
},
},
{
Name: preemptiontoleration.Name,
Args: &config.PreemptionTolerationArgs{MinCandidateNodesPercentage: 10, MinCandidateNodesAbsolute: 100},
},
{
Name: "DefaultPreemption",
Args: &defaultconfig.DefaultPreemptionArgs{MinCandidateNodesPercentage: 10, MinCandidateNodesAbsolute: 100},
Expand Down
8 changes: 8 additions & 0 deletions pkg/apis/config/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ package config
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"

// TODO: eliminate the "versioned" import, i.e., schedulerconfig.ResourceSpec should be unversioned.ResourceSpec.
schedulerconfig "k8s.io/kube-scheduler/config/v1"
unversioned "k8s.io/kubernetes/pkg/scheduler/apis/config"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -145,3 +148,8 @@ type NodeResourceTopologyMatchArgs struct {
// ScoringStrategy a scoring model that determine how the plugin will score the nodes.
ScoringStrategy ScoringStrategy
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

// PreemptionTolerationArgs reuses DefaultPluginArgs.
type PreemptionTolerationArgs unversioned.DefaultPreemptionArgs
7 changes: 7 additions & 0 deletions pkg/apis/config/v1beta2/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ import (
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
schedulerconfig "k8s.io/kube-scheduler/config/v1"
schedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2"

k8sschedulerconfigv1beta2 "k8s.io/kubernetes/pkg/scheduler/apis/config/v1beta2"
pluginConfig "sigs.k8s.io/scheduler-plugins/pkg/apis/config"
)

Expand Down Expand Up @@ -143,3 +145,8 @@ func SetDefaultsNodeResourceTopologyMatchArgs(obj *NodeResourceTopologyMatchArgs
}
}
}

// PreemptionTolerationArgs reuses SetDefaults_DefaultPreemptionArgs
func SetDefaultsPreemptionTolerationArgs(obj *PreemptionTolerationArgs) {
k8sschedulerconfigv1beta2.SetDefaults_DefaultPreemptionArgs((*schedulerconfigv1beta2.DefaultPreemptionArgs)(obj))
}
8 changes: 8 additions & 0 deletions pkg/apis/config/v1beta2/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ func TestSchedulingDefaults(t *testing.T) {
},
},
},
{
name: "empty config PreeemptionTolerationArgs",
config: &PreemptionTolerationArgs{},
expect: &PreemptionTolerationArgs{
MinCandidateNodesPercentage: pointer.Int32Ptr(10),
MinCandidateNodesAbsolute: pointer.Int32Ptr(100),
},
},
}

for _, tc := range tests {
Expand Down
1 change: 1 addition & 0 deletions pkg/apis/config/v1beta2/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func addKnownTypes(scheme *runtime.Scheme) error {
&TargetLoadPackingArgs{},
&LoadVariationRiskBalancingArgs{},
&NodeResourceTopologyMatchArgs{},
&PreemptionTolerationArgs{},
)
return nil
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/apis/config/v1beta2/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
schedulerconfig "k8s.io/kube-scheduler/config/v1"
schedulerconfigv1beta2 "k8s.io/kube-scheduler/config/v1beta2"
)

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down Expand Up @@ -142,3 +143,9 @@ type NodeResourceTopologyMatchArgs struct {

ScoringStrategy *ScoringStrategy `json:"scoringStrategy,omitempty"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// +k8s:defaulter-gen=true

// PreemptionTolerationArgs reuses DefaultPluginArgs.
type PreemptionTolerationArgs schedulerconfigv1beta2.DefaultPreemptionArgs
40 changes: 40 additions & 0 deletions pkg/apis/config/v1beta2/zz_generated.conversion.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 35 additions & 0 deletions pkg/apis/config/v1beta2/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions pkg/apis/config/v1beta2/zz_generated.defaults.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions pkg/apis/config/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions pkg/controller/podgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,11 @@ func (ctrl *PodGroupController) syncHandler(key string) error {
pgCopy.Status.Succeeded = succeeded
pgCopy.Status.Running = running

if len(pods) == 0 {
pgCopy.Status.Phase = schedv1alpha1.PodGroupPending
break
}

if pgCopy.Status.Scheduled >= pgCopy.Spec.MinMember && pgCopy.Status.Phase == schedv1alpha1.PodGroupScheduling {
pgCopy.Status.Phase = schedv1alpha1.PodGroupScheduled
}
Expand Down
Loading