Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dcbw
Copy link
Contributor

@dcbw dcbw commented Jun 24, 2021

Ongoing sandbox requests cannot be (or are not) canceled by kubelet, leading to a situation where short-lived pods (especially Kubernetes e2e tests for stateful sets) cause overlapping sandbox requests. If the CNI plugin needs to wait for network state to converge, it's pointless to wait for a sandbox who's pod has been deleted so the plugin should cancel the request and return to the runtime. However, it's impossible to do that race-free without the pod UID the sandbox was created for, since the there is a gap between when kubelet requests the sandbox creation and when the plugin gets the pod object from the apiserver when the pod could have been deleted and recreated, and the CNI plugin would retrieve information for the new pod, not the pod the sandbox was created for.

Passing the pod UID to the plugin allows the plugin to cancel the operation when the pod UID retrieved from the apiserver during plugin operation does not match the one the sandbox was created for.

@trozet @haircommander @mrunalp

Cherry-pick of #5026

/kind feature

CNI plugins are now passed a K8S_POD_UID environment variable containing the pod UID this sandbox was started for.

dcbw added 2 commits June 23, 2021 20:01
To allow passing pod UID to plugins.

Signed-off-by: Dan Williams <[email protected]>
(cherry picked from commit 860edbe)
This allows plugins to more correctly cancel long-running sandbox
operations when the pod is deleted/re-created in the Kube API
while the call is ongoing.

Signed-off-by: Dan Williams <[email protected]>
(cherry picked from commit 6e8d370)
(cherry picked from commit c512346)
@dcbw dcbw requested review from mrunalp and runcom as code owners June 24, 2021 01:03
@openshift-ci openshift-ci bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 24, 2021
@openshift-ci openshift-ci bot requested a review from saschagrunert June 24, 2021 01:03
@codecov
Copy link

codecov bot commented Jun 24, 2021

Codecov Report

Merging #5029 (b594596) into release-1.20 (baade70) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@              Coverage Diff              @@
##           release-1.20    #5029   +/-   ##
=============================================
  Coverage         41.21%   41.22%           
=============================================
  Files               117      117           
  Lines              9489     9490    +1     
=============================================
+ Hits               3911     3912    +1     
  Misses             5126     5126           
  Partials            452      452           

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 24, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dcbw, saschagrunert

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

The pull request process is described here

Details 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 24, 2021
@haircommander
Copy link
Member

/test e2e-aws
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jun 24, 2021
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link

/retest

Please review the full test history for this PR and help us cut down flakes.

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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants