Enhanced Sleep Scheduling – Enable/Disable, StatefulSets, CronJobs, and On-Demand Support#1
Enhanced Sleep Scheduling – Enable/Disable, StatefulSets, CronJobs, and On-Demand Support#1to4kin wants to merge 62 commits into
Conversation
|
Hey @to4kin - Thanks for the contribution! Look like you've added some really great features! |
|
Hi @col No problem. We actually spent a couple of days to find a good tool to scale our dp/sts/cj on non-prod clusters. And your tool is closer to our needs. So we decided to fork it and add some cool features :) I also updated workflow to be able to try a new version, so if you want to keep yours, that's fine with me. PR is in draft because we are still testing and will probably add some more improvements :) |
|
If you're still adding features it would be great if you could split them into different branches / PRs. It's pretty hard to manage such a large PR with multiple features particularly if I decide not to merge everything you've done. |
There was a problem hiding this comment.
Pull Request Overview
This pull request significantly extends the sleep scheduling capabilities of Drowzee by introducing an enable/disable toggle, on-demand schedules, and support for additional resource types (StatefulSets and CronJobs) along with various UI/UX and backend improvements.
- CRD schema improvements including a new boolean field for enabling schedules and support for sleep-only schedules
- Added functionality to manage StatefulSets and CronJobs in addition to Deployments
- Enhanced controller logic, logging, and CI/CD improvements for better reliability and performance
Reviewed Changes
Copilot reviewed 30 out of 30 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| lib/drowzee/k8s/statefuleset.ex | Introduces StatefulSet support (note file naming may be inconsistent) |
| lib/drowzee/k8s/sleep_schedule.ex | Adds functions to handle StatefulSets and CronJobs for sleep schedules |
| lib/drowzee/k8s/deployment.ex | Refactors deployment handling with improved logging and replica management |
| lib/drowzee/k8s/cronjob.ex | Implements CronJob suspension/resumption functionality |
| lib/drowzee/k8s.ex | Adds helper functions to fetch StatefulSets and CronJobs |
| lib/drowzee/controllers/sleep_schedule_controller.ex | Updates controller logic to account for the enabled state and new resource types |
| lib/drowzee/config.ex | Improves namespace handling for cluster-wide configurations |
| config/config.exs | Updates logging metadata for clearer observability |
| chart/* | Updates CRD schema and Helm chart configuration for new features |
| .github/* | Adds CI/CD workflows, pull request template, and dependency configurations for improved project maintenance |
Comments suppressed due to low confidence (2)
lib/drowzee/k8s/statefuleset.ex:1
- The file name 'statefuleset.ex' appears to have a typo; consider renaming it to 'statefulset.ex' to align with the module name and maintain consistency.
defmodule Drowzee.K8s.StatefulSet do
chart/Chart.yaml:24
- The appVersion has been decreased from '0.1.8' to '0.1.0', which may be unintended and could lead to versioning confusion; please verify the correct version number.
appVersion: "0.1.0"
|
Got it. We're actually done for now. We will continue testing and will probably only add bug fixes. New features will be added with the new PR |
This PR significantly extends the sleep scheduling capabilities of Drowzee. It introduces robust enable/disable toggling, adds full support for statefulsets and cronjobs, and allows for "on-demand" schedules where only sleepTime is set (no wakeTime), suitable for permanent or manual wake scenarios.
Key Features & Changes
Lazy Loading of Resource Status:
UI Adjustments:
Code Structure:
Innovative UI Design:
Enhanced User Experience:
Responsive Implementation:
Bug Fixes
Issue Resolution:
BONNY_POD_NAMESPACE="__ALL__"for cluster-wide monitoring.String.split(:all, ",", [])that occurred becauseBonny.Config.namespace()returns the atom:allinstead of a string.Migration & Compatibility
CRD Upgrade Required
After merging, run:
to ensure the cluster uses the new schema.
Testing
Manual and automated tests confirm correct behavior for:
Reviewer Notes
Please review the CRD changes, controller logic, and UI for any edge cases.
Special attention to on-demand schedule handling and resource type coverage (deployments, statefulsets, cronjobs).