Bug 1468199 - The PVC AccessModes of mediawiki apb is invalid
The PVC AccessModes of mediawiki apb is invalid
Status: VERIFIED
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker (Show other bugs)
3.6.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Todd Sanders
DeShuai Ma
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-06 05:43 EDT by DeShuai Ma
Modified: 2017-07-12 09:05 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description DeShuai Ma 2017-07-06 05:43:28 EDT
Description of problem:
After provision apb mediawiki, the PVC met invalid AccessModes error

Version-Release number of selected component (if applicable):
asb: 0.9.4
openshift v3.6.135
kubernetes v1.6.1+5115d708d7
etcd 3.2.1

How reproducible:
Always

Steps to Reproduce:
1. Run the script to provision mediawili service.
# cat provision.sh 
#!/bin/bash -e

instanceUUID="bdeb07ca-2da8-4742-9312-561c6ec86ae0"
planUUID="4c10ff42-be89-420a-9bab-27a9bef9aed8"
serviceUUID="55c53a5d-65a6-4c27-88fc-e027410b1337"

req="{
  \"plan_id\": \"$planUUID\",
  \"service_id\": \"$serviceUUID\",
  \"context\": {
    \"platform\": \"kubernetes\",
    \"namespace\": \"mediawiki-project\"
  },
  \"parameters\": {
    \"mediawiki_db_schema\": \"mediawiki\",
    \"mediawiki_site_name\": \"mediawiki\",
    \"mediawiki_site_lang\": \"en\",
    \"mediawiki_admin_user\": \"admin\",
    \"mediawiki_admin_pass\":\"redhat\"
  }
}"

curl \
  -X PUT \
  -H 'X-Broker-API-Version: 2.9' \
  -H 'Content-Type: application/json' \
  -d "$req" \
  -v \
  "http://172.30.174.228:1338/v2/service_instances/$instanceUUID?accepts_incomplete=true"

2. Check pvc status
# oc get storageclass
NAME            TYPE
gp2 (default)   kubernetes.io/aws-ebs
# oc get storageclass gp2 -o json
{
    "apiVersion": "storage.k8s.io/v1",
    "kind": "StorageClass",
    "metadata": {
        "annotations": {
            "storageclass.beta.kubernetes.io/is-default-class": "true"
        },
        "creationTimestamp": "2017-07-06T04:06:59Z",
        "name": "gp2",
        "resourceVersion": "1726",
        "selfLink": "/apis/storage.k8s.io/v1/storageclasses/gp2",
        "uid": "8e9dabee-6200-11e7-8615-0e7aca344840"
    },
    "parameters": {
        "type": "gp2"
    },
    "provisioner": "kubernetes.io/aws-ebs"
}
# oc get pvc -n mediawiki-project
NAME               STATUS    VOLUME    CAPACITY   ACCESSMODES   STORAGECLASS   AGE
mediawiki123-pvc   Pending                                      gp2            1m
# oc describe pvc/mediawiki123-pvc -n mediawiki-project
Name:        mediawiki123-pvc
Namespace:    mediawiki-project
StorageClass:    gp2
Status:        Pending
Volume:        
Labels:        <none>
Annotations:    volume.beta.kubernetes.io/storage-provisioner=kubernetes.io/aws-ebs
Capacity:    
Access Modes:    
Events:
  FirstSeen    LastSeen    Count    From                SubObjectPath    Type        Reason            Message
  ---------    --------    -----    ----                -------------    --------    ------            -------
  1m        13s        8    persistentvolume-controller            Warning        ProvisioningFailed    Failed to provision volume with StorageClass "gp2": invalid AccessModes [ReadWriteMany]: only AccessModes [ReadWriteOnce] are supported

3.

Actual results:


Expected results:
2. PVC is Bound success

Additional info:
https://github.com/fusor/apb-examples/blob/master/mediawiki123-apb/roles/provision-mediawiki123-apb/tasks/main.yml#L23-L24
Comment 1 Jason Montleon 2017-07-07 09:14:07 EDT
I am changing the code above as this example doesn't need it, but can you explain why you can't support ReadWriteMany?

I believe we may have at least one upstream HA example that does require ReadWriteMany. If such a case is ever brought or produced downstream how would we test it?
Comment 4 Jianwei Hou 2017-07-09 23:32:46 EDT
(In reply to Jason Montleon from comment #1)
> I am changing the code above as this example doesn't need it, but can you
> explain why you can't support ReadWriteMany?
> 
> I believe we may have at least one upstream HA example that does require
> ReadWriteMany. If such a case is ever brought or produced downstream how
> would we test it?

This above StorageClass "gp2" is used to provision gp2 volume, the volume is a block device and can only be attached to one node at a time. Thus only ReadWriteOnce mode is supported. To use ReadWriteMany mode, we need to use efs, glusterfs, nfs or cephfs provisioners.
Comment 5 DeShuai Ma 2017-07-12 04:32:42 EDT
Now we can provision mediawiki successfully. verify the bug

[root@host-8-174-68 dma]# oc get po -n mediawiki-project
NAME                                       READY     STATUS      RESTARTS   AGE
apb-3a849e23-5bcb-4c00-85da-1d8c96a5c84b   0/1       Completed   0          38m
mediawiki123-1-fdd8s                       1/1       Running     0          37m

Note You need to log in before you can comment on or make changes to this bug.