diff --git a/docs/guides/sleep-mode.md b/docs/guides/sleep-mode.md new file mode 100644 index 000000000..cc5cab150 --- /dev/null +++ b/docs/guides/sleep-mode.md @@ -0,0 +1,50 @@ +import useBaseUrl from '@docusaurus/useBaseUrl'; + +# Sleep Mode + +Sleep mode is the act of scaling the replicas of a workload to 0 within a specified time. With sleep mode, you can put the DevSpace to sleep which means that Kubernetes will delete all pods but the entire configuration within the DevSpace is still there. + +## What workloads support sleep? + +* `StatefulSet` +* `Deployment` +* `CronJob` + +## How to sleep/wakeup? + +You can trigger sleep/wakeup in three different ways. + +* Customize the sleep time period in the `DevSpace` management page, the `DevSpace` will automatically sleep/wakeup. +
+ +
+ +* Manually trigger sleep/wakeup in the `DevSpace` management page. +
+ +
+ +* Manually trigger sleep/wakeup in the JetBrains Plugin / VSCode Plugin. +
+ +
+ +## How does `sleep` works? + +- `StatefulSet`: set `spec.replicas: 0` +- `Deployment`: set `spec.replicas: 0` +- `CronJob`: set `spec.suspend: true` + +## How does `wakeup` works? + +- `StatefulSet`: restore `spec.replicas` +- `Deployment`: restore `spec.replicas` +- `CronJob`: set `spec.suspend: false` + +## Notes + +- By default, `Nocalhost` performs a round of sleep checks every `10s`. +- Workloads that are already in `DevMode` will be ignored and will not be sleep. +- `DevSpace` that are manually sleep by the user will not automatically wakeup on the same day. +- `DevSpace` that are manually wakeup by the user will not automatically sleep on the same day. +- When the user clears all sleep settings, the `DevSpace` that has gone to sleep will wake up automatically. diff --git a/sidebars.js b/sidebars.js index 46badfdc8..d0c3079e3 100644 --- a/sidebars.js +++ b/sidebars.js @@ -69,6 +69,7 @@ module.exports = { 'guides/remote-run', // Hot Reload 'guides/hot-reload', + 'guides/sleep-mode', // 'guides/clear-pvc', ] }, diff --git a/static/img/sleep/custom.png b/static/img/sleep/custom.png new file mode 100644 index 000000000..30b73ec42 Binary files /dev/null and b/static/img/sleep/custom.png differ diff --git a/static/img/sleep/dashboard.png b/static/img/sleep/dashboard.png new file mode 100644 index 000000000..7a165c073 Binary files /dev/null and b/static/img/sleep/dashboard.png differ diff --git a/static/img/sleep/jetbrains.png b/static/img/sleep/jetbrains.png new file mode 100644 index 000000000..2085e47aa Binary files /dev/null and b/static/img/sleep/jetbrains.png differ