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

Deployment Undo doesn't undo number of replicas #25236

Closed
aronchick opened this issue May 5, 2016 · 13 comments
Closed

Deployment Undo doesn't undo number of replicas #25236

aronchick opened this issue May 5, 2016 · 13 comments
Labels
area/app-lifecycle area/workload-api/deployment kind/documentation Categorizes issue or PR as related to documentation. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/apps Categorizes an issue or PR as relevant to SIG Apps.

Comments

@aronchick
Copy link
Contributor

Execute the following:

kubectl create -f app-deployment.yml
kubectl scale deployment app-deployment --replicas=10
# Edit app-deployment.yml to make a change
kubectl apply -f app-deployment.yml # Replicas=4 in this file
kubectl rollout undo deployment/app-deployment

This results in 4 replicas running, instead of the expected 10 (since the deployment was undone).

@aronchick
Copy link
Contributor Author

Related? #22512

@roberthbailey
Copy link
Contributor

/cc @janetkuo

@roberthbailey
Copy link
Contributor

@aronchick is this a dupe of #25238?

@bgrant0607 bgrant0607 added priority/backlog Higher priority than priority/awaiting-more-evidence. kind/documentation Categorizes issue or PR as related to documentation. labels May 9, 2016
@bgrant0607
Copy link
Member

This is working as intended. Scaling is orthogonal to deployment.

What if the user set up HPA? Should HPA's changes be undone?

Scale is set/changed at least 3 different ways above (create, scale, apply). In that scenario, there's no way we could infer user intent regarding whether they expected scale to be undone or not. Note that the Deployment API doesn't really know the difference between apply and other commands, and apply doesn't itself cause Deployment versioning to happen. It's changes in the pod template spec that do, and scaling doesn't change the pod template spec.

@janetkuo is this documented in undo?

@janetkuo
Copy link
Member

janetkuo commented May 9, 2016

@janetkuo is this documented in undo?

Yes, it is in http://kubernetes.io/docs/user-guide/deployments/#rolling-back-a-deployment:

You should note that only the update to the Deployment’s “pod template” is seen as a different revision of rollout.

@janetkuo
Copy link
Member

janetkuo commented May 9, 2016

I'll make it more obvious, considering most people would skim the doc.

@janetkuo
Copy link
Member

janetkuo commented May 9, 2016

Updated docs kubernetes/website#484

@janetkuo
Copy link
Member

Closing since doc is updated

@aronchick aronchick reopened this May 25, 2016
@aronchick
Copy link
Contributor Author

I didn't intend to change both # of replicas & image; i overlooked the fact that the # of replicas was different when I rolled out the new image.

I have a new template that has a number of replicas in it. When I applied that new template, it used that new number in it.

It still feels, for better or worse, that ANY changes I made should be "undone" when I roll back given what I'm doing. Documentation will not address this - years of hitting cmd-Z on my laptop tells me that whatever I just did is now rolled back, that's what this felt like.

Alternative may be if you're doing a roll out that changes multiple things, maybe we highlight that?

$ kubectl apply -f new_ds.yml
This change will apply the following changes:
replicas: 5 -> 7
image: foo -> bar
y/n?

Doesn't solve my problem entirely - since when I undo/rollback, I still would have expected 7 to go back to 5 and bar to go back to foo.

@bgrant0607 bgrant0607 changed the title Deployment Undo Restores wrong number of replicas Deployment Undo doesn't undo number of replicas May 31, 2016
@0xmichalis
Copy link
Contributor

We could make it configurable at the very least. Something like --change-scaling-settings (we already do this in OpenShift with oc rollback. ). @pwittrock this is where we need to know the last size for a replica set and https://github.com/kubernetes/kubernetes/pull/28162/files#diff-9035ca88b01f4a0aab7c52b8bf8a753fR79 will be useful

@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.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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 22, 2017
@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
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jan 21, 2018
@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 21, 2018
@bgrant0607
Copy link
Member

Working as intended

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/app-lifecycle area/workload-api/deployment kind/documentation Categorizes issue or PR as related to documentation. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. priority/backlog Higher priority than priority/awaiting-more-evidence. sig/apps Categorizes an issue or PR as relevant to SIG Apps.
Projects
None yet
Development

No branches or pull requests

7 participants