Bug 1224614 - [origin_infrastructure_265] AWS EBS volume id is regarded as invalid
Summary: [origin_infrastructure_265] AWS EBS volume id is regarded as invalid
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: OKD
Classification: Red Hat
Component: Storage
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Mark Turansky
QA Contact: Liang Xia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-05-25 06:43 UTC by Jianwei Hou
Modified: 2015-05-26 09:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-05-26 09:15:43 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jianwei Hou 2015-05-25 06:43:09 UTC
Description of problem:
Use AWS EBS volume as persistent volume, the volume id is regarded as invalid.

Version-Release number of selected component (if applicable):
Client Version: version.Info{Major:"0", Minor:"17+", GitVersion:"v0.17.1-738-gcf7b0bdc2a41d3", GitCommit:"cf7b0bdc2a41d38613ac7f8eeea91cae23553fa2", GitTreeState:"clean"}
Server Version: version.Info{Major:"0", Minor:"17+", GitVersion:"v0.17.1-738-gcf7b0bdc2a41d3", GitCommit:"cf7b0bdc2a41d38613ac7f8eeea91cae23553fa2", GitTreeState:"clean"}

How reproducible:
Always

Steps to Reproduce:
1. Launch a Fedora 21 instance on EC2, run kubernetes(hack/local-up-cluster.sh)
2. Create a volume(General Purpose), attach it to the running instance, make ext4 file system on the volume, then detach it.
3. Create a Persistent Volume with 
```
kind: PersistentVolume
apiVersion: v1beta3
metadata:
  name: aws
  labels:
    type: awsebs
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  awsElasticBlockStore:
    volumeID: vol-3234e37c
    fsType: ext4
```
cluster/kubectl.sh create -f pv.yaml

4. Create a Persistent Volume Claim with 
```
kind: PersistentVolumeClaim
apiVersion: v1beta3
metadata:
  name: myclaim-1
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi
```
cluster/kubectl.sh create -f pvc.yaml

5. Create a pod that mounts the ebs volume
```
kind: Pod
apiVersion: v1beta3
metadata:
  name: mypod
  labels:
    name: frontendhttp
spec:
  containers:
    - name: myfrontend
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
      - mountPath: "/usr/share/nginx/html"
        name: aws
  volumes:
    - name: aws
      persistentVolumeClaim:
       claimName: myclaim-1
```
cluster/kubectl.sh create -f pod.yaml

Actual results:
After step 3 and 4:
Persistent Volume and Claim were created successfully
[fedora@ip-10-142-6-35 kubernetes]$ cluster/kubectl.sh get pv
NAME      LABELS        CAPACITY      ACCESSMODES   STATUS    CLAIM
aws       type=awsebs   10737418240   RWO           Bound     default/myclaim-1

[fedora@ip-10-142-6-35 kubernetes]$ cluster/kubectl.sh get pvc
NAME        LABELS    STATUS    VOLUME
myclaim-1   map[]     Bound     aws

After step 5
The pod was always pending, checked the events, the events suggested a failure mounting the volume, the volume id was invalid.
-------------
Mon, 25 May 2015 06:20:55 +0000   Mon, 25 May 2015 06:24:25 +0000   22        mypod       Pod                   failedMount   {kubelet 127.0.0.1}   Unable to mount volumes for pod "mypod_default": Invalid scheme for AWS volume (vol-3234e37c)
Mon, 25 May 2015 06:20:55 +0000   Mon, 25 May 2015 06:24:25 +0000   22        mypod       Pod                   failedSync    {kubelet 127.0.0.1}   Error syncing pod, skipping: Invalid scheme for AWS volume (vol-3234e37c)

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

Expected results:
The volume should be attached to instance and mounted to the pod.

Additional info:

Comment 1 Jianwei Hou 2015-05-26 09:15:43 UTC
Sorry, after updating the pod.yaml, the pod can be created with the ebs volume mounted
The correct format for the pod volume should be:
---------------------
  volumes:
    - name: mypd
      source:
        persistentVolumeClaim:
          accessMode: ReadWriteOnce
          claimRef:
            name: myclaim-1 
---------------------


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