# 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.
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]
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)
```
## Build
```sh
poetry install
poetry build
poetry publish
```
Raw data
{
"_id": null,
"home_page": "https://github.com/djjudas21/kubedownscaler",
"name": "kubedownscaler",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.10,<4.0",
"maintainer_email": "",
"keywords": "",
"author": "Jonathan Gazeley",
"author_email": "me@jonathangazeley.com",
"download_url": "https://files.pythonhosted.org/packages/00/0e/cd51ca21ba37500a03ad141d522bc23e96424a06001a55e6e62dd68ac524/kubedownscaler-0.2.1.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.\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]\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```\n\n## Build\n\n```sh\npoetry install\npoetry build\npoetry publish\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Scale down and restore Kubernetes deployments and statefulsets",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/djjudas21/kubedownscaler",
"Repository": "https://github.com/djjudas21/kubedownscaler"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3723d829a2fe4b436e61908b7ac240ba06aadc92faafbd05b19e2b5cf8f0bb0",
"md5": "736057d10969969f15ec6340f7c4b7c4",
"sha256": "bbba4603b7d858a09adb717d85d071bbc6e8a4aca83ddb279620ad31cd9a4546"
},
"downloads": -1,
"filename": "kubedownscaler-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "736057d10969969f15ec6340f7c4b7c4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10,<4.0",
"size": 3577,
"upload_time": "2023-08-14T11:23:29",
"upload_time_iso_8601": "2023-08-14T11:23:29.722652Z",
"url": "https://files.pythonhosted.org/packages/b3/72/3d829a2fe4b436e61908b7ac240ba06aadc92faafbd05b19e2b5cf8f0bb0/kubedownscaler-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "000ecd51ca21ba37500a03ad141d522bc23e96424a06001a55e6e62dd68ac524",
"md5": "b3aa402e29b2dfb3ce8c7160d6800ed0",
"sha256": "675cffea3e63a44a2cf12299a310478fa7cda6f3ab0021441f1093c0ad55b0ee"
},
"downloads": -1,
"filename": "kubedownscaler-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "b3aa402e29b2dfb3ce8c7160d6800ed0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10,<4.0",
"size": 2761,
"upload_time": "2023-08-14T11:23:31",
"upload_time_iso_8601": "2023-08-14T11:23:31.094815Z",
"url": "https://files.pythonhosted.org/packages/00/0e/cd51ca21ba37500a03ad141d522bc23e96424a06001a55e6e62dd68ac524/kubedownscaler-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-08-14 11:23:31",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "djjudas21",
"github_project": "kubedownscaler",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "kubedownscaler"
}