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

Add DeploymentRollback resource #404

Closed
ravilr opened this issue May 18, 2016 · 13 comments
Closed

Add DeploymentRollback resource #404

ravilr opened this issue May 18, 2016 · 13 comments

Comments

@ravilr
Copy link
Contributor

ravilr commented May 18, 2016

@jimmidyson @iocanel
Can we get this added:
http://kubernetes.io/docs/api-reference/extensions/v1beta1/definitions/#_v1beta1_deploymentrollback

@iocanel
Copy link
Member

iocanel commented May 19, 2016

@ravilr: Yeah I think that we could.

@jimmidyson
Copy link
Contributor

@ravilr Do you know how to use this resource? I can't see any examples for it anywhere. Is this actually a managed resource or an internal representation?

@ravilr
Copy link
Contributor Author

ravilr commented May 25, 2016

from http://kubernetes.io/docs/api-reference/extensions/v1beta1/operations/ (there isn't a direct permalink to the actual operation):

create rollback of a DeploymentRollback
POST /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback
with bodyParameter as v1beta1.DeploymentRollback

so, this looks like being used in subresource rollback operation of deployment resource.

For our use case, where we deploy multiple deployment resources for an app, i realized that it is better to keep the source definition of the deployments in version control somewhere, change it there and keep applying/replace() that, even for rollbacks, rather than using this operation.

@jimmidyson
Copy link
Contributor

Agreed. We don't support any subresources at the moment so until we do you've come up with the best solution. I'm going to close this issue & raise another one to discuss subresources in general as we need to support them properly.

@Siva10
Copy link

Siva10 commented Oct 22, 2018

/help wanted
@jimmidyson Hi . I would like to use the API
POST /apis/extensions/v1beta1/namespaces/{namespace}/deployments/{name}/rollback
to rollback a deployment to its previous version in rollout history.
Is there any proposal to support this feature in your roadmap ? Or to achieve this do we have to still do replace() as mentioned by @ravilr ?
Thanks in advance

@Zephery
Copy link

Zephery commented Jun 6, 2019

+1 anyone can help?

@doyard
Copy link

doyard commented Jun 6, 2019

+1

@rohanKanojia rohanKanojia reopened this Jun 6, 2019
@stale
Copy link

stale bot commented Sep 4, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale label Sep 4, 2019
@stale stale bot closed this as completed Sep 11, 2019
@rohanKanojia rohanKanojia reopened this Sep 11, 2019
@stale stale bot removed the status/stale label Sep 11, 2019
@stale
Copy link

stale bot commented Dec 10, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@rohanKanojia
Copy link
Member

I think we already have support for DeploymentRollback resource

public void testRollback() {
DeploymentRollback deploymentRollback = new DeploymentRollbackBuilder()
.withName("deployment1")
.withNewRollbackTo().withRevision(1l).endRollbackTo()
.withUpdatedAnnotations(Collections.singletonMap("foo", "bar"))
.build();
Status status = new StatusBuilder().build();
KubernetesClient client = server.getClient();
server.expect()
.post()
.withPath("/apis/extensions/v1beta1/namespaces/test/deployments/deployment1/rollback")
.andReturn(201, status).once();
client.extensions().deployments().inNamespace("test").withName("deployment1").rollback(deploymentRollback);
}

@rohanKanojia
Copy link
Member

Yeah, I'm aware of this. But it's still there in Kubernetes 1.17. We need to consider this whenever kubernetes folks decide to remove it's support in future releases.

@ashwiniramesha
Copy link

ashwiniramesha commented Jun 3, 2020

rollback is officially removed in apps/v1 version. I'm using Kubernetes 1.18

ref: kubernetes/client-go#398 (comment)
kubernetes/client-go#346

Is there an alternative available in fabric8io to perform deployment rollbacks with the following steps?

  1. List all ReplicaSets the Deployment owns
  2. Find the ReplicaSet of a specific revision
  3. Copy that ReplicaSet's template back to the Deployment's template

Trying the above way of rolling back results in following exception:

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://10.44.4.126:6443/apis/apps/v1/namespaces/default/deployments/nginx/rollback. Message: the server could not find the requested resource. Received status: Status(apiVersion=v1, code=404, details=StatusDetails(causes=[], group=null, kind=null, name=null, retryAfterSeconds=null, uid=null, additionalProperties={}), kind=Status, message=the server could not find the requested resource, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=NotFound, status=Failure, additionalProperties={}).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants