{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14744","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14744/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14744/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14744/events","html_url":"https://github.com/kubernetes/kubernetes/issues/14744","id":108883828,"number":14744,"title":"Deployment does not scale down","user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/priority/P1","name":"priority/P1","color":"eb6420"}],"state":"open","locked":false,"assignee":{"login":"nikhiljindal","id":10199099,"avatar_url":"https://avatars.githubusercontent.com/u/10199099?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhiljindal","html_url":"https://github.com/nikhiljindal","followers_url":"https://api.github.com/users/nikhiljindal/followers","following_url":"https://api.github.com/users/nikhiljindal/following{/other_user}","gists_url":"https://api.github.com/users/nikhiljindal/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhiljindal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhiljindal/subscriptions","organizations_url":"https://api.github.com/users/nikhiljindal/orgs","repos_url":"https://api.github.com/users/nikhiljindal/repos","events_url":"https://api.github.com/users/nikhiljindal/events{/privacy}","received_events_url":"https://api.github.com/users/nikhiljindal/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/13","html_url":"https://github.com/kubernetes/kubernetes/milestones/v1.1","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones/13/labels","id":1220916,"number":13,"title":"v1.1","description":"Release 1.1.\r\n\r\nP1 features:\r\n* 250 nodes\r\n* kube-proxy perf. improvements (via IPTables)\r\n* Docker 1.8.x\r\n* Horizontal pod auto-scaling\r\n* Job Object\r\n* Schema validation in kubectl\r\n* Experimental API and API groups\r\n* Graceful pod termination\r\n","creator":{"login":"bgrant0607","id":7725777,"avatar_url":"https://avatars.githubusercontent.com/u/7725777?v=3","gravatar_id":"","url":"https://api.github.com/users/bgrant0607","html_url":"https://github.com/bgrant0607","followers_url":"https://api.github.com/users/bgrant0607/followers","following_url":"https://api.github.com/users/bgrant0607/following{/other_user}","gists_url":"https://api.github.com/users/bgrant0607/gists{/gist_id}","starred_url":"https://api.github.com/users/bgrant0607/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bgrant0607/subscriptions","organizations_url":"https://api.github.com/users/bgrant0607/orgs","repos_url":"https://api.github.com/users/bgrant0607/repos","events_url":"https://api.github.com/users/bgrant0607/events{/privacy}","received_events_url":"https://api.github.com/users/bgrant0607/received_events","type":"User","site_admin":false},"open_issues":86,"closed_issues":102,"state":"open","created_at":"2015-07-22T19:17:12Z","updated_at":"2015-09-29T14:38:01Z","due_on":"2015-09-21T07:00:00Z","closed_at":null},"comments":1,"created_at":"2015-09-29T14:37:46Z","updated_at":"2015-09-29T14:41:20Z","closed_at":null,"body":"Scaling down doesn't work for Deployments in the following scenario:\r\n\r\n1. create a simple deployment with 5 replicas\r\n2. wait for rc/pods to be created and running\r\n3. update deployment, change the number of replicas to 1\r\nresult: the rc is never scaled down to 1, its size is 5 all the time.\r\n\r\nThe problems seems to be in scaleUp method:\r\nhttps://github.com/kubernetes/kubernetes/blob/master/pkg/controller/deployment/deployment_controller.go#L234\r\nThis method should actually **scale down** the new rc, but it seems it doesn't due to condition in:\r\nhttps://github.com/kubernetes/kubernetes/blob/master/pkg/controller/deployment/deployment_controller.go#L254\r\n(Please not that scaleDown method works only on old rcs, but there are no old rcs in our scenario).\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/144081274","html_url":"https://github.com/kubernetes/kubernetes/issues/14744#issuecomment-144081274","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/14744","id":144081274,"user":{"login":"jszczepkowski","id":10820769,"avatar_url":"https://avatars.githubusercontent.com/u/10820769?v=3","gravatar_id":"","url":"https://api.github.com/users/jszczepkowski","html_url":"https://github.com/jszczepkowski","followers_url":"https://api.github.com/users/jszczepkowski/followers","following_url":"https://api.github.com/users/jszczepkowski/following{/other_user}","gists_url":"https://api.github.com/users/jszczepkowski/gists{/gist_id}","starred_url":"https://api.github.com/users/jszczepkowski/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jszczepkowski/subscriptions","organizations_url":"https://api.github.com/users/jszczepkowski/orgs","repos_url":"https://api.github.com/users/jszczepkowski/repos","events_url":"https://api.github.com/users/jszczepkowski/events{/privacy}","received_events_url":"https://api.github.com/users/jszczepkowski/received_events","type":"User","site_admin":false},"created_at":"2015-09-29T14:41:20Z","updated_at":"2015-09-29T14:41:20Z","body":"I discovered this issue when I was manually testing horizontal pod autoscaler with deployments. (Please note that scale up works fine with autoscaling)."}}