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

[release-1.21] network: pass pod UID to ocicni when performing network operations #5028

Merged

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 19:44
To allow passing pod UID to plugins.

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

codecov bot commented Jun 24, 2021

Codecov Report

Merging #5028 (39efb80) into release-1.21 (d3e59a4) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 39efb80 differs from pull request most recent head c512346. Consider uploading reports for the commit c512346 to get more accurate results

@@              Coverage Diff              @@
##           release-1.21    #5028   +/-   ##
=============================================
  Coverage         43.26%   43.27%           
=============================================
  Files               107      107           
  Lines              9839     9840    +1     
=============================================
+ Hits               4257     4258    +1     
  Misses             5128     5128           
  Partials            454      454           

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 24, 2021

@dcbw: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 c512346 link /test e2e_cgroupv2

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@haircommander
Copy link
Member

/test e2e_rhel
/lgtm

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

dcbw commented Jun 24, 2021

@saschagrunert you approved the 1.22 and 1.20 backports, I assume this one for 1.21 is OK too? :) Thanks!

@haircommander
Copy link
Member

/approve
yeah I assume it's okay with him :)

@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, haircommander

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

@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
@openshift-merge-robot openshift-merge-robot merged commit 30ca719 into cri-o:release-1.21 Jun 24, 2021
@openshift-ci openshift-ci bot mentioned this pull request Mar 15, 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. 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.

None yet

3 participants