Unable to use create_namespaced_deployment_rollback in Kubernetes 1.16+
See original GitHub issueWhat happened (please include outputs or screenshots):
Got a 404 error from the Kubernetes API due to the fact that both ExtensionsV1beta1Api
and AppsV1beta1Api
are deprecated in Kubernetes 1.16
The recently released 12.0.0a1 is supposed to have Kubernetes 1.16 support, but also doesn’t have rollback with the proper API AppsV1Api
https://github.com/kubernetes-client/python/blob/v12.0.0a1/kubernetes/README.md
File "/usr/lib/python3.8/site-packages/kubernetes/client/apis/apps_v1beta1_api.py", line 291, in create_namespaced_deployment_rollback
(data) = self.create_namespaced_deployment_rollback_with_http_info(name, namespace, body, **kwargs)
File "/usr/lib/python3.8/site-packages/kubernetes/client/apis/apps_v1beta1_api.py", line 375, in create_namespaced_deployment_rollback_with_http_info
return self.api_client.call_api('/apis/apps/v1beta1/namespaces/{namespace}/deployments/{name}/rollback', 'POST',
File "/usr/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 330, in call_api
return self.__call_api(resource_path, method,
File "/usr/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 163, in __call_api
response_data = self.request(method, url,
File "/usr/lib/python3.8/site-packages/kubernetes/client/api_client.py", line 371, in request
return self.rest_client.POST(url,
File "/usr/lib/python3.8/site-packages/kubernetes/client/rest.py", line 260, in POST
return self.request("POST", url,
File "/usr/lib/python3.8/site-packages/kubernetes/client/rest.py", line 222, in request
raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (404)
Reason: Not Found
What you expected to happen:
There should be a create_namespaced_deployment_rollback
in the AppsV1Api
Class so that it uses the non-deprecated API
How to reproduce it (as minimally and precisely as possible): Attempt to rollback a deployment with either API against a cluster running 1.16:
api_response = client.AppsV1beta1Api().create_namespaced_deployment_rollback(
name=deployment_name,
namespace=namespace,
body=body,
_preload_content=False)
OR
api_response = client.ExtensionsV1beta1Api().create_namespaced_deployment_rollback(
name=deployment_name,
namespace=namespace,
body=body,
_preload_content=False)
Environment:
- Kubernetes version (
kubectl version
): 1.16.11 - Python version (
python --version
) 3.8.5 - Python client version (
pip list | grep kubernetes
) 12.0.0a1
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:16 (3 by maintainers)
Top Results From Across the Web
Kubernetes 1.16: Custom Resources, Overhauled Metrics ...
Major Themes Custom resources CRDs are in widespread use as a Kubernetes ... error: unable to recognize "deployment": no matches for kind ...
Read more >Kubernetes 1.16 deprecated APIs - Google Cloud
After upgrading the clusters to Kubernetes 1.16, the same command will automatically use the new API. You can explicitly specify an API group...
Read more >Troubleshoot Azure Kubernetes Services issues
Documentation for troubleshooting common issues with Azure Kubernetes ... error during an upgrade · Kubernetes 1.16 upgrades fail using node labels ...
Read more >What's new in Kubernetes 1.16? - Sysdig
Ephemeral containers are a great way to debug running pods, as you can't add regular containers to a pod after creation (you should...
Read more >Helm init fails on Kubernetes 1.16.0 · Issue #6374 - GitHub
mihivagyok commented on Sep 19, 2019. If you want to use one less sed :) helm init --service-account tiller --override ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
An interim solution that may help others who stumble upon this issue:
Basically, I’ve reverse-engineered what
kubectl rollout unto ...
appears to be doing.Any update on this Issue?