{"action":"created","issue":{"url":"https://api.github.com/repos/rancher/rancher/issues/3893","repository_url":"https://api.github.com/repos/rancher/rancher","labels_url":"https://api.github.com/repos/rancher/rancher/issues/3893/labels{/name}","comments_url":"https://api.github.com/repos/rancher/rancher/issues/3893/comments","events_url":"https://api.github.com/repos/rancher/rancher/issues/3893/events","html_url":"https://github.com/rancher/rancher/issues/3893","id":139664716,"number":3893,"title":"Autoscale of hosts and containers based on thresholds on the metrics","user":{"login":"LRancez","id":131344,"avatar_url":"https://avatars.githubusercontent.com/u/131344?v=3","gravatar_id":"","url":"https://api.github.com/users/LRancez","html_url":"https://github.com/LRancez","followers_url":"https://api.github.com/users/LRancez/followers","following_url":"https://api.github.com/users/LRancez/following{/other_user}","gists_url":"https://api.github.com/users/LRancez/gists{/gist_id}","starred_url":"https://api.github.com/users/LRancez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LRancez/subscriptions","organizations_url":"https://api.github.com/users/LRancez/orgs","repos_url":"https://api.github.com/users/LRancez/repos","events_url":"https://api.github.com/users/LRancez/events{/privacy}","received_events_url":"https://api.github.com/users/LRancez/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rancher/rancher/labels/kind/enhancement","name":"kind/enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/rancher/rancher/labels/release/future","name":"release/future","color":"afcacc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2016-03-09T18:42:02Z","updated_at":"2016-03-11T18:59:40Z","closed_at":null,"body":"This enhancement request is based on:\r\nhttps://forums.rancher.com/t/rancher-host-autoscaling/1098\r\n\r\nThe idea is that we could configure the some thresholds on the metrics to scale up or scale down. This can be applied to the containers, and also to the hosts using the apis for host creation in the clouds.\r\nWe should probably need to be able to configure a minimum of containers and/or host when the autoscale is enabled so it doesn't necessarily kill everything on very low workload. Also a maximum so memory leaks or internal error don't make everything grow indefinitely.\r\n\r\nThinking in the current structure of Rancher, I imagine that the autoscale for host can be at the environment level of configuration and monitoring thresholds that apply to the hosts metrics. Note that autoscaling the host not necessarily means to autoscale the containers in the host. This probably should be combined with the containers autoscaling to move or scale the containers around to leverage the workload.\r\nThe containers autoscale can be simply at the service levels monitoring thresholds of the containers that had this enabled.\r\n\r\nThe flow that I imagine is:\r\n-  The user configures a min threshold and a max threshold to one or more metrics that he want to react to.\r\n-  The user configures a scale activation group of thresholds.\r\n-  When the metric past the min or max threshold on a metric, activates a warning signal.\r\n-  When the metric stabilizes, the warning signal is deactivated.\r\n-  When all the metrics in the scale activation group are in a warning state, Rancher will react scaling up or down according to the configuration and it will set the scale activation group with a warning signal. Only one scale up or down should go at the same time to maintain consistency.\r\n-  When the scale is completed, the metrics warn signals should be reviewed. If all the warn of the thresholds are still in a warning state, an no minimum or maximum scale had been reached, Rancher should scale again.\r\n\r\nI personally believe that this feature will be extremely useful for cloud environments. What do you think?\r\n\r\nBest,"},"comment":{"url":"https://api.github.com/repos/rancher/rancher/issues/comments/195498786","html_url":"https://github.com/rancher/rancher/issues/3893#issuecomment-195498786","issue_url":"https://api.github.com/repos/rancher/rancher/issues/3893","id":195498786,"user":{"login":"dbones","id":183849,"avatar_url":"https://avatars.githubusercontent.com/u/183849?v=3","gravatar_id":"","url":"https://api.github.com/users/dbones","html_url":"https://github.com/dbones","followers_url":"https://api.github.com/users/dbones/followers","following_url":"https://api.github.com/users/dbones/following{/other_user}","gists_url":"https://api.github.com/users/dbones/gists{/gist_id}","starred_url":"https://api.github.com/users/dbones/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dbones/subscriptions","organizations_url":"https://api.github.com/users/dbones/orgs","repos_url":"https://api.github.com/users/dbones/repos","events_url":"https://api.github.com/users/dbones/events{/privacy}","received_events_url":"https://api.github.com/users/dbones/received_events","type":"User","site_admin":false},"created_at":"2016-03-11T18:59:40Z","updated_at":"2016-03-11T18:59:40Z","body":"+1"}}