Skip to content

How to Use Field Selectors with Controller-Runtime to Filter CRD Events on Api-Server side? #3000

@jimmyyuhao

Description

@jimmyyuhao

Body:
Hello,

I am working with the controller-runtime package in Kubernetes and I need to implement a functionality where the API server only notifies my controller about specific Custom Resource Definitions (CRDs). Specifically, I want to filter events so that I only receive notifications for CRDs where metadata.name is equal to a specific value, such as nodeName.

I would like to know:

How can I configure the manager initialization to achieve this?
Is there a way to set up a field selector to filter these events at the API server level?
If direct support for field selectors is not available, what would be the best approach to implement this functionality in my controller?
Any guidance or examples would be greatly appreciated!

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions