{ "info": { "author": "Daniel Gonz\u00e1lez Lopes", "author_email": "danielgonzalezlopes@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: System :: Networking", "Topic :: System :: Systems Administration" ], "description": "# termination-handler\n[![PyPI](https://img.shields.io/pypi/v/cloud-detect.svg)](https://pypi.org/project/termination-handler/)\n[![PyPI - License](https://img.shields.io/pypi/l/cloud-detect.svg)](https://github.com/dgzlopes/termination-handler/blob/master/LICENSE.md)\n## About\n`termination-handler` handles termination notices on spot/preemptible instances.\n\nAs an example, if deployed on a Kubernetes cluster and a termination notice is issued by the cloud provider, `termination-handler` drains the node it is running on before the node is taken away by the cloud provider.\n\nInspired by [pusher/k8s-spot-termination-handler](https://github.com/pusher/k8s-spot-termination-handler) for AWS, `termination-handler`\u00a0surges from the need to operate the same tooling in various distinct environments (providers, orchestrators...)\n\n## Features\n- Supports multiple cloud providers (AWS, GCP).\n- Supports multiple handlers (Kubernetes, Nomad).\n- Small and extensible.\n\n## Documentation\nTBD\n## Usage\n### Deploy to Kubernetes\n\nA K8s docker image is available at [`dgzlopes/termination-handler-k8s`](https://hub.docker.com/r/dgzlopes/termination-handler-k8s) and sample Kubernetes manifests are available in the [deploy/k8s](deploy/k8s) folder.\n\nTo deploy in clusters using RBAC, please apply all of the manifests (Daemonset, ClusterRole, ClusterRoleBinding and ServiceAccount) in the [deploy/k8s](deploy/k8s) folder but uncomment the `serviceAccountName` in the [Daemonset](deploy/k8s/daemonset.yaml).\n\n#### Requirements\n\nFor `termination-handler` to schedule correctly; you will need an identifying label on your spot/preemptible instances.\n\nWe add a label `node-role.kubernetes.io/spot-worker` to our spot/preemptible instances and hence this is the default value in the node selector of the [Daemonset](deploy/k8s/daemonset.yaml).\n```yaml\nnodeSelector:\n \"node-role.kubernetes.io/spot-worker\": \"true\"\n```\nTo achieve this, add the following flag to your Kubelet:\n```\n--node-labels=\"node-role.kubernetes.io/spot-worker=true\"\n```\n\n#### Configuration\n\nTo define any custom parameters to the drain command you can use `DRAIN_PARAMETERS` environment property. If not defined, default parameters are `--grace-period=120 --force --ignore-daemonsets`.\n```yaml\nenv:\n - name: DRAIN_PARAMETERS\n value: '--grace-period=120 --force --ignore-daemonsets --delete-local-data'\n```\n### Deploy to Nomad\nA Nomad docker image is available at [`dgzlopes/termination-handler-k8s`](https://hub.docker.com/r/dgzlopes/termination-handler-nomad).\n\nTBD\n\n### Demo mode\n\nThe main way to use termination-handler is waiting for the termination notice from the cloud provider. However, termination-handler comes with a demo mode that is can simulate the notice. When deployed it will identify your cloud provider and run your handlers.\n\nTo activate termination-handler demo mode on Kubernetes, you can use `DEMO_TERMINATION_HANDLER` environment property.\n```yaml\nenv:\n - name: DEMO_TERMINATION_HANDLER\n value: True\n```\n\n### Other handlers\n#### Slack\nThis handler sends a notification message to a specific channel when a termination notice is issued.\n\n## How to contribute\n1. Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.\n2. Fork [the repository](https://github.com/dgzlopes/termination-handler) on GitHub to start making your changes to the master branch (or branch off of it).\n3. Write a test which shows that the bug was fixed or that the feature works as expected.\n4. Send a [pull request](https://help.github.com/en/articles/creating-a-pull-request-from-a-fork) and bug [me](https://github.com/dgzlopes) until it gets merged and published.\n\nSome things that would be great to have:\n- Support for Azure cloud provider.\n- Support for Execution handler (certain command or task)\n- Support for notifications (Slack, Datadog..)\n- Option to omit selected cloud provider discovery.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/dgzlopes/termination-handler", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "termination-handler", "package_url": "https://pypi.org/project/termination-handler/", "platform": "", "project_url": "https://pypi.org/project/termination-handler/", "project_urls": { "Homepage": "https://github.com/dgzlopes/termination-handler" }, "release_url": "https://pypi.org/project/termination-handler/0.0.4/", "requires_dist": [ "requests", "cloud-detect", "slackclient" ], "requires_python": "", "summary": "Handle termination notices on spot/preemptible instances.", "version": "0.0.4" }, "last_serial": 5795915, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "093dcd0ddbaf6ab6e85843dfa05abb54", "sha256": "f718ceac26252cdc9ebd3872d15a28fa5223b6f1e2fa592e33d7464899b874d5" }, "downloads": -1, "filename": "termination_handler-0.0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "093dcd0ddbaf6ab6e85843dfa05abb54", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7572, "upload_time": "2019-08-09T07:22:33", "url": "https://files.pythonhosted.org/packages/1b/69/1d7edc47a955cccc1e7ff9c44744f4e34b0dece9163ed573b8c32a2921a0/termination_handler-0.0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5708cd65a58058631b69d849835ee039", "sha256": "d76c6a06d31e69a39d309523645a49909eb40c57cc2703e5eac2ef9f9be1ee5d" }, "downloads": -1, "filename": "termination-handler-0.0.1.tar.gz", "has_sig": false, "md5_digest": "5708cd65a58058631b69d849835ee039", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4914, "upload_time": "2019-08-09T07:22:35", "url": "https://files.pythonhosted.org/packages/1d/ee/78c37e7213cdf321a81aaf3f5b3ea2b84bdabe387204c8084d7e7254454c/termination-handler-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "cc3b61a0fd482d5177f03fbc0ce2ab44", "sha256": "efcb4650acc0040582d0b88c28f7a55d5e239ffa1a6a6f5f0c0636c4b6da86f7" }, "downloads": -1, "filename": "termination_handler-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "cc3b61a0fd482d5177f03fbc0ce2ab44", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7573, "upload_time": "2019-08-21T14:14:03", "url": "https://files.pythonhosted.org/packages/7d/b0/f98c21f138dab426b05c8ce971a0c124c2dea9af5d9cf89985099817f1b8/termination_handler-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0c159fa29dc40119cee309d674aec445", "sha256": "8850181a46cadc580564d7acc7566586d5f4fa0f37fcbe5d821d9f24f177acae" }, "downloads": -1, "filename": "termination-handler-0.0.2.tar.gz", "has_sig": false, "md5_digest": "0c159fa29dc40119cee309d674aec445", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4923, "upload_time": "2019-08-21T14:14:05", "url": "https://files.pythonhosted.org/packages/a9/d4/d6e5f8737b2e71bb51ccbc057a043ed02b00b967c9f52839485844b4e5c6/termination-handler-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "61dcb941871a41f80c49aa162d2f2a16", "sha256": "0af88f6f07640dc99a52e75458de80a874abd02ec2153724487b5c039a484689" }, "downloads": -1, "filename": "termination_handler-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "61dcb941871a41f80c49aa162d2f2a16", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8620, "upload_time": "2019-09-07T11:43:52", "url": "https://files.pythonhosted.org/packages/06/8b/8bbcb9806fb239f943910f7fa2a082e18078d6e6f652295f3f91fd64dd2f/termination_handler-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b33ea641ef3157077cd3b27a8b918ce7", "sha256": "167178781f4902fe3e5215715369ce2a0f9bc571538b5e1c676cb7bf49a66628" }, "downloads": -1, "filename": "termination-handler-0.0.3.tar.gz", "has_sig": false, "md5_digest": "b33ea641ef3157077cd3b27a8b918ce7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5605, "upload_time": "2019-09-07T11:43:54", "url": "https://files.pythonhosted.org/packages/3e/38/dbee8f66c903297f95be503d20ac3e32a73764b78bddf36a889a1c9fa5f4/termination-handler-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "26c7898005e8192ff882548b4dd8b10a", "sha256": "1903956ec59d693e820b8111999791d54180eee0a0062f33ce5c919ef6299b7a" }, "downloads": -1, "filename": "termination_handler-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "26c7898005e8192ff882548b4dd8b10a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8562, "upload_time": "2019-09-07T11:57:02", "url": "https://files.pythonhosted.org/packages/8c/1a/1d96fc9cc1c968948f08a4a3738a745500fc342dfbeb28e7820e45d329e1/termination_handler-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "503e70e1a789b46a1762efa2974fb5aa", "sha256": "d2e90f184363a607193e30185fdd62957c42afbfab7e5d6f06a409bc5c6e33a6" }, "downloads": -1, "filename": "termination-handler-0.0.4.tar.gz", "has_sig": false, "md5_digest": "503e70e1a789b46a1762efa2974fb5aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5568, "upload_time": "2019-09-07T11:57:03", "url": "https://files.pythonhosted.org/packages/72/62/83b0f63c28faa17f8357d41a54bea443d84ab6e40ccf9c2bbc9d5f939226/termination-handler-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "26c7898005e8192ff882548b4dd8b10a", "sha256": "1903956ec59d693e820b8111999791d54180eee0a0062f33ce5c919ef6299b7a" }, "downloads": -1, "filename": "termination_handler-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "26c7898005e8192ff882548b4dd8b10a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8562, "upload_time": "2019-09-07T11:57:02", "url": "https://files.pythonhosted.org/packages/8c/1a/1d96fc9cc1c968948f08a4a3738a745500fc342dfbeb28e7820e45d329e1/termination_handler-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "503e70e1a789b46a1762efa2974fb5aa", "sha256": "d2e90f184363a607193e30185fdd62957c42afbfab7e5d6f06a409bc5c6e33a6" }, "downloads": -1, "filename": "termination-handler-0.0.4.tar.gz", "has_sig": false, "md5_digest": "503e70e1a789b46a1762efa2974fb5aa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5568, "upload_time": "2019-09-07T11:57:03", "url": "https://files.pythonhosted.org/packages/72/62/83b0f63c28faa17f8357d41a54bea443d84ab6e40ccf9c2bbc9d5f939226/termination-handler-0.0.4.tar.gz" } ] }