<p>I have an existing ebs volume in AWS with data on it. I need to create a PVC in order to use it in my pods.
Following this guide: <a href="https://medium.com/pablo-perez/launching-a-pod-with-an-existing-ebs-volume-mounted-in-k8s-7b5506fa7fa3" rel="nofollow noreferrer">https://medium.com/pablo-perez/launching-a-pod-with-an-existing-ebs-volume-mounted-in-k8s-7b5506fa7fa3</a></p>
<p>persistentvolume.yaml</p>
<pre><code>kind: PersistentVolume
apiVersion: v1
metadata:
  name: jenkins-volume
  labels:
    type: amazonEBS
spec:
  capacity:
    storage: 60Gi
  accessModes:
    - ReadWriteOnce
  awsElasticBlockStore:
    volumeID: vol-011111111x
    fsType: ext4
</code></pre>
<pre><code>[$$]&gt;kubectl describe pv
Name:            jenkins-volume
Labels:          type=amazonEBS
Annotations:     &lt;none&gt;
Finalizers:      [kubernetes.io/pv-protection]
StorageClass:
Status:          Available
Claim:
Reclaim Policy:  Retain
Access Modes:    RWO
VolumeMode:      Filesystem
Capacity:        60Gi
Node Affinity:   &lt;none&gt;
Message:
Source:
    Type:       AWSElasticBlockStore (a Persistent Disk resource in AWS)
    VolumeID:   vol-011111111x
    FSType:     ext4
    Partition:  0
    ReadOnly:   false
Events:         &lt;none&gt;
</code></pre>
<p>persistentVolumeClaim.yaml</p>
<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: jenkins-pvc-shared4
  namespace: jenkins
spec:
  storageClassName: gp2
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 60Gi
</code></pre>
<pre><code>[$$]&gt;kubectl describe pvc jenkins-pvc-shared4 -n jenkins
Name:          jenkins-pvc-shared4
Namespace:     jenkins
StorageClass:  gp2
Status:        Pending
Volume:
Labels:        &lt;none&gt;
Annotations:   &lt;none&gt;
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:
Access Modes:
VolumeMode:    Filesystem
Mounted By:    &lt;none&gt;
Events:
  Type    Reason                Age                From                         Message
  ----    ------                ----               ----                         -------
  Normal  WaitForFirstConsumer  12s (x2 over 21s)  persistentvolume-controller  waiting for first consumer to be created before binding
[$$]&gt;kubectl get pvc jenkins-pvc-shared4 -n jenkins
NAME                  STATUS    VOLUME   CAPACITY   ACCESS MODES   STORAGECLASS   AGE
jenkins-pvc-shared4   Pending                                      gp2            36s
</code></pre>
<p>Status is pending (waiting to the consumer to be attached) - but it should already be provisioned.</p>

SimonSK
<p>The right config should be:</p>
<pre><code>[$$]&gt;cat persistentvolume2.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-name
spec:
  accessModes:
  - ReadWriteOnce
  awsElasticBlockStore:
    fsType: ext4
    volumeID: aws://eu-west-2a/vol-123456-ID
  capacity:
    storage: 60Gi
  persistentVolumeReclaimPolicy: Retain
  storageClassName: gp2

[$$]&gt;cat persistentVolumeClaim2.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  namespace: new-namespace
  labels:
    app.kubernetes.io/name: &lt;app-name&gt;
  name: pvc-name
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 60Gi
  storageClassName: gp2
  volumeName: pv-name
</code></pre>
