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

Volcano adapts to the k8s v1.25 #2533

Merged

Conversation

wangyang0616
Copy link
Member

@wangyang0616 wangyang0616 commented Oct 13, 2022

Signed-off-by: wangyang wangyang289@huawei.com

/kind feature #2510

  1. Volcano adapts to the k8s v1.25
  2. After Volcano is upgraded to K8S V1.25, the volumebinding package is imported to Volcano to ensure that csiStorageCapacity is compatible with K8S v1.23, v1.21, and v1.19. Use the csiStorageCapacity API of the v1beta1 version in the volumebinding package and do not upgrade the v1 version.

@volcano-sh-bot volcano-sh-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Oct 13, 2022
@volcano-sh-bot
Copy link
Contributor

@wangyang0616: The label(s) kind/[#2510](https://github.com/volcano-sh/volcano/issues/2510) cannot be applied. These labels are supported: ``

In response to this:

Signed-off-by: wangyang wangyang289@huawei.com

/kind feature #2510

Volcano adapts to the k8s v1.25

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@volcano-sh-bot volcano-sh-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Oct 13, 2022
Copy link
Contributor

@Thor-wl Thor-wl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it nessary to update the volcano.sh/apis with k8s v1.25 first?

@wangyang0616 wangyang0616 force-pushed the feature_support_k8s_v1.25 branch 3 times, most recently from 42d931b to cf1dd30 Compare October 18, 2022 09:14
@wangyang0616
Copy link
Member Author

wangyang0616 commented Oct 18, 2022

Is it nessary to update the volcano.sh/apis with k8s v1.25 first?

It is true that API changes should be incorporated first.
The API has been incorporated. The volcano.sh/api version is referenced in the current PR.

volcano.sh/apis adapts to K8S V1.25 volcano-sh/apis#93

@wangyang0616 wangyang0616 marked this pull request as ready for review October 18, 2022 11:37
@volcano-sh-bot volcano-sh-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 18, 2022
@wangyang0616 wangyang0616 force-pushed the feature_support_k8s_v1.25 branch 3 times, most recently from 54e727b to d390372 Compare October 19, 2022 01:07
@volcano-sh-bot
Copy link
Contributor

@wangyang0616: The label(s) kind/[#2510](https://github.com/volcano-sh/volcano/issues/2510) cannot be applied. These labels are supported: ``

In response to this:

Signed-off-by: wangyang wangyang289@huawei.com

/kind feature #2510

  1. Volcano adapts to the k8s v1.25
  2. After Volcano is upgraded to K8S V1.25, the volumebinding package is imported to Volcano to ensure that csiStorageCapacity is compatible with K8S v1.23, v1.21, and v1.19. Use the csiStorageCapacity API of the v1beta1 version in the volumebinding package and do not upgrade the v1 version.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@@ -22,6 +22,7 @@ import (
"fmt"
"sync"
"time"
"volcano.sh/volcano/cmd/scheduler/app/options"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to move package volcano.sh/volcano/cmd/scheduler/app/options behind k8s.io

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In K8S V1.25, the EnableCSIStorageCapacity feature in the k8s.io/kubernetes/pkg/scheduler/framework/plugins/feature package is removed and cannot be used.

After the Volcano adapts to K8S V1.25, to ensure compatibility of earlier versions (K8S V1.21 and V1.23), the Volcano internal feature switch options.ServerOpts.EnableCSIStorage is still used, that is, volcano.sh/volcano/cmd/scheduler/app/options is introduced.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess its meaning go fmt is needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i guess its meaning go fmt is needed.

Thank you. I misunderstood.
It's been revised.

@@ -25,6 +25,7 @@ import (

v1 "k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
storagev1beta1 "k8s.io/api/storage/v1beta1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both v1 and v1beta1 is reserved in references, would they disturbe each other?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usage of k8s v1.23 is still used, and no conflict occurs. CSIStorageCapacity uses v1beta1 and other storage interfaces use v1. Ensure the forward compatibility after the Volcano is upgraded to K8S V1.25 (for example, K8S V1.23 and V1.21).

@@ -227,7 +231,7 @@ func NewVolumeBinder(
pvcInformer coreinformers.PersistentVolumeClaimInformer,
pvInformer coreinformers.PersistentVolumeInformer,
storageClassInformer storageinformers.StorageClassInformer,
capacityCheck CapacityCheck,
capacityCheck *CapacityCheck,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does capacityCheck is modified to pointer?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does capacityCheck is modified to pointer?

The Volcano uses the feature switch (options.ServerOpts.EnableCSIStorage) to control the use of the CSIStorageCapacity function. For details, see the implementation of K8S V1.23. The value of CapacityCheck is changed back to the pointer type.

If the CSIStorageCapacity function is not enabled, the pointer is null. The informer is not initialized when the CSIStorageCapacity function is enabled. After the CSIStorageCapacity function is enabled, the external invoker can assign a value to the CapacityCheck pointer. The informer is initialized when the CSIStorageCapacity function is enabled.

@@ -87,7 +87,7 @@ func Run(opt *options.ServerOption) error {
// add a uniquifier so that two processes on the same host don't accidentally both become active
id := hostname + "_" + string(uuid.NewUUID())

rl, err := resourcelock.New(resourcelock.ConfigMapsResourceLock,
rl, err := resourcelock.New(resourcelock.ConfigMapsLeasesResourceLock,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why locktype is changed from configmaps to configmapsleases?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In K8S V1.25, configMapsResourceLock is removed and replaced by ConfigMapsLeasesResourceLock.

@wangyang0616
Copy link
Member Author

Is it nessary to update the volcano.sh/apis with k8s v1.25 first?

The volcano.sh/apis referenced by the current backbone can still use the APIs of K8S V1.23. When version 1.7.0 is released, volcano.sh/apis will be upgraded to K8S V1.25.

volcano.sh/apis adapts to K8S V1.25 volcano-sh/apis#93

#2533 (comment)

It is true that API changes should be incorporated first.
The API has been incorporated. The volcano.sh/api version is referenced in the current PR.

@jiangkaihua
Copy link
Contributor

/lgtm

@volcano-sh-bot
Copy link
Contributor

@jiangkaihua: changing LGTM is restricted to collaborators

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: wangyang <wangyang289@huawei.com>
…rsions.

Signed-off-by: wangyang <wangyang289@huawei.com>
podAffinityFilter := plugin.(*interpodaffinity.InterPodAffinity)
// 6. NodeVolumeLimits
features := feature.Features{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does feature struct contain a lot of sub-feature?

Copy link
Member Author

@wangyang0616 wangyang0616 Oct 29, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy that.
Feature.Features{} needs to be initialized and assigned with a value.

Modified.

@@ -398,7 +398,8 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
}

// InterPodAffinity Predicate
status = podAffinityFilter.PreFilter(context.TODO(), state, task.Pod)
// TODO use framework.PreFilterResult
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to add some thing more here? if not, please delete useless codes or comments.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy that. Modified.

@@ -415,7 +416,8 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
}

// Check VolumeBinding: handle immediate claims unbounded case
status = volumebindingFilter.PreFilter(context.TODO(), state, task.Pod)
// TODO use framework.PreFilterResult
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same with above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy that. Modified.

@@ -433,7 +435,8 @@ func (pp *predicatesPlugin) OnSessionOpen(ssn *framework.Session) {
}

// Check PodTopologySpread
status = podTopologySpreadFilter.PreFilter(context.TODO(), state, task.Pod)
// TODO use framework.PreFilterResult
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The save as above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy that. Modified.

@@ -50,7 +50,7 @@ import (
"k8s.io/client-go/util/workqueue"
"k8s.io/klog"
podutil "k8s.io/kubernetes/pkg/api/v1/pod"
volumescheduling "k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
volumescheduling "volcano.sh/volcano/pkg/scheduler/plugins/volumebinding"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cache should not depend plugin

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest add capabilities directory like pkg/scheduler/capabilities/volumebinding and put our volumebinding there

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy that. Modified.

EnableReadWriteOncePod: utilFeature.DefaultFeatureGate.Enabled(features.ReadWriteOncePod),
EnableVolumeCapacityPriority: utilFeature.DefaultFeatureGate.Enabled(features.VolumeCapacityPriority),
EnableCSIStorageCapacity: utilFeature.DefaultFeatureGate.Enabled(features.CSIStorageCapacity),
EnableReadWriteOncePod: utilFeature.DefaultFeatureGate.Enabled(features.ReadWriteOncePod),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EnablePodDisruptionBudget is removed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PodDisruptionBudget feature has passed GA. The EnablePodDisruptionBudget feature is removed in 1.25.

@@ -362,7 +361,7 @@ func (pp *nodeOrderPlugin) OnSessionOpen(ssn *framework.Session) {
ssn.AddNodeOrderFn(pp.Name(), nodeOrderFn)

plArgs := &config.InterPodAffinityArgs{}
p, _ = interpodaffinity.New(plArgs, handle, fts)
p, _ = interpodaffinity.New(plArgs, handle)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason of deleting fts for interpodaffinity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PodAffinityNamespaceSelector is GA in V1.24. The switch for this feature is deleted.

In this case, the fst parameter is not transferred when the PodAffinityNamespaceSelector is new.

@@ -371,7 +370,7 @@ func (pp *nodeOrderPlugin) OnSessionOpen(ssn *framework.Session) {
ptsArgs := &config.PodTopologySpreadArgs{
DefaultingType: config.SystemDefaulting,
}
p, _ = podtopologyspread.New(ptsArgs, handle)
p, _ = podtopologyspread.New(ptsArgs, handle, fts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's the reason of adding fts to podtopologyspread?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In K8S V1.25, the alpha and beta feature switches related to TopologySpread are added, for example, EnableMinDomainsInPodTopologySpread, EnableNodeInclusionPolicyInPodTopologySpread, EnableMatchLabelKeysInPodTopologySpread.

@wangyang0616 wangyang0616 force-pushed the feature_support_k8s_v1.25 branch 5 times, most recently from 4ef6e8d to b8dbeb1 Compare October 29, 2022 02:18
…che on the plugin.

Signed-off-by: wangyang <wangyang289@huawei.com>
Copy link
Member

@william-wang william-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@volcano-sh-bot volcano-sh-bot added the lgtm Indicates that a PR is ready to be merged. label Oct 31, 2022
@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: william-wang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@volcano-sh-bot volcano-sh-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 31, 2022
@volcano-sh-bot volcano-sh-bot merged commit c7d87c7 into volcano-sh:master Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants