{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/73809810","id":73809810,"diff_hunk":"@@ -0,0 +1,151 @@\n+# Emptydir persistent volume\n+\n+This document proposes a model for managing emptydir persistent volumes backed by node local storage.\n+\n+## Abstract\n+We currently have:\n+* Various different types of \"local volumes\", like emptyDir, hostPath and gitRepo\n+* A way to \"claim\" storage, such that the pod referencing the claim can continue using the storage across pod/node restarts\n+* A way to dynamically provision volumes to match un-bound/pending claims\n+\n+The second and third features allow us to say: provision a volume on demand, that survives pod/node restarts by using network attached storage (NFS, network block device from cloudprovider, distributed file system like gluster). This proposal is about a new `emptyDir` persistent volume that combines all three features. The idea is that we can sacrifice some durability to get a similar abstraction using *node local storage*. We expect this new PV source to be useful to applications that:\n+* Prioritize latency over durability (eg: async replicated database using local ssd)\n+* Prioritize cost over durability (eg: dev/test prototyping)\n+* Bring their own out of band save/restore snapshotting\n+\n+## Goals\n+* Define a new persistent volume source that is backed by local storage and survives pod restarts\n+* Every pod referencing this PV must land on the same node (this concept has been referred to as \"data gravity\").\n+* Once this PV is bound to a node, it cannot get unbound till a human intervenes or the node is deleted\n+* The PV must require low user interaction. It should be provisionable dynamically.\n+* The directory backing the PV must get deleted when the PV is deleted.\n+\n+## Non goals\n+* A local storage abstraction that survives extended node outages\n+* Snapshotting or simply copying the local volume to another node\n+\n+## A new PV storage source\n+\n+As described above, the storage source for the PV must be a local volume. While we already allow hostPath as a PersistentVolumeSource, it is insufficient because:\n+* user needs to specify the exact path, thus requires knowledge of the filesystem\n+* hard to dynamically provision a hostpath\n+* hostpath volumes are not cleaned up\n+\n+The `emptydir` abstraction solves these problems:\n+* it is allocated in `/var/lib/kubelet/resource/uid/`, a location that is predictable but unknow till `resource` creation time\n+* The node takes care of allocation, a dynamic provisioner just needs to create the PV\n+* it is cleaned up when the pod dies (or in this case when the PV is deleted)\n+\n+We can create a new [PersistetVolumeSource](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/types.go#L240) for EmptyDir. Users will request storage by creating PersistetVolumeClaims. If the PVC isn't bound to a PV, one will be created dynamically. The user can't control which node the storage for this PV comes from, or where in the node's filesystem it is allocated. Users can also hand create PVs bound to specific nodes (TODO: elaborate on QoS and what happens if there's no space on the node).\n+\n+## Scheduling constraints for data gravity\n+\n+The scheduler will schedule the pod paying attention to any referenced PVs. If an empty dir PV attached to an existing node is found, that trumps all scheduler predicates. Otherwise the scheduler makes a scheduling decision taking into account pod cpu/memory requests (and in the future, requested storage), attaches it to a node, and all subsequent scheduling decisions for any pod referencing the same PV evaluate to the same node. The scheduler \"Attaches\" a pv to a node by writing an annotation (TBD what actually writes this annotation, scheduler or kubelet, scheduler will at least bind the pod to the node). All pods referencing the PV that enter the \"Running\" state on the give node will be able to write to the volume. If the node enters the `NotReady` state, all pods referencing the PV attached to the node will remain in `Pending` till such time when an admin either removes the annotation, or rewrites it to point to another node. The directory allocated to the emptydir volume will be exported through the status field of the PV, so admins can yank the disk from a NotReady node and rsync data to the same directory on another node before rewriting the annotation.\n+\n+The annotations used by the scheduler to attach volumes to nodes will be: `volume.alpha.kubernetes.io/sticky-host`. The kubelet will reject any pod at admission time if it finds that the pod references a PV with this annotation set to a value other than its own node name.","path":"docs/proposals/emptydir-pv.md","position":45,"original_position":45,"commit_id":"2a9e5a2908a31832129d7cab502b76b41b016069","original_commit_id":"2a9e5a2908a31832129d7cab502b76b41b016069","user":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"body":"Hmm, I want a way to \"stick\" any/all local volume types, I think this still requires an annotation/field of some sort? this goes back to definig a new type of volume vs existing local volumes + stick-host bit. ","created_at":"2016-08-07T21:51:36Z","updated_at":"2016-08-07T21:51:36Z","html_url":"https://github.com/kubernetes/kubernetes/pull/30044#discussion_r73809810","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/73809810"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/30044#discussion_r73809810"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044","id":80009901,"html_url":"https://github.com/kubernetes/kubernetes/pull/30044","diff_url":"https://github.com/kubernetes/kubernetes/pull/30044.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/30044.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/30044","number":30044,"state":"open","locked":false,"title":"[WIP] Sticky emptydir proposal","user":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"body":"Same as https://github.com/kubernetes/kubernetes/pull/30043","created_at":"2016-08-04T02:35:01Z","updated_at":"2016-08-07T21:51:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f739fb78eb5f0c92ea083d3b8b7f9e619f203af8","assignee":{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},"assignees":[{"login":"smarterclayton","id":1163175,"avatar_url":"https://avatars.githubusercontent.com/u/1163175?v=3","gravatar_id":"","url":"https://api.github.com/users/smarterclayton","html_url":"https://github.com/smarterclayton","followers_url":"https://api.github.com/users/smarterclayton/followers","following_url":"https://api.github.com/users/smarterclayton/following{/other_user}","gists_url":"https://api.github.com/users/smarterclayton/gists{/gist_id}","starred_url":"https://api.github.com/users/smarterclayton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/smarterclayton/subscriptions","organizations_url":"https://api.github.com/users/smarterclayton/orgs","repos_url":"https://api.github.com/users/smarterclayton/repos","events_url":"https://api.github.com/users/smarterclayton/events{/privacy}","received_events_url":"https://api.github.com/users/smarterclayton/received_events","type":"User","site_admin":false},{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/30044/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2a9e5a2908a31832129d7cab502b76b41b016069","head":{"label":"bprashanth:sticky_emptydir_proposal","ref":"sticky_emptydir_proposal","sha":"2a9e5a2908a31832129d7cab502b76b41b016069","user":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"repo":{"id":30552514,"name":"kubernetes","full_name":"bprashanth/kubernetes","owner":{"login":"bprashanth","id":10927820,"avatar_url":"https://avatars.githubusercontent.com/u/10927820?v=3","gravatar_id":"","url":"https://api.github.com/users/bprashanth","html_url":"https://github.com/bprashanth","followers_url":"https://api.github.com/users/bprashanth/followers","following_url":"https://api.github.com/users/bprashanth/following{/other_user}","gists_url":"https://api.github.com/users/bprashanth/gists{/gist_id}","starred_url":"https://api.github.com/users/bprashanth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bprashanth/subscriptions","organizations_url":"https://api.github.com/users/bprashanth/orgs","repos_url":"https://api.github.com/users/bprashanth/repos","events_url":"https://api.github.com/users/bprashanth/events{/privacy}","received_events_url":"https://api.github.com/users/bprashanth/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bprashanth/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/bprashanth/kubernetes","forks_url":"https://api.github.com/repos/bprashanth/kubernetes/forks","keys_url":"https://api.github.com/repos/bprashanth/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bprashanth/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bprashanth/kubernetes/teams","hooks_url":"https://api.github.com/repos/bprashanth/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/bprashanth/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/bprashanth/kubernetes/events","assignees_url":"https://api.github.com/repos/bprashanth/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/bprashanth/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/bprashanth/kubernetes/tags","blobs_url":"https://api.github.com/repos/bprashanth/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bprashanth/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bprashanth/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/bprashanth/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bprashanth/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/bprashanth/kubernetes/languages","stargazers_url":"https://api.github.com/repos/bprashanth/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/bprashanth/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/bprashanth/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/bprashanth/kubernetes/subscription","commits_url":"https://api.github.com/repos/bprashanth/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/bprashanth/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/bprashanth/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/bprashanth/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/bprashanth/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/bprashanth/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bprashanth/kubernetes/merges","archive_url":"https://api.github.com/repos/bprashanth/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bprashanth/kubernetes/downloads","issues_url":"https://api.github.com/repos/bprashanth/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/bprashanth/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/bprashanth/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/bprashanth/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bprashanth/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/bprashanth/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/bprashanth/kubernetes/deployments","created_at":"2015-02-09T18:58:38Z","updated_at":"2015-02-09T18:58:42Z","pushed_at":"2016-08-04T02:34:20Z","git_url":"git://github.com/bprashanth/kubernetes.git","ssh_url":"git@github.com:bprashanth/kubernetes.git","clone_url":"https://github.com/bprashanth/kubernetes.git","svn_url":"https://github.com/bprashanth/kubernetes","homepage":"http://kubernetes.io","size":298513,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"df8da190555784f924b1af8e14a2759a90dd7281","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Production-Grade Container Scheduling and Management","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/kubernetes/deployments","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-08-07T21:04:37Z","pushed_at":"2016-08-07T20:13:08Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":515942,"stargazers_count":16007,"watchers_count":16007,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5065,"mirror_url":null,"open_issues_count":4078,"forks":5065,"open_issues":4078,"watchers":16007,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/30044"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/30044"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/30044/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/30044/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/2a9e5a2908a31832129d7cab502b76b41b016069"}}}}
{"actor":{"display_login":"bprashanth"}}