• Kubernetes Submit Queue's avatar
    Merge pull request #67556 from msau42/fix-assume · 2fdd328d
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue (batch tested with PRs 67709, 67556). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.
    
    Fix volume scheduling issue with pod affinity and anti-affinity
    
    **What this PR does / why we need it**:
    The previous design of the volume scheduler had volume assume + bind done before pod assume + bind.  This causes issues when trying to evaluate future pods with pod affinity/anti-affinity because the pod has not been assumed while the volumes have been decided.
    
    This PR changes the design so that volume and pod are assumed first, followed by volume and pod binding.  Volume binding waits (asynchronously) for the operations to complete or error. This eliminates the subsequent passes through the scheduler to wait for volume binding to complete (although pod events or resyncs may still cause the pod to run through scheduling while binding is still in progress).   This design also aligns better with the scheduler framework design, so will make it easier to migrate in the future.
    
    Many changes had to be made in the volume scheduler to handle this new design, mostly around:
    * How we cache pending binding operations.  Now, any delayed binding PVC that is not fully bound must have a cached binding operation.  This also means bind API updates may be repeated.
    * Waiting for the bind operation to fully complete, and detecting failure conditions to abort the bind and retry scheduling.
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    Fixes #65131
    
    **Special notes for your reviewer**:
    
    **Release note**:
    
    ```release-note
    Fixes issue where pod scheduling may fail when using local PVs and pod affinity and anti-affinity without the default StatefulSet OrderedReady pod management policy
    ```
    2fdd328d
Name
Last commit
Last update
..
apis/config Loading commit data...
bootstrap Loading commit data...
certificates Loading commit data...
cloud Loading commit data...
clusterroleaggregation Loading commit data...
cronjob Loading commit data...
daemon Loading commit data...
deployment Loading commit data...
disruption Loading commit data...
endpoint Loading commit data...
garbagecollector Loading commit data...
history Loading commit data...
job Loading commit data...
namespace Loading commit data...
nodeipam Loading commit data...
nodelifecycle Loading commit data...
podautoscaler Loading commit data...
podgc Loading commit data...
replicaset Loading commit data...
replication Loading commit data...
resourcequota Loading commit data...
route Loading commit data...
service Loading commit data...
serviceaccount Loading commit data...
statefulset Loading commit data...
testutil Loading commit data...
ttl Loading commit data...
ttlafterfinished Loading commit data...
util/node Loading commit data...
volume Loading commit data...
.import-restrictions Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
client_builder.go Loading commit data...
controller_ref_manager.go Loading commit data...
controller_ref_manager_test.go Loading commit data...
controller_utils.go Loading commit data...
controller_utils_test.go Loading commit data...
doc.go Loading commit data...
lookup_cache.go Loading commit data...