title: Kubernetes provisioning PVC from GCE Persistent disk volume shows error
body: <p>I am using a GCE cluster with 2 nodes, which I set up using kubeadm. Now I want to set up a persistent volume for postgresql to be deployed. I created a PVC and PV with a storageClass and also created a disk space with 10G in name <strong>postgres</strong> in the same project.Iam attaching the scripts for the PVC,PV,and Deployment below.Also I am using a service account that have the access to the disks.</p>
  
  <p>1.Deployment.yml</p>
  
  <pre><code>apiVersion: apps/v1
  kind: Deployment 
  metadata:
    name: kyc-postgres
  spec:
    replicas: 1
    selector:
      matchLabels:
        app: postgres
    template:
      metadata:
        labels:
          app: postgres
      spec:
        containers:
        - image: "postgres:9.6.2"
          name: postgres
          ports:
          - containerPort: 5432
            name: postgres
          volumeMounts:
          - name: postgres-storage
            mountPath: /var/lib/postgresql/db-data
        volumes:
        - name: postgres-storage
          persistentVolumeClaim:
            claimName: kyc-postgres-pvc
  </code></pre>
  
  <p>2.PersistentVolumeClaim.yml</p>
  
  <pre><code>apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: kyc-postgres-pvc
  spec:
    accessModes:
      - ReadWriteOnce
    resources:
      requests:
        storage: 5Gi
    storageClassName: standard
  
  </code></pre>
  
  <p>3.PersistentVolume.yml</p>
  
  <pre><code>apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: kyc-postgres-pv
    annotations:
      kubernetes.io/createdby: gce-pd-dynamic-provisioner
      pv.kubernetes.io/bound-by-controller: "yes"
      pv.kubernetes.io/provisioned-by: kubernetes.io/gce-pd
    finalizers:
    - kubernetes.io/pv-protection
  spec:
    accessModes:
      - ReadWriteOnce
    capacity:
      storage: 5Gi
    claimRef:
      apiVersion: v1
      kind: PersistentVolumeClaim
      name: kyc-postgres-pvc
      namespace: default
    gcePersistentDisk:
      fsType: NTFS
      pdName: postgres
    nodeAffinity:
      required:
        nodeSelectorTerms:
        - matchExpressions:
          - key: failure-domain.beta.kubernetes.io/zone
            operator: In
            values:
            - us-central1-a
          - key: failure-domain.beta.kubernetes.io/region
            operator: In
            values:
            - us-central1-a
    persistentVolumeReclaimPolicy: Delete
    storageClassName: standard
    volumeMode: Filesystem
  status:
    phase: Bound
  </code></pre>
  
  <ol start="4">
  <li>StorageClass.yml</li>
  </ol>
  
  <pre><code>apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
    name: standard
  provisioner: kubernetes.io/gce-pd
  parameters:
    type: pd-standard
    zone: us-central1-a
  </code></pre>
  
  <p>Now when I create these volumes and deployments, the pod is not getting started properly.Iam getting the following errors when I tired creating deployments.</p>
  
  <pre><code>Failed to get GCE GCECloudProvider with error &lt;nil&gt;
  </code></pre>
  
  <p>Also Iam attaching my output for <code>kubectl get sc</code></p>
  
  <pre><code>NAME       PROVISIONER            RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
  standard   kubernetes.io/gce-pd   Delete          Immediate           false                  10m
  </code></pre>
  
  <p>Can someone help me with this.Thanks in advance for your time – if I’ve missed out anything, over- or under-emphasised a specific point let me know in the comments.</p>