From d125b9ea41e422a1b3ab824ac778cc0efe930983 Mon Sep 17 00:00:00 2001 From: yliao Date: Fri, 9 Jan 2026 18:12:30 +0000 Subject: [PATCH 1/3] updated the compatibility matrix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2f87aa186..f5877c1d82 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ supported versions of Kubernetes clusters. - [client 32.y.z](https://pypi.org/project/kubernetes/32.0.1/): Kubernetes 1.31 or below (+-), Kubernetes 1.32 (✓), Kubernetes 1.33 or above (+-) - [client 33.y.z](https://pypi.org/project/kubernetes/33.1.0/): Kubernetes 1.32 or below (+-), Kubernetes 1.33 (✓), Kubernetes 1.34 or above (+-) - [client 34.y.z](https://pypi.org/project/kubernetes/34.1.0/): Kubernetes 1.33 or below (+-), Kubernetes 1.34 (✓), Kubernetes 1.35 or above (+-) -- [client 35.y.z](https://pypi.org/project/kubernetes/35.0.0a1/): Kubernetes 1.34 or below (+-), Kubernetes 1.35 (✓), Kubernetes 1.36 or above (+-) +- [client 35.y.z](https://pypi.org/project/kubernetes/35.0.0b1/): Kubernetes 1.34 or below (+-), Kubernetes 1.35 (✓), Kubernetes 1.36 or above (+-) > See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release. From f97b071976db89946e1b86df9f3e08317171fb9c Mon Sep 17 00:00:00 2001 From: Hency Raj Date: Sun, 11 Jan 2026 21:14:43 +0530 Subject: [PATCH 2/3] examples: add README and improve error handling in apply_from_dict --- examples/README.md | 12 ++++++++++++ examples/apply_from_dict.py | 15 +++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/examples/README.md b/examples/README.md index 618e840ea3..d84c633ae2 100644 --- a/examples/README.md +++ b/examples/README.md @@ -15,3 +15,15 @@ installed following the directions If you find a problem please file an [issue](https://github.com/kubernetes-client/python/issues). + + +--- + +## Running Examples Locally + +### Prerequisites + +- Python 3.8 or newer +- Kubernetes Python client installed: + ```bash + pip install kubernetes diff --git a/examples/apply_from_dict.py b/examples/apply_from_dict.py index 9c0ac81242..972d42529d 100644 --- a/examples/apply_from_dict.py +++ b/examples/apply_from_dict.py @@ -1,3 +1,7 @@ +import sys +from kubernetes.client.rest import ApiException + + from kubernetes import client, config, utils def main(): config.load_kube_config() @@ -6,5 +10,12 @@ def main(): example_dict = {'apiVersion': 'apps/v1', 'kind': 'Deployment', 'metadata': {'name': 'k8s-py-client-nginx'}, 'spec': {'selector': {'matchLabels': {'app': 'nginx'}}, 'replicas': 1, 'template': {'metadata': {'labels': {'app': 'nginx'}}, 'spec': {'containers': [{'name': 'nginx', 'image': 'nginx:1.14.2', 'ports': [{'containerPort': 80}]}]}}}} utils.create_from_dict(k8s_client, example_dict) -if __name__ == '__main__': - main() \ No newline at end of file +if __name__ == "__main__": + try: + main() + except ApiException as e: + print(f"Kubernetes API error: {e}", file=sys.stderr) + sys.exit(1) + except Exception as e: + print(f"Unexpected error: {e}", file=sys.stderr) + sys.exit(2) From 99f439a07e086edd33553baeaae83457f619ca9f Mon Sep 17 00:00:00 2001 From: yliao Date: Thu, 15 Jan 2026 01:29:22 +0000 Subject: [PATCH 3/3] updated compatibility matrix and maintenance status --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f5877c1d82..db330e02b9 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ supported versions of Kubernetes clusters. - [client 32.y.z](https://pypi.org/project/kubernetes/32.0.1/): Kubernetes 1.31 or below (+-), Kubernetes 1.32 (✓), Kubernetes 1.33 or above (+-) - [client 33.y.z](https://pypi.org/project/kubernetes/33.1.0/): Kubernetes 1.32 or below (+-), Kubernetes 1.33 (✓), Kubernetes 1.34 or above (+-) - [client 34.y.z](https://pypi.org/project/kubernetes/34.1.0/): Kubernetes 1.33 or below (+-), Kubernetes 1.34 (✓), Kubernetes 1.35 or above (+-) -- [client 35.y.z](https://pypi.org/project/kubernetes/35.0.0b1/): Kubernetes 1.34 or below (+-), Kubernetes 1.35 (✓), Kubernetes 1.36 or above (+-) +- [client 35.y.z](https://pypi.org/project/kubernetes/35.0.0/): Kubernetes 1.34 or below (+-), Kubernetes 1.35 (✓), Kubernetes 1.36 or above (+-) > See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release. @@ -173,12 +173,13 @@ between client-python versions. | 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 | ✓ | +| 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 | ✓ | | 34.1 Alpha/Beta | Kubernetes main repo, 1.34 branch | ✗ | | 34.1 | Kubernetes main repo, 1.34 branch | ✓ | -| 35.0 Alpha/Beta | Kubernetes main repo, 1.35 branch | ✓ | +| 35.0 Alpha/Beta | Kubernetes main repo, 1.35 branch | ✗ | +| 35.0 | Kubernetes main repo, 1.35 branch | ✓ | > See [here](#homogenizing-the-kubernetes-python-client-versions) for an explanation of why there is no v13-v16 release.