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

Enhancement suggestion: Ability to select labels #321

Open
SantoFantasy opened this issue Aug 1, 2023 · 6 comments
Open

Enhancement suggestion: Ability to select labels #321

SantoFantasy opened this issue Aug 1, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@SantoFantasy
Copy link

Suggestion: ability to select by label folowing this example:

apiVersion: kube-green.com/v1alpha1
kind: SleepInfo
metadata:
  name: working-hours
spec:
  weekdays: "1-5"
  sleepAt: "23:0"
  wakeUpAt: "07:00"
  suspendDeployments: true
  suspendCronJobs: false
  selector:
    matchLabels:
      app: my-app

Reasoning: When using the current configuration, the behavior is to put the entire cluster to sleep and we select the apps that we don't want to be shut down with the excludeRef. With a label selector, it's possible to fine tune more easily wich deployments are put to sleep, enabling easy adoption on large scale clusters and ensuring nothing critical is being turned off.

@SantoFantasy SantoFantasy changed the title Ability to select labels Enhancement suggestion: Ability to select labels Aug 1, 2023
@davidebianchi
Copy link
Member

Hi @SantoFantasy! I think it's a good idea, so an allow list of labels to sleep? This configuration should be cluster wide? Probably it could be more useful. Something like the CRD proposed here.

At the moment, we support the match label selector only in the excludeRef: https://kube-green.dev/docs/apireference_v1alpha1/#kube-green.com/v1alpha1.ExcludeRef

@SantoFantasy
Copy link
Author

Hi
Yes, an allow/include list, keeping the current behaviour (namespace wide) for the SleepInfo. The #167 CRD proposal would also benefit from an allow list like this one.

Sadly, the excludeRef is not a viable option for my case.

@Valefoth
Copy link

Hi, I think an includeRef would be a good way to specify only some resources for sleep hours.

includeRef:
 - matchLabels: 
   kube-green.dev/include: true

What do you think of that ?

@davidebianchi
Copy link
Member

Yes, I think it would be interesting to add to the spec!

@k11h-de
Copy link
Contributor

k11h-de commented Jun 17, 2024

I would love to see this feature / enhancement.

@davidebianchi davidebianchi added the enhancement New feature or request label Jun 17, 2024
@davidebianchi
Copy link
Member

There is the #445 which add the includeRef option!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants