kubedownscaler
Scales down Kubernetes Deployments and StatefulSets to 0 replicas, keeps note of the number of replicas in annotations, and scales everything back up to the original number of replicas.
Can operate on a single namespace, or the entire cluster. Can operate only on Deployments and StatefulSets that use a specific StorageClass
Ideal for performing a controlled shutdown, maintenance, etc.
Uses whatever context your local kubectl has.
Install
pip install kubedownscaler
Use
Either -d|--down or -u|--up must be specified.
usage: kubectl downscale [-h] (-d | -u) [--dry-run] [-n NAMESPACE] [--deployments | --no-deployments]
[--statefulsets | --no-statefulsets] [--storageclass STORAGECLASS]
options:
-h, --help show this help message and exit
-d, --down scale down cluster resources
-u, --up scale up to restore state
--dry-run don't actually scale anything
-n NAMESPACE, --namespace NAMESPACE
namespace to operate on
--deployments, --no-deployments
scale Deployments (default: True)
--statefulsets, --no-statefulsets
scale StatefulSets (default: True)
--storageclass STORAGECLASS
only scale Deployments and StatefulSets that are consuming a specific StorageClass
Build
poetry install
poetry build
poetry publish
Release files for kubedownscaler 0.4.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kubedownscaler-0.4.2.tar.gz | 3.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kubedownscaler-0.4.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.7 kB
Release files / kubedownscaler-0.4.2.tar.gz
| Download URL | kubedownscaler-0.4.2.tar.gz |
|---|---|
| Size | 3.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63a06ce4e33ad1e6538b8b8040fa878922fdb862af0b4ebe1cfebe8b155c0d3c
|
|
BLAKE2b-256 checksum How to use checksums |
834e46cf04b307baa3fdeec7c1b52c3a9a4f6a9cacaabff6df682f15eb16fba8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
|
Release files / kubedownscaler-0.4.2-py3-none-any.whl
| Download URL | kubedownscaler-0.4.2-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e270cc7855f1820957383947027586e99bb53a3c9f9be574175456c4e51a7c0c
|
|
BLAKE2b-256 checksum How to use checksums |
9f25aec5042f4c141260af2e7762a8214c4530aacc7c33448797361940443aa8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure
|