Skip to content

Commit d1d65ae

Browse files
committed
- sleep mode
Signed-off-by: Weijie <[email protected]>
1 parent 2f20671 commit d1d65ae

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed

docs/guides/sleep-mode.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import useBaseUrl from '@docusaurus/useBaseUrl';
2+
3+
# Sleep Mode
4+
5+
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.
6+
7+
## What workloads support sleep?
8+
9+
* `StatefulSet`
10+
* `Deployment`
11+
* `CronJob`
12+
13+
## How to sleep/wakeup?
14+
15+
You can trigger sleep/wakeup in three different ways.
16+
17+
* Customize the sleep time period in the `DevSpace` management page, the `DevSpace` will automatically sleep/wakeup.
18+
<figure className="img-frame">
19+
<img className="gif-img" src={useBaseUrl('/img/sleep/custom.png')} />
20+
</figure>
21+
22+
* Manually trigger sleep/wakeup in the `DevSpace` management page.
23+
<figure className="img-frame">
24+
<img className="gif-img" src={useBaseUrl('/img/sleep/dashboard.png')} />
25+
</figure>
26+
27+
* Manually trigger sleep/wakeup in the JetBrains Plugin / VSCode Plugin.
28+
<figure className="img-frame">
29+
<img className="gif-img" src={useBaseUrl('/img/sleep/jetbrains.png')} />
30+
</figure>
31+
32+
## How does `sleep` works?
33+
34+
- `StatefulSet`: set `spec.replicas: 0`
35+
- `Deployment`: set `spec.replicas: 0`
36+
- `CronJob`: set `spec.suspend: true`
37+
38+
## How does `wakeup` works?
39+
40+
- `StatefulSet`: restore `spec.replicas`
41+
- `Deployment`: restore `spec.replicas`
42+
- `CronJob`: set `spec.suspend: false`
43+
44+
## Notes
45+
46+
- By default, `Nocalhost` performs a round of sleep checks every `10s`.
47+
- Workloads that are already in `DevMode` will be ignored and will not be sleep.
48+
- `DevSpace` that are manually sleep by the user will not automatically wakeup that day.
49+
- `DevSpace` that are manually wakeup by the user will not automatically sleep that day.
50+
- When the user clears all sleep settings, the `DevSpace` that has gone to sleep will wake up automatically.

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ module.exports = {
6969
'guides/remote-run',
7070
// Hot Reload
7171
'guides/hot-reload',
72+
'guides/sleep-mode',
7273
// 'guides/clear-pvc',
7374
]
7475
},

static/img/sleep/custom.png

178 KB
Loading

static/img/sleep/dashboard.png

183 KB
Loading

static/img/sleep/jetbrains.png

120 KB
Loading

0 commit comments

Comments
 (0)