{ "info": { "author": "Daniel M\u00fcller Tr\u00f8en", "author_email": "daniel@broentech.no", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "- [PyKube](#pykube)\n- [Usage](#usage)\n - [Build](#build)\n - [Bash](#bash)\n - [Powershell](#powershell)\n - [Deploy](#deploy)\n - [Exec](#exec)\n - [Manually call python](#manually-call-python)\n\n# PyKube\n\nThe goal of this image is to be able to reach clusters and use their API's from a pod programmatically with python.\nIn order for the image to use the correct settings it has to be rebuilt everytime the cluster have been updated with:\n\n - access privileges\n - tokens\n - hosts\n - ~/.kube/config\n\nIf the cluster has been reset the image will have to be rebuilt because the tokens have been renewed.\nTo prevent using kubectl as a sidecar in a pod when accessing a local cluster, we just copy over the local settings and let python kubernetes lib use those.\n\n# Usage\n\n- Build\n- Deploy\n- exec\n- manually call python code in dev. phase\n\n## Build\n\nIn order to build the image correctly follow the instructions below (regular docker build / docker-compose build cannot be used due to needed args in the build process)\n\n### Bash\n\n```bash\ndocker build --no-cache -f aikpy/pykube/Dockerfile -t pykube:1 --build-arg KUBE_CONFIG=\"$(cat ~/.kube/config)\" --build-arg API_TOKEN=\"$(kubectl describe secret default | grep -e '^token' | cut -f 2 -d ':' | tr -d ' \\t')\" --build-arg HOSTLIST=\"$(kubectl config view -o jsonpath='{range .clusters[*]}{.cluster.server}{\",\"}{end}' | sed 's/,$/ /g')\" aikpy/pykube\n```\n\n### Powershell\n\n```powershell\ndocker build --no-cache -f .\\aikpy\\pykube\\Dockerfile -t pykube:1 --build-arg KUBE_CONFIG=\"$(cat $env:USERPROFILE\\.kube\\config)\" --build-arg API_TOKEN=\"$(kubectl describe secret default | findstr /B token | %{$_.split(':')[1]\n} | %{$_ -replace ' ', ''})\" --build-arg HOSTLIST=\"$(kubectl config view -o jsonpath='{range .clusters[*]}{.cluster.server}{\\\",\\\"}{end}' | %{$_ -replace \",$\",''})\" .\\aikpy\\pykube\\\n```\n\n## Deploy \n\n```bash\ncd kubernetes-dev; \nkubectl create -f pykube-deployment.yaml;\n```\n\n## Exec\n\n```bash\nkubectl exec -it pykube- bash\n```\n\n## Manually call python\n```bash\npython getting_pods_sample.py\n```\n\nThen choose list of cluster hosts to connect to.\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/danmutblix/pykube", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "broentech-pykube", "package_url": "https://pypi.org/project/broentech-pykube/", "platform": "", "project_url": "https://pypi.org/project/broentech-pykube/", "project_urls": { "Homepage": "https://github.com/danmutblix/pykube" }, "release_url": "https://pypi.org/project/broentech-pykube/0.5/", "requires_dist": null, "requires_python": "", "summary": "kubernetes client code", "version": "0.5" }, "last_serial": 5977777, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "df854728b716dc06c70887ac8faa942e", "sha256": "6bccd79b9aa2298fc40477eaa114a421e6730d210c04b62fc560b05592e09ff1" }, "downloads": -1, "filename": "broentech_pykube-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "df854728b716dc06c70887ac8faa942e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19568, "upload_time": "2019-10-15T12:36:33", "url": "https://files.pythonhosted.org/packages/d4/55/13e4350eb4668615c36e41e6110af09a91b22ab1ed208d6136a9bdffb697/broentech_pykube-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3d248f54547258a212a2c8c97e468b3", "sha256": "091f3a78c3610ac0f2e0e64cec1f48d168c92bdd2f420f0c4e161bc9629cc03d" }, "downloads": -1, "filename": "broentech-pykube-0.5.tar.gz", "has_sig": false, "md5_digest": "b3d248f54547258a212a2c8c97e468b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5734, "upload_time": "2019-10-15T14:50:11", "url": "https://files.pythonhosted.org/packages/1d/20/580588391efc21589d8a6cc9e0b4d5ea982f0afdeec162dc2e11f635861e/broentech-pykube-0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "df854728b716dc06c70887ac8faa942e", "sha256": "6bccd79b9aa2298fc40477eaa114a421e6730d210c04b62fc560b05592e09ff1" }, "downloads": -1, "filename": "broentech_pykube-0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "df854728b716dc06c70887ac8faa942e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 19568, "upload_time": "2019-10-15T12:36:33", "url": "https://files.pythonhosted.org/packages/d4/55/13e4350eb4668615c36e41e6110af09a91b22ab1ed208d6136a9bdffb697/broentech_pykube-0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b3d248f54547258a212a2c8c97e468b3", "sha256": "091f3a78c3610ac0f2e0e64cec1f48d168c92bdd2f420f0c4e161bc9629cc03d" }, "downloads": -1, "filename": "broentech-pykube-0.5.tar.gz", "has_sig": false, "md5_digest": "b3d248f54547258a212a2c8c97e468b3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5734, "upload_time": "2019-10-15T14:50:11", "url": "https://files.pythonhosted.org/packages/1d/20/580588391efc21589d8a6cc9e0b4d5ea982f0afdeec162dc2e11f635861e/broentech-pykube-0.5.tar.gz" } ] }