-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SleepMode docs w/pending config reference
- Loading branch information
Showing
1 changed file
with
76 additions
and
0 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
vcluster/configure/vcluster-yaml/experimental/native-sleep-mode.mdx
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,76 @@ | ||
--- | ||
title: Experimental Sleep Mode | ||
sidebar_label: sleepMode | ||
sidebar_position: 7 | ||
sidebar_class_name: pro | ||
description: Configure a vCluster to sleep/wake without an agent | ||
--- | ||
|
||
import ProAdmonition from '../../../_partials/admonitions/pro-admonition.mdx' | ||
|
||
<ProAdmonition /> | ||
|
||
:::warning | ||
Native sleep mode is intended for pre-production use cases only, and comes with some limitations and | ||
caveats. | ||
::: | ||
|
||
### Configuration examples | ||
|
||
#### Sleep after 3 hours of inactivity, anything that does not have the label `dont=sleep` | ||
|
||
```yaml | ||
experimental: | ||
sleepMode: | ||
enabled: true | ||
autoSleep: | ||
afterInactivity: 3h # Uses Go's Duration with a max unit of hour | ||
exclude: | ||
selector: | ||
labels: | ||
dont: sleep | ||
``` | ||
#### Sleep every Friday at 17:30 and wake every Monday at 7:00 in Mountain timezone | ||
```yaml | ||
experimental: | ||
sleepMode: | ||
enabled: true | ||
timezone: America/Denver | ||
autoSleep: | ||
schedule: 30 17 * * 5 | ||
wakeup: | ||
schedule: 0 7 * * 1 | ||
``` | ||
### How it works | ||
**Sleeping** will delete bare pods and scale down the following resources: | ||
* Deployments | ||
* ReplicaSets | ||
* ReplicationControllers | ||
* DaemonSets | ||
**Waking** will scale those resources back up, but it will be unable to restore bare pods. To exempt resources from being | ||
put to sleep, either add the annotation `sleepmode.loft.sh/exclude: true` or configure sleep mode with labels to exclude and | ||
add that label to all the workloads you'd like to keep running. | ||
|
||
### Detecting activity | ||
|
||
To wake a sleeping cluster or to update the last active time, native sleep mode captures the following: | ||
|
||
* Access of cluster resources. _Think `kubectl get <resource>`_ | ||
* Attempts to contact Ingress endpoints (NGINX only). | ||
|
||
:::info Note: | ||
Ingress activity detection is only available for [NGINX](https://github.com/kubernetes/ingress-nginx/tree/main) | ||
ingress controllers, making use of the [mirror-target](https://github.com/kubernetes/ingress-nginx/blob/main/docs/user-guide/nginx-configuration/annotations.md#mirror) | ||
annotation. If you use this annotation, it will be overwritten for the sleep mode to function. | ||
::: | ||
|
||
## Config reference | ||
|
||
:::info 🚧 | ||
Coming soon | ||
::: |