operator-framework / operator-framework/java-operator-sdk

[Feature Request/Question] Controller watch namespaces based on labels (and event sources)

Open
#2,434 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
944
Forks
242
Avg merge
1d 4h
Merged PRs (30d)
43

Description

Description

Based on the documentation, the controller is able to dynamically adjust the watched namespaces based on explicit namespace names (often provided through a config map or similar). A convenient extension to this would be able to watch namespaces based on the labels/annotations for a given namespace. I would be helpful if this was built into the machinery of the controller itself, so it could be controlled by some high level configuration

Motivation

Sometimes the creation of new namespaces that need to interact (be watched by) with the operator are done through workflows outside of the purview of the "operator admin". Currently, in order to ensure coverage of all namespaces, either (1) both workflows need to interact and inform the operator deployment when namespaces are added, or (2) the operator simply needs to watch all namespaces. This is where a third option, of only coordinating the appropriate labels would be beneficial

(Somewhat) Related Projects

https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/master/docs/user-guide/concepts.md

Workarounds considered

Use the Kubernetes client itself to query for namespaces upon controller start, periodically poll for changes. Similarly, try to use some form of an Informer to get the same information

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the controller's existing explicit namespace configuration and event-source handling, then review the Kubernetes client and informer approaches mentioned in the issue. Clarify label and annotation selection, high-level configuration, and behavior when matching namespaces are created; done means the controller watches the selected namespaces without requiring workflow coordination or watching all namespaces.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kubernetes
Domain
infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.