{"action":"created","issue":{"url":"https://api.github.com/repos/contiv/cluster/issues/160","repository_url":"https://api.github.com/repos/contiv/cluster","labels_url":"https://api.github.com/repos/contiv/cluster/issues/160/labels{/name}","comments_url":"https://api.github.com/repos/contiv/cluster/issues/160/comments","events_url":"https://api.github.com/repos/contiv/cluster/issues/160/events","html_url":"https://github.com/contiv/cluster/issues/160","id":163899329,"number":160,"title":"Proposal: implement node configuration update","user":{"login":"mapuri","id":9538438,"avatar_url":"https://avatars.githubusercontent.com/u/9538438?v=3","gravatar_id":"","url":"https://api.github.com/users/mapuri","html_url":"https://github.com/mapuri","followers_url":"https://api.github.com/users/mapuri/followers","following_url":"https://api.github.com/users/mapuri/following{/other_user}","gists_url":"https://api.github.com/users/mapuri/gists{/gist_id}","starred_url":"https://api.github.com/users/mapuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapuri/subscriptions","organizations_url":"https://api.github.com/users/mapuri/orgs","repos_url":"https://api.github.com/users/mapuri/repos","events_url":"https://api.github.com/users/mapuri/events{/privacy}","received_events_url":"https://api.github.com/users/mapuri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"mapuri","id":9538438,"avatar_url":"https://avatars.githubusercontent.com/u/9538438?v=3","gravatar_id":"","url":"https://api.github.com/users/mapuri","html_url":"https://github.com/mapuri","followers_url":"https://api.github.com/users/mapuri/followers","following_url":"https://api.github.com/users/mapuri/following{/other_user}","gists_url":"https://api.github.com/users/mapuri/gists{/gist_id}","starred_url":"https://api.github.com/users/mapuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapuri/subscriptions","organizations_url":"https://api.github.com/users/mapuri/orgs","repos_url":"https://api.github.com/users/mapuri/repos","events_url":"https://api.github.com/users/mapuri/events{/privacy}","received_events_url":"https://api.github.com/users/mapuri/received_events","type":"User","site_admin":false},"assignees":[{"login":"mapuri","id":9538438,"avatar_url":"https://avatars.githubusercontent.com/u/9538438?v=3","gravatar_id":"","url":"https://api.github.com/users/mapuri","html_url":"https://github.com/mapuri","followers_url":"https://api.github.com/users/mapuri/followers","following_url":"https://api.github.com/users/mapuri/following{/other_user}","gists_url":"https://api.github.com/users/mapuri/gists{/gist_id}","starred_url":"https://api.github.com/users/mapuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapuri/subscriptions","organizations_url":"https://api.github.com/users/mapuri/orgs","repos_url":"https://api.github.com/users/mapuri/repos","events_url":"https://api.github.com/users/mapuri/events{/privacy}","received_events_url":"https://api.github.com/users/mapuri/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-07-05T17:04:52Z","updated_at":"2016-07-11T23:09:13Z","closed_at":null,"body":"This proposal describes a way to implement configuration updates for nodes. \r\n\r\n### Background:\r\ncluster-mgr provides a maintenance workflow, however it was left unimplemented initially to get a little more clear understanding of such a workflow. A few common scenarios that I have seen over period of time where a node may need configuration update are:\r\n- upgrade package binaries by running newer version of ansible playbooks\r\n- run a new ansible playbook to get script fixes and enhancements (like etcd scripts)\r\nOther than the above, another scenario that is not addressed today as a **single workflow** is ability to change a node's role/host-group.\r\n\r\n### Overview\r\n- rename `maintenance` endpoint to `update` to more clearly bring out the behavior it supports\r\n- In the initial implementation, `update` would involve running a cleanup followed by provision playbooks on one or more nodes\r\n- the `update` workflow will optionally accept the `host-group` parameter that shall allow changing the host-group of the node(s) to the one specified as the parameter value.\r\n\r\n### Details:\r\n\r\n#### node lifecycle:\r\nOn `Update`, the node(s) shall be moved to `InMaintenance` status where a cleanup followed by provision playbooks shall be run on specified nodes. \r\nOn success, node(s) shall be moved back to `Commissioned` status.\r\nIn case of failure, the cleanup playbook shall be run again to avoid any leftover state and node(s) shall be moved to `Unallocated` status\r\n\r\n#### managing host-group\r\nAll nodes shall be reassigned to the host-group specified by the `host-group` flag. If no flag is provided then there are two possible options:\r\n**Option1:** the nodes shall remain in their last assigned host-group.\r\n\r\n**Pros**:\r\n- allows for easy update entire cluster\r\n\r\n**Cons**:\r\n- can be disruptive is user chooses all nodes at once. However, this can be addressed in future once we have playbook designed for rolling upgrades.\r\n- if user specifies the optional host-group flag then it can accidentally reassign all nodes to the new host-group (especially `service-master`), see **special scenarios** below.\r\n- behavior might be less intuitive when `host-group` flag is provided as it reassigns all nodes to same host-group but not specifying the flag keeps nodes in respective host-groups.\r\n\r\n**Option2:** Only nodes in same host-group shall be allowed to be updated in one go i.e. the API will throw an error if user specifies nodes belonging to different host-groups.\r\n\r\n**Pros**:\r\n- the behavior associated with or without flag is more intuitive i.e. all nodes either retain their host-group (which is the same) or are reassigned to a new host-group.\r\n\r\n**Cons**:\r\n- makes it hard to upgrade entire cluster in one shot as nodes belonging to different groups can't be specified together.\r\n\r\nGiving an ability to update the entire cluster in single workflow seems more useful to an admin, so **Option 1** is chosen for this proposal.\r\n \r\n**Special scenarios**\r\n- User tries configure/reassign all nodes as `service-worker`. This shall result in an API error\r\n\r\n#### UX\r\n\r\n##### REST endpoint\r\n- **POST**: /update/nodes\r\n\r\n  **Body**: {\r\n   \"nodes\" : [tag1, tag2 ...]\r\n   \"host-group\" : \"service-master | service-worker\"\r\n   }\r\n\r\n   **Response**:\r\n   - 200 : on successfully triggering of the update job and node(s) are moved to `InMaintenance` status\r\n   - 500 : on error like special error scenario mentioned above\r\n- **POST**: /update/node/{tag} : **this is mostly for consistency with existing endpoints**\r\n\r\n  **Body**: {\r\n   \"host-group\" : \"service-master | service-worker\"\r\n   }\r\n\r\n   **Response**:\r\n   - 200 : on successfully triggering of the update job and node(s) are moved to `InMaintenance` status\r\n   - 500 : on error like special error scenario mentioned above\r\n\r\n##### CLI\r\n- clusterctl node update [--host-group=< service-worker|service-master >] < tag >\r\n- clusterctl nodes update [--host-group=< service-worker|service-master >] < tag1 > < tag2 > ...\r\n\r\n/cc :\r\n@vvb for overall proposal\r\n@rkharya for use-case review\r\n@vishal-j for UX"},"comment":{"url":"https://api.github.com/repos/contiv/cluster/issues/comments/231892429","html_url":"https://github.com/contiv/cluster/issues/160#issuecomment-231892429","issue_url":"https://api.github.com/repos/contiv/cluster/issues/160","id":231892429,"user":{"login":"mapuri","id":9538438,"avatar_url":"https://avatars.githubusercontent.com/u/9538438?v=3","gravatar_id":"","url":"https://api.github.com/users/mapuri","html_url":"https://github.com/mapuri","followers_url":"https://api.github.com/users/mapuri/followers","following_url":"https://api.github.com/users/mapuri/following{/other_user}","gists_url":"https://api.github.com/users/mapuri/gists{/gist_id}","starred_url":"https://api.github.com/users/mapuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapuri/subscriptions","organizations_url":"https://api.github.com/users/mapuri/orgs","repos_url":"https://api.github.com/users/mapuri/repos","events_url":"https://api.github.com/users/mapuri/events{/privacy}","received_events_url":"https://api.github.com/users/mapuri/received_events","type":"User","site_admin":false},"created_at":"2016-07-11T23:09:13Z","updated_at":"2016-07-11T23:09:13Z","body":"I created #163 with code changes and also filed #164 to track `node` endpoint cleanup"}}
{"actor":{"display_login":"mapuri"}}