Bug 1285121

Summary: [DOCS] Registry storage example shows directly mounting nfs not created pv and pvc opjects
Product: OpenShift Container Platform Reporter: Ryan Howe <rhowe>
Component: DocumentationAssignee: Thien-Thi Nguyen <tnguyen>
Status: CLOSED CURRENTRELEASE QA Contact: Ma xiaoqiang <xiama>
Severity: medium Docs Contact: Vikram Goyal <vigoyal>
Priority: high    
Version: 3.1.0CC: amelicha, aos-bugs, jokerman, mmccomas, xtian
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-17 20:56:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ryan Howe 2015-11-24 22:24:30 UTC
Document URL: 
https://docs.openshift.com/enterprise/3.1/install_config/install/docker_registry.html#production-use

Describe the issue: 

- The docs say that for production use persistent storage using PersistentVolume and PersistentVolumeClaim objects for storage 

- Then provides and example that does not create the object but instead directly mounts the nfs to the pod. 


Additional information: 

I ran:

# oc volume deploymentconfigs/docker-registry  --add --overwrite --name=registry-storage --mount-path=/registry -t pvc --claim-name=registry-claim

AFTER I CREATE the following

Registry volumes: 

 apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
	name: registry-claim
  spec:
	accessModes:
	- ReadWriteMany
	resources:
	  requests:
		storage: 5Gi
	volumeName: registry-volume
  status: {}

  apiVersion: v1
  kind: PersistentVolume
  metadata:
	name: registry-volume
  spec:
	accessModes:
	- ReadWriteMany
	capacity:
	  storage: 10Gi
	nfs:
	  path: /share/registry
	  server: 172.17.28.3
	persistentVolumeReclaimPolicy: Recycle
  status: {}


Document URL: 

Section Number and Name: 

Describe the issue: 

Suggestions for improvement: 

Additional information:

Comment 1 Ryan Howe 2015-11-24 22:36:59 UTC
Example Steps


1. Create PV [1]
# oc create pv.json 

2. CreatePVC [2]
# oc create pvc.json -n default 

3. Add this to your existing registry 
# oc volume deploymentconfigs/docker-registry  --add --overwrite --name=registry-storage --mount-path=/registry -t pvc --claim-name=registry-claim

4. (optional) Run the following if using a replicated registry: 
# oc get -o yaml svc docker-registry | sed 's/\(sessionAffinity:\s*\).*/\1ClientIP/' | oc replace -f -


---------------

[1] cat pv.json 

            "kind": "PersistentVolume",
            "apiVersion": "v1",
            "metadata": {
                "name": "registry-volume",
                "creationTimestamp": null
            },
            "spec": {
                "capacity": {
                    "storage": "10Gi"
                },
                "nfs": {
                    "server": "172.17.28.3",
                    "path": "/share/share4"
                },
                "accessModes": [
                    "ReadWriteMany"
                ],
                "persistentVolumeReclaimPolicy": "Recycle"
            },
            "status": {}
       
[2] cat pvc.json


            "kind": "PersistentVolumeClaim",
            "apiVersion": "v1",
            "metadata": {
                "name": "registry-claim",
                "creationTimestamp": null
            },
            "spec": {
                "accessModes": [
                    "ReadWriteMany"
                ],
                "resources": {
                    "requests": {
                        "storage": "5Gi"
                    }
                },
                "volumeName": "registry-volume"
            },
            "status": {}

Comment 2 Thien-Thi Nguyen 2016-03-17 20:56:59 UTC
This discrepancy has since been addressed by:
- https://github.com/openshift/openshift-docs/commit/ec81f7879bfefc52aae93b4b747f98c2d33a50f8

Verified live (same as Document URL in the Description):
- https://docs.openshift.com/enterprise/3.1/install_config/install/docker_registry.html#production-use

Moving status to CLOSED CURRENTRELEASE.