openshift / kuryr-kubernetes

kuryr-kubernetes - CNI plugin using OpenStack Neutron and Octavia to provide networking for pods and services.
Apache License 2.0
21 stars 23 forks source link

Bug 1997120: CNI: Watch for deleted pods #657

Closed dulek closed 2 years ago

dulek commented 2 years ago

It can happen that we get the CNI request, but pod gets deleted before kuryr-controller was able to create KuryrPort for it. If kuryr-daemon only watches for KuryrPort events it will not be able to notice that and will wait until the timeout, which in effect doesn't play well with some K8s tests.

This commit adds a separate Service that will watch on Pod events and if Pod gets deleted we'll make sure to put a sentinel value (None) into the registry so that the thread waiting for the KuryrPort to appear there will know that it has to stop and raise an error.

openshift-ci[bot] commented 2 years ago

@dulek: This pull request references Bugzilla bug 1997120, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug * bug is open, matching expected state (open) * bug target release (4.11.0) matches configured target release for branch (4.11.0) * bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (itbrown@redhat.com), skipping review request.

In response to [this](https://github.com/openshift/kuryr-kubernetes/pull/657): >Bug 1997120: CNI: Watch for deleted pods Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci[bot] commented 2 years ago

@dulek: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
MaysaMacedo commented 2 years ago

/lgtm

openshift-ci[bot] commented 2 years ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dulek, MaysaMacedo

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: - ~~[OWNERS](https://github.com/openshift/kuryr-kubernetes/blob/master/OWNERS)~~ [MaysaMacedo,dulek] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci[bot] commented 2 years ago

@dulek: All pull requests linked via external trackers have merged:

Bugzilla bug 1997120 has been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/kuryr-kubernetes/pull/657): >Bug 1997120: CNI: Watch for deleted pods Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 1 year ago

@dulek: Jira Issue OCPBUGS-11828: Some pull requests linked via external trackers have merged:

The following pull requests linked via external trackers have not merged:

These pull request must merge or be unlinked from the Jira bug in order for it to move to the next state. Once unlinked, request a bug refresh with /jira refresh.

Jira Issue OCPBUGS-11828 has not been moved to the MODIFIED state.

In response to [this](https://github.com/openshift/kuryr-kubernetes/pull/657): >It can happen that we get the CNI request, but pod gets deleted before >kuryr-controller was able to create KuryrPort for it. If kuryr-daemon >only watches for KuryrPort events it will not be able to notice that >and will wait until the timeout, which in effect doesn't play well with >some K8s tests. > >This commit adds a separate Service that will watch on Pod events and if >Pod gets deleted we'll make sure to put a sentinel value (None) into the >registry so that the thread waiting for the KuryrPort to appear there >will know that it has to stop and raise an error. Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci[bot] commented 1 year ago

@dulek: Bugzilla bug 1997120 is in an unrecognized state (CLOSED (ERRATA)) and will not be moved to the MODIFIED state.

In response to [this](https://github.com/openshift/kuryr-kubernetes/pull/657): >Bug 1997120: CNI: Watch for deleted pods Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.