title: VolumeClaim in Kubernetes Google Cloud
body: <p>I am trying to create both a PersistentVolume and a PersistentVolumeClaim on Google Kubernetes Engine. </p>
  
  <p>The way to link them is via labelSelector.
  I am creating the objects with this definition:</p>
  
  <p>volume.yml</p>
  
  <pre><code>---
  apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: pv-test
    namespace: mynamespace
    labels:
      pv-owner: owner
      pv-usage: pv-test
  spec:
    accessModes:
      - ReadWriteOnce
    capacity:
      storage: 1Gi
    hostPath:
      path: /data/test/
  ---
  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: pv-test
    namespace: mynamespace
  spec:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 1Gi
    selector:
      matchLabels:
        pv-usage: pv-test
  </code></pre>
  
  <p>and running:</p>
  
  <pre><code>kubectl apply -f volume.yml
  </code></pre>
  
  <p>Both objects are successfully created, however, VolumeClaim apparently keeps pending forever awaiting a Volume that matches its requirements.</p>
  
  <p>Could you please help me?</p>
  
  <p>Thanks!</p>