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

Add support of more resources #77

Closed
3 tasks
davidebianchi opened this issue Dec 7, 2021 · 15 comments · Fixed by #363
Closed
3 tasks

Add support of more resources #77

davidebianchi opened this issue Dec 7, 2021 · 15 comments · Fixed by #363
Assignees
Labels
enhancement New feature or request question Further information is requested
Milestone

Comments

@davidebianchi
Copy link
Member

davidebianchi commented Dec 7, 2021

What type of resources should be handled by kube-green?

  • traefik ingress route
  • Replica Sets
  • StatefulSet
@davidebianchi davidebianchi added enhancement New feature or request question Further information is requested labels Dec 7, 2021
@ctienshi
Copy link

Is it possible to use Kube-green with replica sets, daemon sets etc so the nodes could scale down to zero?

@jwcesign
Copy link

jwcesign commented Oct 25, 2022

Can we also delete node and restore it for some public cloud, like gcp? cc @davidebianchi

@davidebianchi
Copy link
Member Author

Is it possible to use Kube-green with replica sets, daemon sets etc so the nodes could scale down to zero?

For replica sets yes, we could add the support. For the daemon, there will be one per node so I don't think it's ok to remove programmatically. If the cluster autoscaler is enabled, the node should downscale automatically. If it is not, you should modify the deamon accordingly. If you have any problem about this, you can see this docs to troubleshooting the nodes downscaling

Can we also delete node and restore it for some public cloud, like gcp?

Yes, it is possible to do it with the node autoscaler on gcp. The previous link could help you?

@jgerber-sbb
Copy link

@djmcgreal-cc
Copy link

+StatefulSets? I'd like to make a PR or so, but want to gauge whether it's already been thought of but there's a more fundamental difficulty in the way?

I'd like to deploy this to our pre-production clusters but in our case, there's not much point unless we can take the node down.
Thanks for this!

@djmcgreal-cc
Copy link

And possibly a some support for arbitrary configuration for CRDs in the SleepInfo, like a selector and strategic/merge/json patch?

@davidebianchi
Copy link
Member Author

davidebianchi commented Jan 14, 2023

Hi @djmcgreal-cc! Sure, we could add the StatefulSets. I haven't looked yet for this resource in the detail, but it has the replicas configuration if I well remember, so I suppose it could be add easily.
Do you have some nodes with only some StatefulSets?

And possibly a some support for arbitrary configuration for CRDs in the SleepInfo, like a selector and strategic/merge/json patch?

What do you mean with arbitrary configuration? Can you add more details on the expected use case or some more description on what can be done?
Maybe a generic way to describe which resource should be managed and what are the changes which should be done to disable the specific resource?

@djmcgreal
Copy link

Precisely. So that the project doesn’t need to track all CRDs in the ecosystem

@potitoaghilar
Copy link

Hi @djmcgreal-cc! Sure, we could add the StatefulSets. I haven't looked yet for this resource in the detail, but it has the replicas configuration if I well remember, so I suppose it could be add easily. Do you have some nodes with only some StatefulSets?

And possibly a some support for arbitrary configuration for CRDs in the SleepInfo, like a selector and strategic/merge/json patch?

What do you mean with arbitrary configuration? Can you add more details on the expected use case or some more description on what can be done? Maybe a generic way to describe which resource should be managed and what are the changes which should be done to disable the specific resource?

We are also interested in StatefulSet scaling to zero. In our case we have StatefulSets and Deployments on same node.

@bygui86
Copy link

bygui86 commented Apr 21, 2023

Maybe it could be useful a catalog of CRDs...
https://github.com/datreeio/CRDs-catalog

@davidebianchi
Copy link
Member Author

Hi all, I'm thinking about something like json patch to try to generalize the support on various resources.
So, something like:

  patchesJson6902:
    - target:
        version: "apps/v1"
        kind: Deployment
        # labelSelector: "env=dev"
      patch:
        key: "#/spec/replicas"
        value: 0
    - target:
        apiVersion: "batch/v1"
        kind: CronJob
      patch:
        key: "#/spec/suspend"
        value: true

In this way, we could also add some first class resources (like deployment and cronjobs) which are supported by default, and the user could also add the patch for a custom CRD which want to manage.
What do you think about? Any hint on this?

@djmcgreal-cc
Copy link

Sounds totally sensible to me

@jgpelaez
Copy link

@davidebianchi It totally makes sense the approach for doing it agnostic to the CRD, as for example there will be some operator that can have in a CRD the number of replicas that manages later a deployment or statefulset

@davidebianchi davidebianchi linked a pull request Nov 8, 2023 that will close this issue
@davidebianchi
Copy link
Member Author

I created a PR to make a POC of this configuration (which I partially changed). The POC seems effective, the next step is to make it working e2e and start testing with some new configurations. Feedback are as always welcome! 😄

@davidebianchi
Copy link
Member Author

Support of all resources is now released in v0.6.0-rc.1 and it is possible to test.
The support of StatefulSet by default is added in the same version by #425

Close this, it will be released in stable version in v0.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
Development

Successfully merging a pull request may close this issue.

9 participants