-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Weijie <[email protected]>
- Loading branch information
Showing
5 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import useBaseUrl from '@docusaurus/useBaseUrl'; | ||
|
||
# 休眠模式 | ||
|
||
休眠模式是在指定的时间内将工作负载副本数缩为 0 的一种行为,通过休眠模式,您可以让开发空间进入睡眠状态,这意味着 Kubernetes 将删除所有 pods,但开发空间内的资源配置仍然存在。 | ||
|
||
## 支持休眠的工作负载类型 | ||
|
||
* `StatefulSet` | ||
* `Deployment` | ||
* `CronJob` | ||
|
||
## 如何休眠/唤醒? | ||
|
||
您可以通过以下三种不同的方式触发休眠/唤醒: | ||
|
||
* 在 `DevSpace` 管理页面,自定义休眠时间段,符合条件的开发空间将自动触发休眠/唤醒。 | ||
|
||
<figure className="img-frame"> | ||
<img className="gif-img" src={useBaseUrl('/img/sleep/custom.png')} /> | ||
</figure> | ||
|
||
* 在 `DevSpace` 管理页面,手动触发休眠/唤醒。 | ||
<figure className="img-frame"> | ||
<img className="gif-img" src={useBaseUrl('/img/sleep/dashboard.png')} /> | ||
</figure> | ||
|
||
* 在 JetBrains 插件 / VSCode 插件,手动触发休眠/唤醒。 | ||
<figure className="img-frame"> | ||
<img className="gif-img" src={useBaseUrl('/img/sleep/jetbrains.png')} /> | ||
</figure> | ||
|
||
## 休眠原理 | ||
|
||
- `StatefulSet`: 设置 `spec.replicas: 0` | ||
- `Deployment`: 设置 `spec.replicas: 0` | ||
- `CronJob`: 设置 `spec.suspend: true` | ||
|
||
## 唤醒原理 | ||
|
||
- `StatefulSet`: 恢复 `spec.replicas` | ||
- `Deployment`: 恢复 `spec.replicas` | ||
- `CronJob`: 设置 `spec.suspend: false` | ||
|
||
## 注意事项 | ||
|
||
- 默认情况下,`10s` 执行一轮休眠检查,符合条件的开发空间将自动执行休眠/唤醒; | ||
- 当用户清除所有休眠时间设定,已进入休眠的开发空间将在下一轮检查中自动唤醒; | ||
- 已进入 `DevMode` 的工作负载,将会被忽略,不作休眠处理; | ||
- 用户手动休眠的开发空间,当天将不会自动唤醒; | ||
- 用户手动唤醒的开发空间,当天将不会自动休眠; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.