# 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
```sh
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
```sh
poetry install
poetry build
poetry publish
```
Raw data
{
"_id": null,
"home_page": "https://github.com/djjudas21/kubedownscaler",
"name": "kubedownscaler",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.10",
"maintainer_email": null,
"keywords": null,
"author": "Jonathan Gazeley",
"author_email": "me@jonathangazeley.com",
"download_url": "https://files.pythonhosted.org/packages/78/84/5676d81b6dc65c9444be0f55781deeaf4a317c8330c1e2b7a4d7c905080a/kubedownscaler-0.4.0.tar.gz",
"platform": null,
"description": "# kubedownscaler\n\nScales down Kubernetes Deployments and StatefulSets to 0 replicas, keeps note of the number\nof replicas in annotations, and scales everything back up to the original number of replicas.\n\nCan operate on a single namespace, or the entire cluster.\nCan operate only on Deployments and StatefulSets that use a specific StorageClass\n\nIdeal for performing a controlled shutdown, maintenance, etc.\n\nUses whatever context your local `kubectl` has.\n\n## Install\n\n```sh\npip install kubedownscaler\n```\n\n## Use\n\nEither `-d|--down` or `-u|--up` must be specified.\n\n```\nusage: kubectl downscale [-h] (-d | -u) [--dry-run] [-n NAMESPACE] [--deployments | --no-deployments]\n [--statefulsets | --no-statefulsets] [--storageclass STORAGECLASS]\n\noptions:\n -h, --help show this help message and exit\n -d, --down scale down cluster resources\n -u, --up scale up to restore state\n --dry-run don't actually scale anything\n -n NAMESPACE, --namespace NAMESPACE\n namespace to operate on\n --deployments, --no-deployments\n scale Deployments (default: True)\n --statefulsets, --no-statefulsets\n scale StatefulSets (default: True)\n --storageclass STORAGECLASS\n only scale Deployments and StatefulSets that are consuming a specific StorageClass\n```\n\n## Build\n\n```sh\npoetry install\npoetry build\npoetry publish\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "Scale down and restore Kubernetes deployments and statefulsets",
"version": "0.4.0",
"project_urls": {
"Homepage": "https://github.com/djjudas21/kubedownscaler",
"Repository": "https://github.com/djjudas21/kubedownscaler"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b0cc8d7c81451b869dca33d20e370882a6addc0823b4128239e519c32c512121",
"md5": "33fb7cc7215594aaf9b5fc1c8638c1e8",
"sha256": "2a4d08fa59d5adb73de8bf64de775edb57f22bdf484cd75501f34404e4272070"
},
"downloads": -1,
"filename": "kubedownscaler-0.4.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "33fb7cc7215594aaf9b5fc1c8638c1e8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.10",
"size": 4328,
"upload_time": "2024-12-18T17:28:52",
"upload_time_iso_8601": "2024-12-18T17:28:52.993376Z",
"url": "https://files.pythonhosted.org/packages/b0/cc/8d7c81451b869dca33d20e370882a6addc0823b4128239e519c32c512121/kubedownscaler-0.4.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "78845676d81b6dc65c9444be0f55781deeaf4a317c8330c1e2b7a4d7c905080a",
"md5": "3fa66868defd8d7619fd5266f8df5624",
"sha256": "081b2052c2ad487d6982422daf5cbf4512d459c2e6ccd6828b866faedf858f19"
},
"downloads": -1,
"filename": "kubedownscaler-0.4.0.tar.gz",
"has_sig": false,
"md5_digest": "3fa66868defd8d7619fd5266f8df5624",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.10",
"size": 3534,
"upload_time": "2024-12-18T17:28:56",
"upload_time_iso_8601": "2024-12-18T17:28:56.454878Z",
"url": "https://files.pythonhosted.org/packages/78/84/5676d81b6dc65c9444be0f55781deeaf4a317c8330c1e2b7a4d7c905080a/kubedownscaler-0.4.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-18 17:28:56",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "djjudas21",
"github_project": "kubedownscaler",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "kubedownscaler"
}