python
python copied to clipboard
Official Python client library for kubernetes
**What is the feature and why do you need it**: Currently, the K8S Python API only [supports leader election](https://github.com/kubernetes-client/python/tree/master/kubernetes/base/leaderelection) using [`ConfigMapLock`](https://github.com/kubernetes-client/python/blob/master/kubernetes/base/leaderelection/resourcelock/configmaplock.py). The K8S Go API supports using the proper [`Lease`](https://kubernetes.io/docs/reference/kubernetes-api/cluster-resources/lease-v1/)...
**What is the feature and why do you need it**: I want to use dynamic client for executing commands in pods (api: `connect_get_namespaced_pod_exec`). Similar to this [example](https://github.com/kubernetes-client/python/blob/master/examples/pod_exec.py) but using the...
**What happened (please include outputs or screenshots)**: every deployment item resource's api_version and kind are all null in the list_namespaced_deployment return data.  **What you expected to happen**: every deployment...
kubernetes.client.exceptions.ApiException: (500) when I tried to execute on kubernetes client for one of the pods > res = stream(client.connect_get_namespaced_pod_exec(pod_name, ns, container=container_name, command=comm,stderr=True, stdin=False,stdout=True, tty=False)) > kubernetes.client.exceptions.ApiException: (500) > Reason: Internal...
**What happened (please include outputs or screenshots)**: I'm using python client to receive job status from kubernetes API. However it seemed like it doesn't report job status properly. **Actual** `status.failed`...
When I query nonexistent resource type, I got ApiException: ``` kubernetes.client.exceptions.ApiException: (404) Reason: Not Found HTTP response headers: HTTPHeaderDict({'Audit-Id': '9954faf3-7258-4619-b6b4-c3ac0b55a340', 'Cache-Control': 'no-cache, private', 'Content-Type': 'text/plain; charset=utf-8', 'X-Content-Type-Options': 'nosniff', 'X-Kubernetes-Pf-Flowschema-Uid': 'cee19ddf-4747-45cb-93a7-e774fe2a061e',...
Please consider to drop dependency on mock. unittest.mock can be used, as a fallback at least. As far as I tested, it works at least with 3.8, 3.9 and 3.10.
**What happened (please include outputs or screenshots)**: Here's me using `kubectl`. I'm just expecting the equiv. Python to work. ``` → export KUBECONFIG=~/.kube/config → kubectl get no NAME STATUS ROLES...
**What happened (please include outputs or screenshots)**: Traceback (most recent call last): File "/Users/frenkdefrog/DevOps/poc/getresources.py", line 99, in main() File "/Users/frenkdefrog/DevOps/poc/getresources.py", line 83, in main eksResult=eks.retrieveResource(resource, resourceToCheck[resource]) File "/Users/frenkdefrog/DevOps/poc/basic.py", line 57,...
**What is the feature and why do you need it**: In kubernetes-client/python-base#234 the parsing of BOOKMARK events has been bypassed ([and still is as of today](https://github.com/kubernetes-client/python/blob/master/kubernetes/base/watch/watch.py#L103)). But those events exist...