Skip to content

Add support for bookmark events #1729

Description

@cansjt

What is the feature and why do you need it:

In kubernetes-client/python-base#234 the parsing of BOOKMARK events has been bypassed (and still is as of today). But those events exist for a reason and can be useful in some circumstances. A motivational example is this Airflow issue: apache/airflow#21087.

As Airflows scheduler can be stopped and restarted, while many events occur on k8s, it would need to process BOOKMARK to recover its state. Sadly because those are ignored by the Python client, it cannot. Which manifests itself in varied ways (see the different issues referenced in the ticket above)

Describe the solution you'd like to see:

We'd like for the bookmark event to be parsed and yield by the watcher, so it is possible for clients to consume them.

(copied from kubernetes-client/python-base#286)

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    on Feb 28, 2022
  2. roycaihw commented on Mar 28, 2022

    @roycaihw
    Member

    Agreed this is nice to have.

    /help

  3. k8s-ci-robot commented on Mar 28, 2022

    @k8s-ci-robot
    Contributor

    @roycaihw:
    This request has been marked as needing help from a contributor.

    Guidelines

    Please ensure that the issue body includes answers to the following questions:

    • Why are we solving this issue?
    • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
    • Does this issue have zero to low barrier of entry?
    • How can the assignee reach out to you for help?

    For more details on the requirements of such an issue, please see here and ensure that they are met.

    If this request no longer meets these requirements, the label can be removed
    by commenting with the /remove-help command.

    Details

    In response to this:

    Agreed this is nice to have.

    /help

    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.

  4. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Mar 28, 2022
  5. snjypl commented on May 8, 2022

    @snjypl

    @cansjt thanks for reporting this. i would like to make few comments:

    What is the feature and why do you need it:

    In kubernetes-client/python-base#234 the parsing of BOOKMARK events has been bypassed (and still is as of today). But those events exist for a reason and can be useful in some circumstances. A motivational example is this Airflow issue: apache/airflow#21087.

    The parsing of the BOOKMARK event is not actually by passed. we just dont de-serialize the BOOKMARK event to the return_type eg: 'V1POD' etc. the bookmark event as a dict is still returned by the watcher to the client.

    de serializing the event to the V1POD type etc is not easy because BOOKMARK event does not have all the required fields to do so. eg in case of V1POD, the container is None in BOOKMARK but required to be non empty for V1POD spec.

    since all that really matter in the BOOKMARK event in the resoureVersion, we should be good with a dict object.

    the problem that we have currently is the watcher does not update the resource_version to the one in the BOOKMARK event. which the #1796 should fix.
    once this fix is done, the 410 error won't happen for long duration watch.

    As Airflows scheduler can be stopped and restarted, while many events occur on k8s, it would need to process BOOKMARK to recover its state. Sadly because those are ignored by the Python client, it cannot. Which manifests itself in varied ways (see the different issues referenced in the ticket above)

    The BOOKMARK event is not send by the api server by default. it needs to be requested by the client by setting the allow_watch_bookmarks in the api call. by default it is false. in Airflow kubernetes executor it is not set to True.

    so to take advantage of BOOKMARKS, in airflow we need to make the request with allow_watch_bookmark=true

  6. k8s-triage-robot commented on Aug 6, 2022

    @k8s-triage-robot

    The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

    This bot triages issues and PRs according to the following rules:

    • After 90d of inactivity, lifecycle/stale is applied
    • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
    • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

    You can:

    • Mark this issue or PR as fresh with /remove-lifecycle stale
    • Mark this issue or PR as rotten with /lifecycle rotten
    • Close this issue or PR with /close
    • Offer to help out with Issue Triage

    Please send feedback to sig-contributor-experience at kubernetes/community.

    /lifecycle stale

  7. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Aug 6, 2022
  8. snjypl commented on Aug 7, 2022

    @snjypl

    /remove-lifecycle stale

  9. removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Aug 7, 2022
  10. k8s-triage-robot commented on Nov 5, 2022

    @k8s-triage-robot

    The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

    This bot triages issues and PRs according to the following rules:

    • After 90d of inactivity, lifecycle/stale is applied
    • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
    • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

    You can:

    • Mark this issue or PR as fresh with /remove-lifecycle stale
    • Mark this issue or PR as rotten with /lifecycle rotten
    • Close this issue or PR with /close
    • Offer to help out with Issue Triage

    Please send feedback to sig-contributor-experience at kubernetes/community.

    /lifecycle stale

  11. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Nov 5, 2022
  12. snjypl commented on Nov 12, 2022

    @snjypl

    /remove-lifecycle stale

  13. removed
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale.
    on Nov 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions