Skip to content

Commit

Permalink
- sleep mode
Browse files Browse the repository at this point in the history
Signed-off-by: Weijie <[email protected]>
  • Loading branch information
ovaldi committed Dec 29, 2021
1 parent 2f20671 commit d1d65ae
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 0 deletions.
50 changes: 50 additions & 0 deletions docs/guides/sleep-mode.md
Original file line number Diff line number Diff line change
@@ -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.
<figure className="img-frame">
<img className="gif-img" src={useBaseUrl('/img/sleep/custom.png')} />
</figure>

* Manually trigger sleep/wakeup in the `DevSpace` management page.
<figure className="img-frame">
<img className="gif-img" src={useBaseUrl('/img/sleep/dashboard.png')} />
</figure>

* Manually trigger sleep/wakeup in the JetBrains Plugin / VSCode Plugin.
<figure className="img-frame">
<img className="gif-img" src={useBaseUrl('/img/sleep/jetbrains.png')} />
</figure>

## 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 that day.
- `DevSpace` that are manually wakeup by the user will not automatically sleep that day.
- When the user clears all sleep settings, the `DevSpace` that has gone to sleep will wake up automatically.
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ module.exports = {
'guides/remote-run',
// Hot Reload
'guides/hot-reload',
'guides/sleep-mode',
// 'guides/clear-pvc',
]
},
Expand Down
Binary file added static/img/sleep/custom.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/sleep/dashboard.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/img/sleep/jetbrains.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d1d65ae

Please sign in to comment.