Bug 1468199 - The PVC AccessModes of mediawiki apb is invalid
Summary: The PVC AccessModes of mediawiki apb is invalid
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Service Broker
Version: 3.6.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 3.6.z
Assignee: Todd Sanders
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-07-06 09:43 UTC by DeShuai Ma
Modified: 2018-04-12 05:59 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
undefined
Clone Of:
Environment:
Last Closed: 2018-04-12 05:59:07 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:1106 0 None None None 2018-04-12 05:59:32 UTC

Description DeShuai Ma 2017-07-06 09:43:28 UTC
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 13:14:07 UTC
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-10 03:32:46 UTC
(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 08:32:42 UTC
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

Comment 9 errata-xmlrpc 2018-04-12 05:59:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:1106


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