Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to rollback #1256

Closed
wzg0120 opened this issue Sep 14, 2020 · 9 comments
Closed

unable to rollback #1256

wzg0120 opened this issue Sep 14, 2020 · 9 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@wzg0120
Copy link

wzg0120 commented Sep 14, 2020

What happened (please include outputs or screenshots):

def rollback(self,namespace,name,version): try: rollbackto=client.AppsV1beta1RollbackConfig(revision=version) body=client.ExtensionsV1beta1DeploymentRollback(api_version="extensions/v1beta1",name=name,kind="DeploymentRollback",rollback_to=rollbackto) res=self.extensions_v1beta1.create_namespaced_deployment_rollback(namespace=namespace,name=name,body=body) return True,res.status except: return False,traceback.format_exc()

The result of the operation is:
Connected to pydev debugger (build 192.6262.63)
False:Traceback (most recent call last):
File "D:/WORK/CI/branches/CI/Ci/base/k8scommon/k8s_api.py", line 51, in rollback
res=self.extensions_v1beta1.create_namespaced_deployment_rollback(namespace=namespace,name=name,body=body)
File "D:\vitural\lib\site-packages\kubernetes\client\api\extensions_v1beta1_api.py", line 291, in create_namespaced_deployment_rollback
(data) = self.create_namespaced_deployment_rollback_with_http_info(name, namespace, body, **kwargs) # noqa: E501
File "D:\vitural\CiWeb\lib\site-packages\kubernetes\client\api\extensions_v1beta1_api.py", line 389, in create_namespaced_deployment_rollback_with_http_info
collection_formats=collection_formats)
File "D:\vitural\CiWeb\lib\site-packages\kubernetes\client\api_client.py", line 345, in call_api
_preload_content, _request_timeout)
File "D:\vitural\CiWeb\lib\site-packages\kubernetes\client\api_client.py", line 176, in __call_api
_request_timeout=_request_timeout)
File "D:\vitural\CiWeb\lib\site-packages\kubernetes\client\api_client.py", line 388, in request
body=body)
File "D:\vitural\CiWeb\lib\site-packages\kubernetes\client\rest.py", line 278, in POST
body=body)
File "D:\vitural\CiWeb\lib\site-packages\kubernetes\client\rest.py", line 231, in request
raise ApiException(http_resp=r)
kubernetes.client.rest.ApiException: (404)
Reason: Not Found
HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Mon, 14 Sep 2020 06:24:52 GMT', 'Content-Length': '174'})
HTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}

What you expected to happen:
there have versions1 、2 ,i want rollback to version 1
How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • Kubernetes version (1.17.4):
  • win10:
  • Python version (python -3.6.8)
  • Python client version (11.0.0)
@wzg0120 wzg0120 added the kind/bug Categorizes issue or PR as related to a bug. label Sep 14, 2020
@roycaihw
Copy link
Member

roycaihw commented Sep 14, 2020

the server could not find the requested resource

It looks like the server doesn't host the API, which is weird because IIRC the rollback API gets dropped in 1.18, and should be still available in 1.17. Does kubectl rollout work?

@roycaihw
Copy link
Member

roycaihw commented Sep 14, 2020

The apps/v1beta1 and extensions/v1beta1 API groups are not served by default since 1.16. Have you enabled them in the apiserver? Could you run kubectl api-versions to double check?

@wzg0120
Copy link
Author

wzg0120 commented Sep 16, 2020

The apps/v1beta1 and extensions/v1beta1 API groups are not served by default since 1.16. Have you enabled them in the apiserver? Could you run kubectl api-versions to double check?
@roycaihw
kubectl rollout is ok.

[root@k8smaster02 ~]# kubectl api-versions
admissionregistration.k8s.io/v1
admissionregistration.k8s.io/v1beta1
apiextensions.k8s.io/v1
apiextensions.k8s.io/v1beta1
apiregistration.k8s.io/v1
apiregistration.k8s.io/v1beta1
apps/v1
authentication.k8s.io/v1
authentication.k8s.io/v1beta1
authorization.k8s.io/v1
authorization.k8s.io/v1beta1
autoscaling/v1
autoscaling/v2beta1
autoscaling/v2beta2
batch/v1
batch/v1beta1
certificates.k8s.io/v1beta1
coordination.k8s.io/v1
coordination.k8s.io/v1beta1
discovery.k8s.io/v1beta1
events.k8s.io/v1beta1
extensions/v1beta1
kuboard.cn/v1
metrics.k8s.io/v1beta1
networking.k8s.io/v1
networking.k8s.io/v1beta1
node.k8s.io/v1beta1
policy/v1beta1
rbac.authorization.k8s.io/v1
rbac.authorization.k8s.io/v1beta1
scheduling.k8s.io/v1
scheduling.k8s.io/v1beta1
storage.k8s.io/v1
storage.k8s.io/v1beta1
v1

@tarun-wadhwa-mmt
Copy link

Verified that extensions/v1beta1 is enabled.
kubectl version is 1.16.8

Still getting 404 for rollback request. Tested with kubernetes-client 12.0.0b1 as well..

\n(404)\nReason: Not Found\nHTTP response headers: HTTPHeaderDict({'Date': 'Fri, 25 Sep 2020 08:32:26 GMT', 'Content-Length': '174', 'Content-Type': 'application/json', 'Cache-Control': 'no-cache, private'})\nHTTP response body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}\n\n"

@tarun-wadhwa-mmt
Copy link

Found another issue which raises same problem. kubernetes 12 should use apps/v1 for rollback since apps/v1beta1 and extensions/v1beta1 seems deprecated

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 24, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 23, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants