Skip to main content

Scale down and restore Kubernetes deployments and statefulsets

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kubedownscaler-0.4.2.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubedownscaler-0.4.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file kubedownscaler-0.4.2.tar.gz.

File metadata

  • Download URL: kubedownscaler-0.4.2.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure

File hashes

Hashes for kubedownscaler-0.4.2.tar.gz
Algorithm Hash digest
SHA256 63a06ce4e33ad1e6538b8b8040fa878922fdb862af0b4ebe1cfebe8b155c0d3c
MD5 92b594332aec403267fc8055630e631d
BLAKE2b-256 834e46cf04b307baa3fdeec7c1b52c3a9a4f6a9cacaabff6df682f15eb16fba8

See more details on using hashes here.

File details

Details for the file kubedownscaler-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: kubedownscaler-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.10.19 Linux/6.11.0-1018-azure

File hashes

Hashes for kubedownscaler-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e270cc7855f1820957383947027586e99bb53a3c9f9be574175456c4e51a7c0c
MD5 9338101ab1e00b3a89699dd3171f1728
BLAKE2b-256 9f25aec5042f4c141260af2e7762a8214c4530aacc7c33448797361940443aa8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page