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.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: kubedownscaler-0.4.1.tar.gz
  • Upload date:
  • Size: 3.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.10.18 Linux/6.11.0-1015-azure

File hashes

Hashes for kubedownscaler-0.4.1.tar.gz
Algorithm Hash digest
SHA256 9af52645a1413a1912c5d33b53b4d8cc786e64a55d40af2827c310c6c5efbde5
MD5 0535b82ec0e0c4e5fd398b963985ce91
BLAKE2b-256 ef248b442a55d4c2ad7e24f6dcd0c73a9d1e1a6fbc5141ea2bf9e32055478aa1

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for kubedownscaler-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 319e90eccdcf2e1f705a90c767e99da8d95a7298acc47cf7d8db9a544e965402
MD5 dc4d230e81a035bc5cade17105d50734
BLAKE2b-256 9e1a41b65b93ad3e478c6b61e1229be675e920fc1ae00f209f67867191a615fe

See more details on using hashes here.

Supported by

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