Skip to main content

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)

Source distribution for kubedownscaler 0.4.2
File Size Uploaded
kubedownscaler-0.4.2.tar.gz 3.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kubedownscaler 0.4.2
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.4.2 This release

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page