{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21498","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21498/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21498/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21498/events","html_url":"https://github.com/kubernetes/kubernetes/issues/21498","id":134680557,"number":21498,"title":"Slow binding of PV => PVC","user":{"login":"qix","id":212593,"avatar_url":"https://avatars.githubusercontent.com/u/212593?v=3","gravatar_id":"","url":"https://api.github.com/users/qix","html_url":"https://github.com/qix","followers_url":"https://api.github.com/users/qix/followers","following_url":"https://api.github.com/users/qix/following{/other_user}","gists_url":"https://api.github.com/users/qix/gists{/gist_id}","starred_url":"https://api.github.com/users/qix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qix/subscriptions","organizations_url":"https://api.github.com/users/qix/orgs","repos_url":"https://api.github.com/users/qix/repos","events_url":"https://api.github.com/users/qix/events{/privacy}","received_events_url":"https://api.github.com/users/qix/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/storage","name":"area/storage","color":"006b75"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/team/cluster","name":"team/cluster","color":"d2b48c"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-02-18T20:02:06Z","updated_at":"2016-04-18T19:27:19Z","closed_at":null,"body":"We're manually creating drives to contain each of our databases, as such it makes sense for us to have known bindings between each PVC and PV. Since `volumeSelector` is not yet available creating them one at a time has been working for us.\r\n\r\nRecently for unknown reasons it has gotten **very** slow. What used to take seconds to bind the PVC=>PV now takes to 20+ minutes.\r\n\r\nInitially it shows up as `Pending` with errors such as the following in the logs:\r\n`PVClaimBinder \r\ncould not update claim sliding-data-3c-pvc: Error updating volume: persistentvolumeclaims \"sl\r\niding-data-3c-pvc\" cannot be updated: the object has been modified; please apply your changes\r\n to the latest version and try again`\r\n\r\nAfter a while it finally binds, but with `Capacity: 0`:\r\n```\r\n# kubectl describe pv sliding-data-1c-pv\r\nName:        sliding-data-1c-pv\r\nLabels:        <none>\r\nStatus:        Available\r\nClaim:        \r\nReclaim Policy:    Retain\r\nAccess Modes:    RWO\r\nCapacity:    16Gi\r\nMessage:    \r\nSource:\r\n    Type:    GCEPersistentDisk (a Persistent Disk resource in Google Compute Engine)\r\n    PDName:    sliding-data-1c\r\n    FSType:    ext4\r\n    Partition:    0\r\n    ReadOnly:    false\r\n\r\n# kubectl describe pvc sliding-data-1c-pvc\r\nName:        sliding-data-1c-pvc\r\nNamespace:    default\r\nStatus:        Bound\r\nVolume:        sliding-data-1c-pv\r\nLabels:        <none>\r\nCapacity:    0\r\nAccess Modes:    \r\n```\r\n\r\nFinally after around half an hour everything settles down as expected. Since we can only create one at a time, this means many hours while trying to create a group of PV/PVC pairs.\r\n\r\nWe're running our own Kubernetes cluster on Google Compute Engine, here are some other details:\r\n\r\n```\r\n# kubectl version\r\nClient Version: version.Info{Major:\"1\", Minor:\"1\", GitVersion:\"v1.1.3\", GitCommit:\"6a81b50c7e97bbe0ade075de55ab4fa34f049dc2\", GitTreeState:\"clean\"}\r\nServer Version: version.Info{Major:\"1\", Minor:\"1\", GitVersion:\"v1.1.3\", GitCommit:\"6a81b50c7e97bbe0ade075de55ab4fa34f049dc2\", GitTreeState:\"clean\"}\r\n\r\n# cat sliding-data-3c-pv.json\r\n{\r\n  \"apiVersion\": \"v1\",\r\n  \"kind\": \"PersistentVolume\",\r\n  \"metadata\": {\r\n    \"name\": \"sliding-data-3c-pv\"\r\n  },\r\n  \"spec\": {\r\n    \"accessModes\": [\r\n      \"ReadWriteOnce\"\r\n    ],\r\n    \"capacity\": {\r\n      \"storage\": \"16Gi\"\r\n    },\r\n    \"gcePersistentDisk\": {\r\n      \"fsType\": \"ext4\",\r\n      \"pdName\": \"sliding-data-3c\"\r\n    },\r\n    \"persistentVolumeReclaimPolicy\": \"Retain\"\r\n  }\r\n}\r\n\r\n# cat sliding-data-3c-pvc.json \r\n{\r\n  \"apiVersion\": \"v1\",\r\n  \"kind\": \"PersistentVolumeClaim\",\r\n  \"metadata\": {\r\n    \"name\": \"sliding-data-3c-pvc\"\r\n  },\r\n  \"spec\": {\r\n    \"accessModes\": [\r\n      \"ReadWriteOnce\"\r\n    ],\r\n    \"resources\": {\r\n      \"requests\": {\r\n        \"storage\": \"16Gi\"\r\n      }\r\n    }\r\n  }\r\n}\r\n\r\n# docker --version\r\nDocker version 1.6.2, build 7c8fca2\r\n```"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/211541204","html_url":"https://github.com/kubernetes/kubernetes/issues/21498#issuecomment-211541204","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/21498","id":211541204,"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":"2016-04-18T19:27:19Z","updated_at":"2016-04-18T19:27:19Z","body":"@saad-ali I agree name/namespace is likely sufficient to pre-bind to a PVC.  The UID was added to solve a corner case, though.\r\n\r\nConsider:\r\n\r\n1. Create PV named \"foo\"\r\n2. Create PVC named \"bar\" that matches \"foo\". Let it bind.\r\n3. Delete the PVC.  Now we race.\r\n3. Create a new PVC named \"bar\".\r\n\r\nThe volume should be released of its first claim.  Without the UID check, the PV can incorrectly bind to the 2nd claim, which is a different object.\r\n\r\n\r\n"}}