{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/7438","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/7438/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/7438/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/7438/events","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/7438","id":71622030,"number":7438,"title":"Migrate PV binding from PV.Spec.ClaimRef to Binding subresource","user":{"login":"markturansky","id":8001968,"avatar_url":"https://avatars.githubusercontent.com/u/8001968?v=3","gravatar_id":"","url":"https://api.github.com/users/markturansky","html_url":"https://github.com/markturansky","followers_url":"https://api.github.com/users/markturansky/followers","following_url":"https://api.github.com/users/markturansky/following{/other_user}","gists_url":"https://api.github.com/users/markturansky/gists{/gist_id}","starred_url":"https://api.github.com/users/markturansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markturansky/subscriptions","organizations_url":"https://api.github.com/users/markturansky/orgs","repos_url":"https://api.github.com/users/markturansky/repos","events_url":"https://api.github.com/users/markturansky/events{/privacy}","received_events_url":"https://api.github.com/users/markturansky/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/priority/P2","name":"priority/P2","color":"fbca04"},{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/labels/team/cluster","name":"team/cluster","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":21,"created_at":"2015-04-28T15:29:16Z","updated_at":"2015-05-09T01:00:26Z","closed_at":null,"body":"@bgrant0607 this is a breaking API change.\r\n\r\n@thockin @smarterclayton \r\n\r\nFrom #6105 \r\n\r\n>This should use a \"binding\" sub-resource, as with pods. We've drawn the analogy of claims and PVs being like pods and nodes - we should follow the same pattern. That seems like a significant change, so I am willing to proceed on this path as long as we have a strong promise to fix it ASAP. This is, strictly speaking, an API change (albeit constrained to ~1 consumer - you).\r\n>\r\n> As per our IRC chat, there are a lot of things this might change:\r\n>\r\n>Do we bind the Claim to the PV or vice-versa?\r\nDo we move the Claim.VolumeRef to Spec?\r\nDo we allow users to ask for a specific PV?\r\n\r\nand \r\n\r\n> As per the binding sub-resource discussion, I sense that we have this backwards. PersVolume.Status should host a ClaimRef and PersVolumeClaim.Spec should host a VolumeName (not ref, I think).\r\n\r\nPer @thockin's questions above...\r\n\r\nI think the PersistentVolume should own the binding.  It is 1:1 with Claims and it is more natural to query for volumes and see what's bound than to traverse all namespaces to see if a claim exists for a given volume.\r\n\r\nClaim.Status.VolumeRef (potentially changed to VolumeName, since Namespace is unneeded) can stay where it is.  That status is reconstructable by observing the bound volume.\r\n\r\nAllowing users to ask for a specific PV breaks the separation between them.  We can steer users towards some volumes (through admission control that retains some types/sizes of volumes to certain namespaces) but still not give them the exact volume.\r\n\r\nI can add the Binding subresource similar to pod, but I need some help understanding how to use it effectively.  It looks like Pod's use of Binding is still in flux (see https://github.com/GoogleCloudPlatform/kubernetes/blob/master/plugin/pkg/scheduler/factory/factory.go#L294).\r\n\r\nTechnical advice and guidance is required :)"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/comments/100404121","html_url":"https://github.com/GoogleCloudPlatform/kubernetes/issues/7438#issuecomment-100404121","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/kubernetes/issues/7438","id":100404121,"user":{"login":"markturansky","id":8001968,"avatar_url":"https://avatars.githubusercontent.com/u/8001968?v=3","gravatar_id":"","url":"https://api.github.com/users/markturansky","html_url":"https://github.com/markturansky","followers_url":"https://api.github.com/users/markturansky/followers","following_url":"https://api.github.com/users/markturansky/following{/other_user}","gists_url":"https://api.github.com/users/markturansky/gists{/gist_id}","starred_url":"https://api.github.com/users/markturansky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markturansky/subscriptions","organizations_url":"https://api.github.com/users/markturansky/orgs","repos_url":"https://api.github.com/users/markturansky/repos","events_url":"https://api.github.com/users/markturansky/events{/privacy}","received_events_url":"https://api.github.com/users/markturansky/received_events","type":"User","site_admin":false},"created_at":"2015-05-09T01:00:26Z","updated_at":"2015-05-09T01:00:26Z","body":"So we're clear, is the existing implementation correct, then?  The single bind from which I can build all other objects and status is pv.Spec.ClaimRef from which I derive pvc.Status.VolumeRef.\r\n\r\nI'm working through the recycler implementation and the bind as described above is a natural fit for the volume's lifecycle.\r\n\r\nIf this is correct, I need to just remove the gate and this feature will be enabled by default.\r\n\r\n"}}