grdp-cli-kubernetes
Official Python client library for kubernetes
Science Score: 36.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
4 of 214 committers (1.9%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (12.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
Official Python client library for kubernetes
Basic Info
- Host: GitHub
- Owner: kubernetes-client
- License: apache-2.0
- Language: Python
- Default Branch: master
- Homepage: http://kubernetes.io/
- Size: 27.4 MB
Statistics
- Stars: 7,319
- Watchers: 137
- Forks: 3,407
- Open Issues: 92
- Releases: 102
Topics
Metadata Files
README.md
Kubernetes Python Client
Python client for the kubernetes API.
Installation
From source:
git clone --recursive https://github.com/kubernetes-client/python.git
cd python
python setup.py install
From PyPI directly:
pip install kubernetes
Examples
list all pods:
```python from kubernetes import client, config
Configs can be set in Configuration class directly or using helper utility
config.loadkubeconfig()
v1 = client.CoreV1Api() print("Listing pods with their IPs:") ret = v1.listpodforallnamespaces(watch=False) for i in ret.items: print("%s\t%s\t%s" % (i.status.pod_ip, i.metadata.namespace, i.metadata.name)) ```
watch on namespace object:
```python from kubernetes import client, config, watch
Configs can be set in Configuration class directly or using helper utility
config.loadkubeconfig()
v1 = client.CoreV1Api() count = 10 w = watch.Watch() for event in w.stream(v1.listnamespace, _requesttimeout=60): print("Event: %s %s" % (event['type'], event['object'].metadata.name)) count -= 1 if not count: w.stop()
print("Ended.") ```
More examples can be found in examples folder. To run examples, run this command:
shell
python -m examples.example1
(replace example1 with one of the filenames in the examples folder)
Documentation
All APIs and Models' documentation can be found at the Generated client's README file
Compatibility
client-python follows semver, so until the major version of
client-python gets increased, your code will continue to work with explicitly
supported versions of Kubernetes clusters.
Compatibility matrix of supported client versions
- client 9.y.z: Kubernetes 1.12 or below (+-), Kubernetes 1.13 (✓), Kubernetes 1.14 or above (+-)
- client 10.y.z: Kubernetes 1.13 or below (+-), Kubernetes 1.14 (✓), Kubernetes 1.14 or above (+-)
- client 11.y.z: Kubernetes 1.14 or below (+-), Kubernetes 1.15 (✓), Kubernetes 1.16 or above (+-)
- client 12.y.z: Kubernetes 1.15 or below (+-), Kubernetes 1.16 (✓), Kubernetes 1.17 or above (+-)
- client 17.y.z: Kubernetes 1.16 or below (+-), Kubernetes 1.17 (✓), Kubernetes 1.18 or above (+-)
- client 18.y.z: Kubernetes 1.17 or below (+-), Kubernetes 1.18 (✓), Kubernetes 1.19 or above (+-)
- client 19.y.z: Kubernetes 1.18 or below (+-), Kubernetes 1.19 (✓), Kubernetes 1.20 or above (+-)
- client 20.y.z: Kubernetes 1.19 or below (+-), Kubernetes 1.20 (✓), Kubernetes 1.21 or above (+-)
- client 21.y.z: Kubernetes 1.20 or below (+-), Kubernetes 1.21 (✓), Kubernetes 1.22 or above (+-)
- client 22.y.z: Kubernetes 1.21 or below (+-), Kubernetes 1.22 (✓), Kubernetes 1.23 or above (+-)
- client 23.y.z: Kubernetes 1.22 or below (+-), Kubernetes 1.23 (✓), Kubernetes 1.24 or above (+-)
- client 24.y.z: Kubernetes 1.23 or below (+-), Kubernetes 1.24 (✓), Kubernetes 1.25 or above (+-)
- client 25.y.z: Kubernetes 1.24 or below (+-), Kubernetes 1.25 (✓), Kubernetes 1.26 or above (+-)
- client 26.y.z: Kubernetes 1.25 or below (+-), Kubernetes 1.26 (✓), Kubernetes 1.27 or above (+-)
- client 27.y.z: Kubernetes 1.26 or below (+-), Kubernetes 1.27 (✓), Kubernetes 1.28 or above (+-)
- client 28.y.z: Kubernetes 1.27 or below (+-), Kubernetes 1.28 (✓), Kubernetes 1.29 or above (+-)
- client 29.y.z: Kubernetes 1.28 or below (+-), Kubernetes 1.29 (✓), Kubernetes 1.30 or above (+-)
- client 30.y.z: Kubernetes 1.29 or below (+-), Kubernetes 1.30 (✓), Kubernetes 1.31 or above (+-)
- client 31.y.z: Kubernetes 1.30 or below (+-), Kubernetes 1.31 (✓), Kubernetes 1.32 or above (+-)
- client 32.y.z: Kubernetes 1.31 or below (+-), Kubernetes 1.32 (✓), Kubernetes 1.33 or above (+-)
- client 33.y.z: Kubernetes 1.32 or below (+-), Kubernetes 1.33 (✓), Kubernetes 1.34 or above (+-)
See here for an explanation of why there is no v13-v16 release.
Key:
✓Exactly the same features / API objects in both client-python and the Kubernetes version.+client-python has features or API objects that may not be present in the Kubernetes cluster, either due to that client-python has additional new API, or that the server has removed old API. However, everything they have in common (i.e., most APIs) will work. Please note that alpha APIs may vanish or change significantly in a single release.-The Kubernetes cluster has features the client-python library can't use, either due to the server has additional new API, or that client-python has removed old API. However, everything they share in common (i.e., most APIs) will work.
See the CHANGELOG for a detailed description of changes between client-python versions.
| Client version | Canonical source for OpenAPI spec | Maintenance status | |-----------------|--------------------------------------|-------------------------------| | 5.0 Alpha/Beta | Kubernetes main repo, 1.9 branch | ✗ | | 5.0 | Kubernetes main repo, 1.9 branch | ✗ | | 6.0 Alpha/Beta | Kubernetes main repo, 1.10 branch | ✗ | | 6.0 | Kubernetes main repo, 1.10 branch | ✗ | | 7.0 Alpha/Beta | Kubernetes main repo, 1.11 branch | ✗ | | 7.0 | Kubernetes main repo, 1.11 branch | ✗ | | 8.0 Alpha/Beta | Kubernetes main repo, 1.12 branch | ✗ | | 8.0 | Kubernetes main repo, 1.12 branch | ✗ | | 9.0 Alpha/Beta | Kubernetes main repo, 1.13 branch | ✗ | | 9.0 | Kubernetes main repo, 1.13 branch | ✗ | | 10.0 Alpha/Beta | Kubernetes main repo, 1.14 branch | ✗ | | 10.0 | Kubernetes main repo, 1.14 branch | ✗ | | 11.0 Alpha/Beta | Kubernetes main repo, 1.15 branch | ✗ | | 11.0 | Kubernetes main repo, 1.15 branch | ✗ | | 12.0 Alpha/Beta | Kubernetes main repo, 1.16 branch | ✗ | | 12.0 | Kubernetes main repo, 1.16 branch | ✗ | | 17.0 Alpha/Beta | Kubernetes main repo, 1.17 branch | ✗ | | 17.0 | Kubernetes main repo, 1.17 branch | ✗ | | 18.0 Alpha/Beta | Kubernetes main repo, 1.18 branch | ✗ | | 18.0 | Kubernetes main repo, 1.18 branch | ✗ | | 19.0 Alpha/Beta | Kubernetes main repo, 1.19 branch | ✗ | | 19.0 | Kubernetes main repo, 1.19 branch | ✗ | | 20.0 Alpha/Beta | Kubernetes main repo, 1.20 branch | ✗ | | 20.0 | Kubernetes main repo, 1.20 branch | ✗ | | 21.0 Alpha/Beta | Kubernetes main repo, 1.21 branch | ✗ | | 21.0 | Kubernetes main repo, 1.21 branch | ✗ | | 22.0 Alpha/Beta | Kubernetes main repo, 1.22 branch | ✗ | | 22.0 | Kubernetes main repo, 1.22 branch | ✗ | | 23.0 Alpha/Beta | Kubernetes main repo, 1.23 branch | ✗ | | 23.0 | Kubernetes main repo, 1.23 branch | ✗ | | 24.0 Alpha/Beta | Kubernetes main repo, 1.24 branch | ✗ | | 24.0 | Kubernetes main repo, 1.24 branch | ✗ | | 25.0 Alpha/Beta | Kubernetes main repo, 1.25 branch | ✗ | | 25.0 | Kubernetes main repo, 1.25 branch | ✗ | | 26.0 Alpha/Beta | Kubernetes main repo, 1.26 branch | ✗ | | 26.0 | Kubernetes main repo, 1.26 branch | ✗ | | 27.0 Alpha/Beta | Kubernetes main repo, 1.27 branch | ✗ | | 27.0 | Kubernetes main repo, 1.27 branch | ✗ | | 28.0 Alpha/Beta | Kubernetes main repo, 1.28 branch | ✗ | | 28.0 | Kubernetes main repo, 1.28 branch | ✗ | | 29.0 Alpha/Beta | Kubernetes main repo, 1.29 branch | ✗ | | 29.0 | Kubernetes main repo, 1.29 branch | ✗ | | 30.0 Alpha/Beta | Kubernetes main repo, 1.30 branch | ✗ | | 30.0 | Kubernetes main repo, 1.30 branch | ✗ | | 31.0 Alpha/Beta | Kubernetes main repo, 1.31 branch | ✗ | | 31.0 | Kubernetes main repo, 1.31 branch | ✓ | | 32.0 Alpha/Beta | Kubernetes main repo, 1.32 branch | ✗ | | 32.1 | Kubernetes main repo, 1.32 branch | ✓ | | 33.1 Alpha/Beta | Kubernetes main repo, 1.33 branch | ✗ | | 33.1 | Kubernetes main repo, 1.33 branch | ✓ |
See here for an explanation of why there is no v13-v16 release.
Key:
✓Changes in main Kubernetes repo are manually (should be automated) published to client-python when they are available.✗No longer maintained; please upgrade.
Kubernetes supports three minor releases at a time. "Support" means we expect users to be running that version in production, though we may not port fixes back before the latest minor version. For example, when v1.3 comes out, v1.0 will no longer be supported. In consistent with Kubernetes support policy, we expect to support three GA major releases (corresponding to three Kubernetes minor releases) at a time.
Note: There would be no maintenance for alpha/beta releases except the latest one.
Exception to the above support rule: Since we are running behind on releases, we will support Alpha/Beta releases for a greater number of clients until we catch up with the upstream version.
Homogenizing the Kubernetes Python Client versions
The client releases v12 and before following a versioning schema where the major version was 4 integer positions behind the Kubernetes minor on which the client is based on. For example, v12.0.0 is based on Kubernetes v1.16, v11.0.0 is based on Kubernetes v1.15 and so on.
This created a lot of confusion tracking two different version numbers for each client release. It was decided to homogenize the version scheme starting from the Kubernetes Python client based on Kubernetes v1.17. The versioning scheme of the client from this release would be vY.Z.P where Y and Z are the Kubernetes minor and patch release numbers from Kubernets v1.Y.Z and P is the client specific patch release numbers to accommodate changes and fixes done specifically to the client. For more details, refer this issue.
Community, Support, Discussion
If you have any problem on using the package or any suggestions, please start with reaching the Kubernetes clients slack channel, or filing an issue to let us know. You can also reach the maintainers of this project at SIG API Machinery, where this project falls under.
Code of Conduct
Participation in the Kubernetes community is governed by the CNCF Code of Conduct.
Troubleshooting
SSLError on macOS
If you get an SSLError, you likely need to update your version of python. The version that ships with macOS may not be supported.
Install the latest version of python with brew:
brew install python
Once installed, you can query the version of OpenSSL like so:
python -c "import ssl; print (ssl.OPENSSL_VERSION)"
You'll need a version with OpenSSL version 1.0.0 or later.
Hostname doesn't match
If you get an ssl.CertificateError complaining about hostname match, your installed packages does not meet version requirements.
Specifically check ipaddress and urllib3 package versions to make sure they met requirements in requirements.txt file.
Why Exec/Attach calls doesn't work
Starting from 4.0 release, we do not support directly calling exec or attach calls. you should use stream module to call them. so instead
of resp = api.connect_get_namespaced_pod_exec(name, ... you should call resp = stream(api.connect_get_namespaced_pod_exec, name, ....
Using Stream will overwrite the requests protocol in corev1api.CoreV1Api() This will cause a failure in non-exec/attach calls. If you reuse your api client object, you will need to recreate it between api calls that use stream and other api calls.
See more at exec example.
Enabling Debug Logging
To enable debug logging in the Kubernetes Python client, follow these steps:
1. Import the logging module
```python import logging
Set the logging level to DEBUG
logging.basicConfig(level=logging.DEBUG)
To see the HTTP requests and responses sent to the Kubernetes API (for debugging network-related issues), configure the urllib3 logger:
logging.getLogger("urllib3").setLevel(logging.DEBUG) ```
Owner
- Name: Kubernetes Clients
- Login: kubernetes-client
- Kind: organization
- Website: https://kubernetes.io/docs/reference/using-api/client-libraries/
- Repositories: 13
- Profile: https://github.com/kubernetes-client
This organization hosts Kubernetes API client libraries.
GitHub Events
Total
- Create event: 11
- Commit comment event: 2
- Release event: 5
- Issues event: 115
- Watch event: 572
- Delete event: 4
- Issue comment event: 965
- Push event: 34
- Pull request review comment event: 56
- Pull request review event: 78
- Pull request event: 130
- Fork event: 175
Last Year
- Create event: 11
- Commit comment event: 2
- Release event: 5
- Issues event: 115
- Watch event: 572
- Delete event: 4
- Issue comment event: 965
- Push event: 34
- Pull request review comment event: 56
- Pull request review event: 78
- Pull request event: 130
- Fork event: 175
Committers
Last synced: 8 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| mbohlool | m****y@g****m | 184 |
| Yu Liao | y****o@g****m | 180 |
| Haowei Cai | h****c@g****m | 150 |
| Nabarun Pal | p****5@g****m | 59 |
| micw523 | m****w@u****u | 30 |
| dependabot[bot] | 4****] | 27 |
| Oz N Tiram | o****m@g****m | 25 |
| Davanum Srinivas | d****m@g****m | 21 |
| Priyanka Saggu | p****9@g****m | 20 |
| Patrick J. McNerthney | p****t@m****m | 18 |
| Fabian von Feilitzsch | f****n@f****s | 14 |
| Tomasz Prus | t****s@g****m | 14 |
| Moshe Shitrit | m****e@s****v | 12 |
| itaru2622 | i****2@g****m | 10 |
| Raj Bhargav | 7****3 | 10 |
| Sergi Almacellas Abellana | s****i@k****m | 9 |
| Scott Lee | s****e@f****m | 8 |
| djkonro | k****i@g****m | 7 |
| Flynn | e****y@f****m | 7 |
| Dylan Shepard | d****n@s****v | 7 |
| vishnu667 | v****7@g****m | 7 |
| Brendan Burns | b****s@m****m | 7 |
| Neha Yadav | i****8@g****m | 6 |
| Prabha | 5****a | 6 |
| Christian Clauss | c****s@m****m | 6 |
| jonasdlindner | j****5@g****m | 5 |
| Pedro Lopez Mareque | p****z@c****i | 5 |
| Ebbe Elsborg | ee@b****m | 5 |
| DjangoPeng | p****1@g****m | 5 |
| Richard Godden | 7****h | 5 |
| and 184 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 329
- Total pull requests: 317
- Average time to close issues: 8 months
- Average time to close pull requests: 3 months
- Total issue authors: 302
- Total pull request authors: 116
- Average comments per issue: 6.88
- Average comments per pull request: 5.92
- Merged pull requests: 168
- Bot issues: 0
- Bot pull requests: 18
Past Year
- Issues: 75
- Pull requests: 143
- Average time to close issues: about 1 month
- Average time to close pull requests: 29 days
- Issue authors: 74
- Pull request authors: 52
- Average comments per issue: 1.73
- Average comments per pull request: 4.62
- Merged pull requests: 66
- Bot issues: 0
- Bot pull requests: 7
Top Authors
Issue Authors
- arcivanov (6)
- roycaihw (4)
- hterik (3)
- coopstah13 (3)
- dirrao (3)
- razilevin (2)
- Jicming (2)
- mbohlool (2)
- yabea (2)
- leonp-c (2)
- curiousEnough (2)
- mattjwarren (2)
- devopstales (2)
- gibsondan (2)
- Sahil148024 (2)
Pull Request Authors
- yliaog (86)
- dependabot[bot] (18)
- Kevinz857 (10)
- tomplus (7)
- shivanand007 (5)
- p172913 (5)
- kflynn (5)
- nijjuhm (4)
- Ananya2001-an (3)
- anvilpete (3)
- yabea (3)
- arcivanov (3)
- BhaskarSrinivasK (2)
- ViduminiKulathunga (2)
- attilapiros (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 19
-
Total downloads:
- pypi 70,285,133 last-month
- Total docker downloads: 784,932,275
-
Total dependent packages: 530
(may contain duplicates) -
Total dependent repositories: 6,304
(may contain duplicates) - Total versions: 195
- Total maintainers: 4
pypi.org: kubernetes
Kubernetes python client
- Homepage: https://github.com/kubernetes-client/python
- Documentation: https://kubernetes.readthedocs.io/
- License: Apache License Version 2.0
-
Latest release: 33.1.0
published 9 months ago
Rankings
Maintainers (1)
alpine-v3.18: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 26.1.0-r1
published almost 3 years ago
Rankings
Maintainers (1)
alpine-v3.18: py3-kubernetes-pyc
Precompiled Python bytecode for py3-kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 26.1.0-r1
published almost 3 years ago
Rankings
Maintainers (1)
alpine-edge: py3-kubernetes-pyc
Precompiled Python bytecode for py3-kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 33.1.0-r0
published 8 months ago
Rankings
Maintainers (1)
alpine-edge: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 33.1.0-r0
published 8 months ago
Rankings
Maintainers (1)
alpine-v3.17: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 25.3.0-r0
published over 3 years ago
Rankings
Maintainers (1)
alpine-v3.16: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 23.6.0-r0
published almost 4 years ago
Rankings
Maintainers (1)
proxy.golang.org: github.com/kubernetes-client/python
- Documentation: https://pkg.go.dev/github.com/kubernetes-client/python#section-documentation
- License: apache-2.0
-
Latest release: v33.1.0+incompatible
published 9 months ago
Rankings
pypi.org: grdp-cli-kubernetes
Kubernetes python client
- Homepage: https://github.com/kubernetes-client/python
- Documentation: https://grdp-cli-kubernetes.readthedocs.io/
- License: Apache License Version 2.0
-
Latest release: 1.0.2
published over 1 year ago
Rankings
Maintainers (1)
pypi.org: kubernetes-redjohn
Kubernetes python client
- Homepage: https://github.com/kubernetes-client/python
- Documentation: https://kubernetes-redjohn.readthedocs.io/
- License: Apache License Version 2.0
-
Latest release: 9.0.0.post61819
published over 6 years ago
Rankings
Maintainers (1)
anaconda.org: python-kubernetes
The official Kubernetes python client. This is a client library for Kubernetes, an open-source container-orchestration system for automating computer application deployment, scaling, and management.
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 32.0.1
published 11 months ago
Rankings
alpine-v3.19: py3-kubernetes-pyc
Precompiled Python bytecode for py3-kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 28.1.0-r0
published over 2 years ago
Rankings
Maintainers (1)
alpine-v3.19: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 28.1.0-r0
published over 2 years ago
Rankings
Maintainers (1)
alpine-v3.20: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 29.0.0-r1
published almost 2 years ago
Rankings
Maintainers (1)
alpine-v3.21: py3-kubernetes-pyc
Precompiled Python bytecode for py3-kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 31.0.0-r0
published over 1 year ago
Rankings
Maintainers (1)
alpine-v3.20: py3-kubernetes-pyc
Precompiled Python bytecode for py3-kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 29.0.0-r1
published almost 2 years ago
Rankings
Maintainers (1)
alpine-v3.21: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 31.0.0-r0
published over 1 year ago
Rankings
Maintainers (1)
alpine-v3.22: py3-kubernetes
Official Python client library for kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 32.0.1-r0
published 12 months ago
Rankings
Maintainers (1)
alpine-v3.22: py3-kubernetes-pyc
Precompiled Python bytecode for py3-kubernetes
- Homepage: https://github.com/kubernetes-client/python
- License: Apache-2.0
-
Latest release: 32.0.1-r0
published 12 months ago
Rankings
Maintainers (1)
Dependencies
- actions/checkout v3 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- helm/kind-action v1.7.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- helm/kind-action v1.7.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- helm/kind-action v1.7.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- helm/kind-action v1.7.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- helm/kind-action v1.7.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- helm/kind-action v1.7.0 composite
- actions/checkout v3 composite
- actions/setup-python v4 composite
- codecov/codecov-action v3 composite
- nbgallery/jupyter-alpine latest build
- recommonmark *
- sphinx_markdown_tables *
- certifi >=14.05.14
- google-auth >=1.0.1
- ipaddress >=1.0.17
- oauthlib >=3.2.2
- python-dateutil >=2.5.3
- pyyaml >=5.4.1
- requests *
- requests-oauthlib *
- setuptools >=21.0.0
- six >=1.9.0
- urllib3 >=1.24.2
- websocket-client >=0.32.0,
- autopep8 * test
- coverage >=4.0.3 test
- isort * test
- mock >=2.0.0 test
- nose >=1.3.7 test
- pluggy >=0.3.1 test
- py >=1.4.31 test
- pycodestyle * test
- pytest * test
- pytest-cov * test
- randomize >=0.13 test
- recommonmark * test
- sphinx >=1.4 test
- sphinx_markdown_tables * test