{ "info": { "author": "Steinn Eldjarn Sigurdarson", "author_email": "steinnes@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# pykubeks\n[![CircleCI](https://circleci.com/gh/steinnes/pykubeks.svg?style=svg)](https://circleci.com/gh/steinnes/pykubeks)\n[![PyPI Downloads](https://img.shields.io/pypi/dm/pykubeks.svg)](https://pypi.org/project/pykubeks/)\n[![PyPI Version](https://img.shields.io/pypi/v/pykubeks.svg)](https://pypi.org/project/pykubeks/)\n[![License](https://img.shields.io/badge/license-apache-blue.svg)](https://pypi.org/project/pykubeks/)\n\nThis is a fork of [pykube](https://github.com/kelproject/pykube) which\nis no longer maintained. If you are interested in who brought that\nlovely little library into the world, please check out [The Kel Project](https://github.com/kelproject).\n\nThe reason for this fork is to release the AWS EKS support I wrote for\nthe original project, before it was abandoned. The new name `pykubeks`\nis a portmanteau of `pykube` and `EKS`.\n\nThe python package name is still the same to make it simpler to \"upgrade\"\nto this new version which supports user credentials supplied from client-go\ncredential plugins. See [k8s documentation](https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins)\nfor details.\n\n## Features\n\n* HTTP interface using requests using kubeconfig for authentication\n* Python native querying of Kubernetes API objects\n\n## Installation\n\nTo install pykubeks, use pip:\n\n pip install pykubeks\n\n## Usage\n\nQuery for all ready pods in a custom namespace:\n\n```python\nimport operator\nimport pykube\n\napi = pykube.HTTPClient(pykube.KubeConfig.from_file(\"/Users//.kube/config\"))\npods = pykube.Pod.objects(api).filter(namespace=\"gondor-system\")\nready_pods = filter(operator.attrgetter(\"ready\"), pods)\n```\n\nAccess any attribute of the Kubernetes object:\n\n```python\npod = pykube.Pod.objects(api).filter(namespace=\"gondor-system\").get(name=\"my-pod\")\npod.obj[\"spec\"][\"containers\"][0][\"image\"]\n```\n\nSelector query:\n\n```python\npods = pykube.Pod.objects(api).filter(\n namespace=\"gondor-system\",\n selector={\"gondor.io/name__in\": {\"api-web\", \"api-worker\"}},\n)\npending_pods = pykube.objects.Pod.objects(api).filter(\n field_selector={\"status.phase\": \"Pending\"}\n)\n```\n\nWatch query:\n\n```python\nwatch = pykube.Job.objects(api, namespace=\"gondor-system\")\nwatch = watch.filter(field_selector={\"metadata.name\": \"my-job\"}).watch()\n\n# watch is a generator:\nfor watch_event in watch:\n print(watch_event.type) # 'ADDED', 'DELETED', 'MODIFIED'\n print(watch_event.object) # pykube.Job object\n```\n\nCreate a ReplicationController:\n\n```\nobj = {\n \"apiVersion\": \"v1\",\n \"kind\": \"ReplicationController\",\n \"metadata\": {\n \"name\": \"my-rc\",\n \"namespace\": \"gondor-system\"\n },\n \"spec\": {\n \"replicas\": 3,\n \"selector\": {\n \"app\": \"nginx\"\n },\n \"template\": {\n \"metadata\": {\n \"labels\": {\n \"app\": \"nginx\"\n }\n },\n \"spec\": {\n \"containers\": [\n {\n \"name\": \"nginx\",\n \"image\": \"nginx\",\n \"ports\": [\n {\"containerPort\": 80}\n ]\n }\n ]\n }\n }\n }\n}\npykube.ReplicationController(api, obj).create()\n```\n\nDelete a ReplicationController:\n\n```python\nobj = {\n \"apiVersion\": \"v1\",\n \"kind\": \"ReplicationController\",\n \"metadata\": {\n \"name\": \"my-rc\",\n \"namespace\": \"gondor-system\"\n }\n}\npykube.ReplicationController(api, obj).delete()\n```\n\nCheck server version:\n\n```python\napi = pykube.HTTPClient(pykube.KubeConfig.from_file(\"/Users//.kube/config\"))\napi.version\n```\n\n## HTTPie\n\npykube can be used together with HTTPie for Kubernetes command line querying goodness. For example:\n\n```\npip install httpie\nhttp pykube://minikube/api/v1/services\n```\n\nThe above example will construct an HTTP request to the cluster behind the ``minikube`` context and\nshow you the response containing all services.\n\n## Requirements\n\n* Python 2.7 or 3.3+\n* requests (included in ``install_requires``)\n* PyYAML (included in ``install_requires``)\n\n## License\n\nThe code in this project is licensed under the Apache License, version 2.0\n(included in this repository under LICENSE).\n\n\n## Contributing\n\nBy making a contribution to this project, you are agreeing to the `Developer\nCertificate of Origin v1.1` (also included in this repository under DCO.txt).\n\n[Developer Certificate of Origin v1.1](http://developercertificate.org)\n\n\n## Code of Conduct\n\n[Contributor Covenant Code of Conduct](http://contributor-covenant.org/version/1/4/)\n\n\n## Commercial Support\n\nNo commercial support is available for this project.", "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/steinnes/pykubeks", "keywords": "", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "pykubeks", "package_url": "https://pypi.org/project/pykubeks/", "platform": "", "project_url": "https://pypi.org/project/pykubeks/", "project_urls": { "Homepage": "https://github.com/steinnes/pykubeks" }, "release_url": "https://pypi.org/project/pykubeks/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Python client library for Kubernetes w/ EKS support", "version": "0.1.0" }, "last_serial": 4894018, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "521ac7e8596e1bab54899118be2e52fc", "sha256": "a5ce56d5ebcf8c6c663ddd5f26683556bb4bacc3aceb3e71a0b0834bdb081e24" }, "downloads": -1, "filename": "pykubeks-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "521ac7e8596e1bab54899118be2e52fc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27451, "upload_time": "2019-03-04T11:36:38", "url": "https://files.pythonhosted.org/packages/62/9f/65df7f2fad12d30a56a41f5a7504e58683d5ba687af550d398a9b8c95391/pykubeks-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67084c744bf88293d35d10b26d81f9e5", "sha256": "0791b3f7fe1f5c8c8bb2685ec217498d30990f47292b5715b106f9390210010c" }, "downloads": -1, "filename": "pykubeks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "67084c744bf88293d35d10b26d81f9e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19148, "upload_time": "2019-03-04T11:36:35", "url": "https://files.pythonhosted.org/packages/9f/23/a43f15421a22efa46390990a93b3124193e2c7e50bfc90d2300a3401ba31/pykubeks-0.1.0.tar.gz" } ], "0.1.0a1": [ { "comment_text": "", "digests": { "md5": "2314170bd1ac2fd1824fb36a2c59c87b", "sha256": "6ccb9cc88d8d09c2c85111d686b7d932bb5c6cfd62e22b1db30de8fa610890fc" }, "downloads": -1, "filename": "pykubeks-0.1.0a1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2314170bd1ac2fd1824fb36a2c59c87b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27343, "upload_time": "2019-03-01T15:22:58", "url": "https://files.pythonhosted.org/packages/80/9d/fda5611bf5b84058df68aed5f78f77d76f6c501c1b64383f88110824e594/pykubeks-0.1.0a1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "decd6384168669262c40f30b6f789033", "sha256": "a9c2ef5b368af9d19d8edc2b8b75d1373095d4d5be109e91fca2c5212ae079a0" }, "downloads": -1, "filename": "pykubeks-0.1.0a1.tar.gz", "has_sig": false, "md5_digest": "decd6384168669262c40f30b6f789033", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18948, "upload_time": "2019-03-01T15:23:01", "url": "https://files.pythonhosted.org/packages/88/db/1540eaa086640484104eab7bad500e66c516c5740ca421247fda48770fed/pykubeks-0.1.0a1.tar.gz" } ], "0.1.0a2": [ { "comment_text": "", "digests": { "md5": "869ba45cc012579539b3304cf899b9f7", "sha256": "0091c1393444cfc354e892de98a7980d9c9d4f42b8a0cc2d5dad5dcb662b082b" }, "downloads": -1, "filename": "pykubeks-0.1.0a2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "869ba45cc012579539b3304cf899b9f7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27370, "upload_time": "2019-03-01T15:25:40", "url": "https://files.pythonhosted.org/packages/7e/13/9229504243591a38a46a897893fde5b471ed3806986c6349750f17672732/pykubeks-0.1.0a2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8457ac4da0be1d21d91ac793aed5bbc7", "sha256": "6eb635e249e4ae81f10fb07341298d4e6e72154a537080f789b416493dae2515" }, "downloads": -1, "filename": "pykubeks-0.1.0a2.tar.gz", "has_sig": false, "md5_digest": "8457ac4da0be1d21d91ac793aed5bbc7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19002, "upload_time": "2019-03-01T15:25:37", "url": "https://files.pythonhosted.org/packages/6d/cc/c0ba936b3abbf21c8989601a5211b97f16ac76824606ad2a4901e5f86f75/pykubeks-0.1.0a2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "521ac7e8596e1bab54899118be2e52fc", "sha256": "a5ce56d5ebcf8c6c663ddd5f26683556bb4bacc3aceb3e71a0b0834bdb081e24" }, "downloads": -1, "filename": "pykubeks-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "521ac7e8596e1bab54899118be2e52fc", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 27451, "upload_time": "2019-03-04T11:36:38", "url": "https://files.pythonhosted.org/packages/62/9f/65df7f2fad12d30a56a41f5a7504e58683d5ba687af550d398a9b8c95391/pykubeks-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "67084c744bf88293d35d10b26d81f9e5", "sha256": "0791b3f7fe1f5c8c8bb2685ec217498d30990f47292b5715b106f9390210010c" }, "downloads": -1, "filename": "pykubeks-0.1.0.tar.gz", "has_sig": false, "md5_digest": "67084c744bf88293d35d10b26d81f9e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19148, "upload_time": "2019-03-04T11:36:35", "url": "https://files.pythonhosted.org/packages/9f/23/a43f15421a22efa46390990a93b3124193e2c7e50bfc90d2300a3401ba31/pykubeks-0.1.0.tar.gz" } ] }