{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/paasta/pulls/comments/212562450","pull_request_review_id":149223378,"id":212562450,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMjU2MjQ1MA==","diff_hunk":"@@ -529,53 +575,106 @@ def format_kubernetes_app(self) -> V1Deployment:\n             aws_ebs_volumes = self.get_aws_ebs_volumes()\n \n             code_sha = get_code_sha_from_dockerurl(docker_url)\n-            complete_config = V1Deployment(\n-                api_version='apps/v1',\n-                kind='Deployment',\n-                metadata=V1ObjectMeta(\n-                    name=\"{service}-{instance}\".format(\n-                        service=self.get_sanitised_service_name(),\n-                        instance=self.get_sanitised_instance_name(),\n+            if self.get_persistent_volumes():\n+                complete_config = V1StatefulSet(\n+                    api_version='apps/v1',\n+                    kind='StatefulSet',\n+                    metadata=V1ObjectMeta(\n+                        name=\"{service}-{instance}\".format(","path":"paasta_tools/kubernetes_tools.py","position":126,"original_position":126,"commit_id":"17e7ff5ef285d817f5dcbf8ddb85e06d5bfeab5c","original_commit_id":"17e7ff5ef285d817f5dcbf8ddb85e06d5bfeab5c","user":{"login":"keymone","id":7057,"node_id":"MDQ6VXNlcjcwNTc=","avatar_url":"https://avatars3.githubusercontent.com/u/7057?v=4","gravatar_id":"","url":"https://api.github.com/users/keymone","html_url":"https://github.com/keymone","followers_url":"https://api.github.com/users/keymone/followers","following_url":"https://api.github.com/users/keymone/following{/other_user}","gists_url":"https://api.github.com/users/keymone/gists{/gist_id}","starred_url":"https://api.github.com/users/keymone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/keymone/subscriptions","organizations_url":"https://api.github.com/users/keymone/orgs","repos_url":"https://api.github.com/users/keymone/repos","events_url":"https://api.github.com/users/keymone/events{/privacy}","received_events_url":"https://api.github.com/users/keymone/received_events","type":"User","site_admin":false},"body":"can you reduce duplication a bit? `name`, `service_name`,  `labels`, `containers`, `volumes`, `replicas` are (as far as i can tell) identical between these two branches.","created_at":"2018-08-24T08:52:42Z","updated_at":"2018-08-24T08:55:11Z","html_url":"https://github.com/Yelp/paasta/pull/1952#discussion_r212562450","pull_request_url":"https://api.github.com/repos/Yelp/paasta/pulls/1952","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/comments/212562450"},"html":{"href":"https://github.com/Yelp/paasta/pull/1952#discussion_r212562450"},"pull_request":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1952"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/paasta/pulls/1952","id":210523347,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEwNTIzMzQ3","html_url":"https://github.com/Yelp/paasta/pull/1952","diff_url":"https://github.com/Yelp/paasta/pull/1952.diff","patch_url":"https://github.com/Yelp/paasta/pull/1952.patch","issue_url":"https://api.github.com/repos/Yelp/paasta/issues/1952","number":1952,"state":"open","locked":false,"title":"Add support for StatefulSets","user":{"login":"mattmb","id":2462243,"node_id":"MDQ6VXNlcjI0NjIyNDM=","avatar_url":"https://avatars0.githubusercontent.com/u/2462243?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmb","html_url":"https://github.com/mattmb","followers_url":"https://api.github.com/users/mattmb/followers","following_url":"https://api.github.com/users/mattmb/following{/other_user}","gists_url":"https://api.github.com/users/mattmb/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmb/subscriptions","organizations_url":"https://api.github.com/users/mattmb/orgs","repos_url":"https://api.github.com/users/mattmb/repos","events_url":"https://api.github.com/users/mattmb/events{/privacy}","received_events_url":"https://api.github.com/users/mattmb/received_events","type":"User","site_admin":false},"body":"This gives the k8s logic the ability to manage StatefulSets. We manage\r\nthem the same way as Deployments. The distinguishing factor is that they\r\nsupport dynamic EBS volumes that follow the Pods. The new yelpsoa syntax\r\nlooks like:\r\n```\r\npersistent_volumes:\r\n  - container_path: /mnt/whatever\r\n    size: 10\r\n    mode: RW\r\n```\r\n\r\nNote this is deliberately a bit MVP. The StorageClass has to be created\r\nby hand and we don't enforce constraints on AZ yet so you must be\r\ncareful to create everything in 1 AZ.","created_at":"2018-08-23T17:37:38Z","updated_at":"2018-08-24T08:55:11Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0a042e5affc41eb231a155dad9be79b7ff50a06d","assignee":{"login":"mattmb","id":2462243,"node_id":"MDQ6VXNlcjI0NjIyNDM=","avatar_url":"https://avatars0.githubusercontent.com/u/2462243?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmb","html_url":"https://github.com/mattmb","followers_url":"https://api.github.com/users/mattmb/followers","following_url":"https://api.github.com/users/mattmb/following{/other_user}","gists_url":"https://api.github.com/users/mattmb/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmb/subscriptions","organizations_url":"https://api.github.com/users/mattmb/orgs","repos_url":"https://api.github.com/users/mattmb/repos","events_url":"https://api.github.com/users/mattmb/events{/privacy}","received_events_url":"https://api.github.com/users/mattmb/received_events","type":"User","site_admin":false},"assignees":[{"login":"mattmb","id":2462243,"node_id":"MDQ6VXNlcjI0NjIyNDM=","avatar_url":"https://avatars0.githubusercontent.com/u/2462243?v=4","gravatar_id":"","url":"https://api.github.com/users/mattmb","html_url":"https://github.com/mattmb","followers_url":"https://api.github.com/users/mattmb/followers","following_url":"https://api.github.com/users/mattmb/following{/other_user}","gists_url":"https://api.github.com/users/mattmb/gists{/gist_id}","starred_url":"https://api.github.com/users/mattmb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattmb/subscriptions","organizations_url":"https://api.github.com/users/mattmb/orgs","repos_url":"https://api.github.com/users/mattmb/repos","events_url":"https://api.github.com/users/mattmb/events{/privacy}","received_events_url":"https://api.github.com/users/mattmb/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":295506239,"node_id":"MDU6TGFiZWwyOTU1MDYyMzk=","url":"https://api.github.com/repos/Yelp/paasta/labels/in%20review","name":"in review","color":"eac04b","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/paasta/pulls/1952/commits","review_comments_url":"https://api.github.com/repos/Yelp/paasta/pulls/1952/comments","review_comment_url":"https://api.github.com/repos/Yelp/paasta/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/paasta/issues/1952/comments","statuses_url":"https://api.github.com/repos/Yelp/paasta/statuses/17e7ff5ef285d817f5dcbf8ddb85e06d5bfeab5c","head":{"label":"Yelp:stateful-sets","ref":"stateful-sets","sha":"17e7ff5ef285d817f5dcbf8ddb85e06d5bfeab5c","user":{"login":"Yelp","id":49071,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":44998824,"node_id":"MDEwOlJlcG9zaXRvcnk0NDk5ODgyNA==","name":"paasta","full_name":"Yelp/paasta","owner":{"login":"Yelp","id":49071,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/paasta","description":"An open, distributed platform as a service","fork":false,"url":"https://api.github.com/repos/Yelp/paasta","forks_url":"https://api.github.com/repos/Yelp/paasta/forks","keys_url":"https://api.github.com/repos/Yelp/paasta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/paasta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/paasta/teams","hooks_url":"https://api.github.com/repos/Yelp/paasta/hooks","issue_events_url":"https://api.github.com/repos/Yelp/paasta/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/paasta/events","assignees_url":"https://api.github.com/repos/Yelp/paasta/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/paasta/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/paasta/tags","blobs_url":"https://api.github.com/repos/Yelp/paasta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/paasta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/paasta/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/paasta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/paasta/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/paasta/languages","stargazers_url":"https://api.github.com/repos/Yelp/paasta/stargazers","contributors_url":"https://api.github.com/repos/Yelp/paasta/contributors","subscribers_url":"https://api.github.com/repos/Yelp/paasta/subscribers","subscription_url":"https://api.github.com/repos/Yelp/paasta/subscription","commits_url":"https://api.github.com/repos/Yelp/paasta/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/paasta/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/paasta/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/paasta/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/paasta/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/paasta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/paasta/merges","archive_url":"https://api.github.com/repos/Yelp/paasta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/paasta/downloads","issues_url":"https://api.github.com/repos/Yelp/paasta/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/paasta/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/paasta/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/paasta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/paasta/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/paasta/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/paasta/deployments","created_at":"2015-10-26T21:35:53Z","updated_at":"2018-08-23T00:25:21Z","pushed_at":"2018-08-23T22:51:28Z","git_url":"git://github.com/Yelp/paasta.git","ssh_url":"git@github.com:Yelp/paasta.git","clone_url":"https://github.com/Yelp/paasta.git","svn_url":"https://github.com/Yelp/paasta","homepage":"","size":61063,"stargazers_count":1265,"watchers_count":1265,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":152,"mirror_url":null,"archived":false,"open_issues_count":95,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":152,"open_issues":95,"watchers":1265,"default_branch":"master"}},"base":{"label":"Yelp:master","ref":"master","sha":"7763129111b1e1a758a4ef1570285fe83d272b7a","user":{"login":"Yelp","id":49071,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":44998824,"node_id":"MDEwOlJlcG9zaXRvcnk0NDk5ODgyNA==","name":"paasta","full_name":"Yelp/paasta","owner":{"login":"Yelp","id":49071,"node_id":"MDEyOk9yZ2FuaXphdGlvbjQ5MDcx","avatar_url":"https://avatars1.githubusercontent.com/u/49071?v=4","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/paasta","description":"An open, distributed platform as a service","fork":false,"url":"https://api.github.com/repos/Yelp/paasta","forks_url":"https://api.github.com/repos/Yelp/paasta/forks","keys_url":"https://api.github.com/repos/Yelp/paasta/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/paasta/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/paasta/teams","hooks_url":"https://api.github.com/repos/Yelp/paasta/hooks","issue_events_url":"https://api.github.com/repos/Yelp/paasta/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/paasta/events","assignees_url":"https://api.github.com/repos/Yelp/paasta/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/paasta/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/paasta/tags","blobs_url":"https://api.github.com/repos/Yelp/paasta/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/paasta/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/paasta/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/paasta/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/paasta/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/paasta/languages","stargazers_url":"https://api.github.com/repos/Yelp/paasta/stargazers","contributors_url":"https://api.github.com/repos/Yelp/paasta/contributors","subscribers_url":"https://api.github.com/repos/Yelp/paasta/subscribers","subscription_url":"https://api.github.com/repos/Yelp/paasta/subscription","commits_url":"https://api.github.com/repos/Yelp/paasta/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/paasta/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/paasta/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/paasta/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/paasta/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/paasta/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/paasta/merges","archive_url":"https://api.github.com/repos/Yelp/paasta/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/paasta/downloads","issues_url":"https://api.github.com/repos/Yelp/paasta/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/paasta/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/paasta/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/paasta/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/paasta/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/paasta/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/paasta/deployments","created_at":"2015-10-26T21:35:53Z","updated_at":"2018-08-23T00:25:21Z","pushed_at":"2018-08-23T22:51:28Z","git_url":"git://github.com/Yelp/paasta.git","ssh_url":"git@github.com:Yelp/paasta.git","clone_url":"https://github.com/Yelp/paasta.git","svn_url":"https://github.com/Yelp/paasta","homepage":"","size":61063,"stargazers_count":1265,"watchers_count":1265,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":152,"mirror_url":null,"archived":false,"open_issues_count":95,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":152,"open_issues":95,"watchers":1265,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1952"},"html":{"href":"https://github.com/Yelp/paasta/pull/1952"},"issue":{"href":"https://api.github.com/repos/Yelp/paasta/issues/1952"},"comments":{"href":"https://api.github.com/repos/Yelp/paasta/issues/1952/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1952/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/paasta/pulls/1952/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/paasta/statuses/17e7ff5ef285d817f5dcbf8ddb85e06d5bfeab5c"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"keymone"}}