{"action":"created","comment":{"url":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments/34103703","id":34103703,"diff_hunk":"@@ -0,0 +1,178 @@\n+= Persistent Storage\n+{product-author}\n+{product-version}\n+:data-uri:\n+:icons:\n+:experimental:\n+:toc: macro\n+:toc-title:\n+\n+toc::[]\n+\n+== Overview\n+\n+Managing storage is a distinct problem from managing compute resources. The `PersistentVolume` subsystem provides an API for users and administrators that abstracts details of how storage is provided from how it is consumed.  To do this we introduce two new API resources:  `PersistentVolume` and `PersistentVolumeClaim`.\n+\n+A `PersistentVolume` (PV) is a piece of networked storage in the cluster that has been provisioned by an administrator.  It is a resource in the cluster just like a node is a cluster resource.   PVs are volume plugins like Volumes, but have a lifecycle independent of any individual pod that uses the PV.  This API object captures the details of the implementation of the storage, be that NFS, iSCSI, or a cloud-provider-specific storage system.\n+\n+A `PersistentVolumeClaim` (PVC) is a request for storage by a user.  It is similar to a pod.  Pods consume node resources and PVCs consume PV resources.  Pods can request specific levels of resources (CPU and Memory).  Claims can request specific storage capacity and access modes (e.g, can be mounted once read/write or many times read-only).\n+\n+== Lifecycle of a volume and claim\n+\n+PVs are resources in the cluster.  PVC are requests for those resources and also act as claim checks to the resource.  The interaction between PVs and PVCs follows this lifecycle:\n+\n+=== Provisioning\n+\n+A cluster administrator creates some number of PVs. They carry the details of the real storage that is available for use by cluster users.  They exist in the API and are available for consumption.\n+\n+=== Binding\n+\n+A user creates a `PersistentVolumeClaim` with a specific amount of storage requested and with certain access modes.  A control loop in the master watches for new PVCs, finds a matching PV (if possible), and binds them together.  The user will always get at least what they asked for, but the volume may be in excess of what was requested.\n+\n+Claims will remain unbound indefinitely if a matching volume does not exist.  Claims will be bound as matching volumes become available.  For example, a cluster provisioned with many 50Gi volumes would not match a PVC requesting 100Gi.  The PVC can be bound when a 100Gi PV is added to the cluster.\n+\n+=== Using\n+\n+Pods use claims as volumes. The cluster inspects the claim to find the bound volume and mounts that volume for a pod.  For those volumes that support multiple access modes, the user specifies which mode desired when using their claim as a volume in a pod.\n+\n+Once a user has a claim and that claim is bound, the bound PV belongs to the user for as long as she needs it. Users schedule Pods and access their their claimed PVs by including a persistentVolumeClaim in their Pod's volumes block. See link:#claims-as-volumes[below] for syntax details.\n+\n+=== Releasing\n+\n+When a user is done with their volume, they can delete the PVC objects from the API which allows reclamation of the resource.  The volume is considered \"released\" when the claim is deleted, but it is not yet available for another claim.  The previous claimant's data remains on the volume which must be handled according to policy.\n+\n+=== Reclaiming\n+\n+The reclaim policy of a `PersistentVolume` tells the cluster what to do with the volume after it's released.  Currently, volumes can either be Retained or Recycled.  Retention allows for manual reclamation of the resource.  For those volume plugins that support it, recycling performs a basic scrub (\"rm -rf /thevolume/*\") on the volume and makes it available again for a new claim.\n+\n+== Persistent Volumes\n+\n+== Types of Persistent Volumes\n+\n+OpenShift currently supports the following `PersistentVolume` plugins:\n+\n+* NFS\n+* GCEPersistentDisk\n+* AWSElasticBlockStore\n+* Glusterfs\n+* iSCSI\n+* RBD (Ceph Block Device)\n+* HostPath (single node testing only)\n+\n+Each PV contains a spec and status, which is the specification and status of the volume.\n+\n+```\n+\n+  apiVersion: v1\n+  kind: PersistentVolume\n+  metadata:\n+    name: pv0003\n+  spec:\n+    capacity:\n+      storage: 5Gi\n+    accessModes:\n+      - ReadWriteOnce\n+    persistentVolumeReclaimPolicy: Recycle\n+    nfs:\n+      path: /tmp\n+      server: 172.17.0.2\n+\n+```\n+\n+=== Capacity\n+\n+Generally, a PV will have a specific storage capacity.  This is set using the PV's `capacity` attribute.  See link:https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/design/resources.md[Kubernetes Resource Model] to understand the units expected by `capacity`.\n+\n+Currently, storage storage capacity is the only resource that can be set or requested.  Future attributes may include IOPS, throughput, etc.\n+\n+=== Access Modes\n+\n+`PersistentVolume`s can be mounted on a host in any way supported by the resource provider.  Providers will have different capabilities and each PV's access modes are set to the specific modes supported by that particular volume.  For example, NFS can support multiple read/write clients, but a specific NFS PV might be exported on the server as read-only.  Each PV gets its own set of access modes describing that specific PV's capabilities.\n+\n+The access modes are:\n+\n+* ReadWriteOnce -- the volume can be mounted as read-write by a single node\n+* ReadOnlyMany -- the volume can be mounted read-only by many nodes\n+* ReadWriteMany -- the volume can be mounted as read-write by many nodes\n+\n+In the CLI, the access modes are abbreviated to:\n+\n+* RWO - ReadWriteOnce\n+* ROX - ReadOnlyMany\n+* RWX - ReadWriteMany\n+\n+[Important]\n+===\n+A volume can only be mounted using one access mode at a time, even if it supports many.  For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time.\n+===\n+\n+=== Recycling Policy\n+\n+Current recycling policies are:\n+\n+* Retain -- manual reclamation\n+* Recycle -- basic scrub (\"rm -rf /thevolume/*\")\n+\n+Currently, NFS and HostPath support recycling.\n+\n+=== Phase\n+\n+A volume will be in one of the following phases:\n+\n+* Available -- a free resource resource that is not yet bound to a claim","path":"architecture/additional_concepts/storage.adoc","position":122,"original_position":122,"commit_id":"1466f657f55a11be3ac1e05d82504602bfe37381","original_commit_id":"1466f657f55a11be3ac1e05d82504602bfe37381","user":{"login":"danmcp","id":492994,"avatar_url":"https://avatars.githubusercontent.com/u/492994?v=3","gravatar_id":"","url":"https://api.github.com/users/danmcp","html_url":"https://github.com/danmcp","followers_url":"https://api.github.com/users/danmcp/followers","following_url":"https://api.github.com/users/danmcp/following{/other_user}","gists_url":"https://api.github.com/users/danmcp/gists{/gist_id}","starred_url":"https://api.github.com/users/danmcp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danmcp/subscriptions","organizations_url":"https://api.github.com/users/danmcp/orgs","repos_url":"https://api.github.com/users/danmcp/repos","events_url":"https://api.github.com/users/danmcp/events{/privacy}","received_events_url":"https://api.github.com/users/danmcp/received_events","type":"User","site_admin":false},"body":"resource resource?","created_at":"2015-07-07T23:37:26Z","updated_at":"2015-07-07T23:37:26Z","html_url":"https://github.com/openshift/openshift-docs/pull/681#discussion_r34103703","pull_request_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/681","_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments/34103703"},"html":{"href":"https://github.com/openshift/openshift-docs/pull/681#discussion_r34103703"},"pull_request":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/681"}}},"pull_request":{"url":"https://api.github.com/repos/openshift/openshift-docs/pulls/681","id":39106695,"html_url":"https://github.com/openshift/openshift-docs/pull/681","diff_url":"https://github.com/openshift/openshift-docs/pull/681.diff","patch_url":"https://github.com/openshift/openshift-docs/pull/681.patch","issue_url":"https://api.github.com/repos/openshift/openshift-docs/issues/681","number":681,"state":"open","locked":false,"title":"Persistent storage arch doc","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},"body":"1st OpenShift draft.  Largely copied from upstream: https://github.com/GoogleCloudPlatform/kubernetes/pull/10580","created_at":"2015-07-02T17:28:05Z","updated_at":"2015-07-07T23:37:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e847901221645e26f7c45a210d2aa3e6a87190d0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/681/commits","review_comments_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/681/comments","review_comment_url":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/openshift/openshift-docs/issues/681/comments","statuses_url":"https://api.github.com/repos/openshift/openshift-docs/statuses/1466f657f55a11be3ac1e05d82504602bfe37381","head":{"label":"markturansky:pv_docs","ref":"pv_docs","sha":"1466f657f55a11be3ac1e05d82504602bfe37381","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},"repo":{"id":35622484,"name":"openshift-docs","full_name":"markturansky/openshift-docs","owner":{"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},"private":false,"html_url":"https://github.com/markturansky/openshift-docs","description":"OpenShift Documentation","fork":true,"url":"https://api.github.com/repos/markturansky/openshift-docs","forks_url":"https://api.github.com/repos/markturansky/openshift-docs/forks","keys_url":"https://api.github.com/repos/markturansky/openshift-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/markturansky/openshift-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/markturansky/openshift-docs/teams","hooks_url":"https://api.github.com/repos/markturansky/openshift-docs/hooks","issue_events_url":"https://api.github.com/repos/markturansky/openshift-docs/issues/events{/number}","events_url":"https://api.github.com/repos/markturansky/openshift-docs/events","assignees_url":"https://api.github.com/repos/markturansky/openshift-docs/assignees{/user}","branches_url":"https://api.github.com/repos/markturansky/openshift-docs/branches{/branch}","tags_url":"https://api.github.com/repos/markturansky/openshift-docs/tags","blobs_url":"https://api.github.com/repos/markturansky/openshift-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/markturansky/openshift-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/markturansky/openshift-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/markturansky/openshift-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/markturansky/openshift-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/markturansky/openshift-docs/languages","stargazers_url":"https://api.github.com/repos/markturansky/openshift-docs/stargazers","contributors_url":"https://api.github.com/repos/markturansky/openshift-docs/contributors","subscribers_url":"https://api.github.com/repos/markturansky/openshift-docs/subscribers","subscription_url":"https://api.github.com/repos/markturansky/openshift-docs/subscription","commits_url":"https://api.github.com/repos/markturansky/openshift-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/markturansky/openshift-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/markturansky/openshift-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/markturansky/openshift-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/markturansky/openshift-docs/contents/{+path}","compare_url":"https://api.github.com/repos/markturansky/openshift-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/markturansky/openshift-docs/merges","archive_url":"https://api.github.com/repos/markturansky/openshift-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/markturansky/openshift-docs/downloads","issues_url":"https://api.github.com/repos/markturansky/openshift-docs/issues{/number}","pulls_url":"https://api.github.com/repos/markturansky/openshift-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/markturansky/openshift-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/markturansky/openshift-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/markturansky/openshift-docs/labels{/name}","releases_url":"https://api.github.com/repos/markturansky/openshift-docs/releases{/id}","created_at":"2015-05-14T16:28:50Z","updated_at":"2015-05-14T16:28:51Z","pushed_at":"2015-07-07T18:06:31Z","git_url":"git://github.com/markturansky/openshift-docs.git","ssh_url":"git@github.com:markturansky/openshift-docs.git","clone_url":"https://github.com/markturansky/openshift-docs.git","svn_url":"https://github.com/markturansky/openshift-docs","homepage":null,"size":4238,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"openshift:master","ref":"master","sha":"49cecf44753d57062fe54b60d3426571414ade5c","user":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"repo":{"id":21740844,"name":"openshift-docs","full_name":"openshift/openshift-docs","owner":{"login":"openshift","id":792337,"avatar_url":"https://avatars.githubusercontent.com/u/792337?v=3","gravatar_id":"","url":"https://api.github.com/users/openshift","html_url":"https://github.com/openshift","followers_url":"https://api.github.com/users/openshift/followers","following_url":"https://api.github.com/users/openshift/following{/other_user}","gists_url":"https://api.github.com/users/openshift/gists{/gist_id}","starred_url":"https://api.github.com/users/openshift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openshift/subscriptions","organizations_url":"https://api.github.com/users/openshift/orgs","repos_url":"https://api.github.com/users/openshift/repos","events_url":"https://api.github.com/users/openshift/events{/privacy}","received_events_url":"https://api.github.com/users/openshift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/openshift/openshift-docs","description":"OpenShift Documentation","fork":false,"url":"https://api.github.com/repos/openshift/openshift-docs","forks_url":"https://api.github.com/repos/openshift/openshift-docs/forks","keys_url":"https://api.github.com/repos/openshift/openshift-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/openshift/openshift-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/openshift/openshift-docs/teams","hooks_url":"https://api.github.com/repos/openshift/openshift-docs/hooks","issue_events_url":"https://api.github.com/repos/openshift/openshift-docs/issues/events{/number}","events_url":"https://api.github.com/repos/openshift/openshift-docs/events","assignees_url":"https://api.github.com/repos/openshift/openshift-docs/assignees{/user}","branches_url":"https://api.github.com/repos/openshift/openshift-docs/branches{/branch}","tags_url":"https://api.github.com/repos/openshift/openshift-docs/tags","blobs_url":"https://api.github.com/repos/openshift/openshift-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/openshift/openshift-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/openshift/openshift-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/openshift/openshift-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/openshift/openshift-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/openshift/openshift-docs/languages","stargazers_url":"https://api.github.com/repos/openshift/openshift-docs/stargazers","contributors_url":"https://api.github.com/repos/openshift/openshift-docs/contributors","subscribers_url":"https://api.github.com/repos/openshift/openshift-docs/subscribers","subscription_url":"https://api.github.com/repos/openshift/openshift-docs/subscription","commits_url":"https://api.github.com/repos/openshift/openshift-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/openshift/openshift-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/openshift/openshift-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/openshift/openshift-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/openshift/openshift-docs/contents/{+path}","compare_url":"https://api.github.com/repos/openshift/openshift-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/openshift/openshift-docs/merges","archive_url":"https://api.github.com/repos/openshift/openshift-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/openshift/openshift-docs/downloads","issues_url":"https://api.github.com/repos/openshift/openshift-docs/issues{/number}","pulls_url":"https://api.github.com/repos/openshift/openshift-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/openshift/openshift-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/openshift/openshift-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/openshift/openshift-docs/labels{/name}","releases_url":"https://api.github.com/repos/openshift/openshift-docs/releases{/id}","created_at":"2014-07-11T15:14:42Z","updated_at":"2015-06-29T08:01:26Z","pushed_at":"2015-07-07T23:37:21Z","git_url":"git://github.com/openshift/openshift-docs.git","ssh_url":"git@github.com:openshift/openshift-docs.git","clone_url":"https://github.com/openshift/openshift-docs.git","svn_url":"https://github.com/openshift/openshift-docs","homepage":null,"size":56155,"stargazers_count":19,"watchers_count":19,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":91,"mirror_url":null,"open_issues_count":79,"forks":91,"open_issues":79,"watchers":19,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/681"},"html":{"href":"https://github.com/openshift/openshift-docs/pull/681"},"issue":{"href":"https://api.github.com/repos/openshift/openshift-docs/issues/681"},"comments":{"href":"https://api.github.com/repos/openshift/openshift-docs/issues/681/comments"},"review_comments":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/681/comments"},"review_comment":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/openshift/openshift-docs/pulls/681/commits"},"statuses":{"href":"https://api.github.com/repos/openshift/openshift-docs/statuses/1466f657f55a11be3ac1e05d82504602bfe37381"}}}}