<p>I created two PersistentVolumeClaims(one for redis, one for persistent logs) and tried to mount both in a single deployment, but after creating the deployment, I get the following error:</p>

<p><code>nodes are available: 3 node(s) didn't match node selector, 4 node(s) had no available volume zone.</code></p>

<p>However as soon as I remove one PVC from the deployment yaml file, it works fine. I am running it on Google Cloud Platform using Kubernetes engine.</p>

<p>pvc1:</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-log
spec:
  accessModes:
    - ReadWriteOnce
  volumeMode: Filesystem
  resources:
    requests:
      storage: 20Gi
  storageClassName: standard
</code></pre>

<p>pvc2:</p>

<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: pvc-redis
spec:
  accessModes:
    - ReadWriteOnce
volumeMode: Filesystem
resources:
  requests:
    storage: 20Gi
storageClassName: standard
</code></pre>

<p>deployment:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: 'prod-deployment'
spec:
  replicas: 1
template:
  metadata:
    labels:
      app: foo
      release: canary
      environment: production
  spec:
    containers:
      - name: api-server
        image: 'foo:latest'
        volumeMounts:
          - mountPath: /logs
            name: log-storage
      - name: redis
        image: 'redis'
        volumeMounts:
          - mountPath: /data
            name: redis-data
    volumes:
      - name: redis-data
        persistentVolumeClaim:
          claimName: pvc-redis
      - name: log-storage
        persistentVolumeClaim:
          claimName: pvc-log
</code></pre>

Zhiliang Xing
<p>This is similar to <a href="https://github.com/kubernetes/kubernetes/issues/34583" rel="nofollow noreferrer">this</a>. It's most likely due to a PVC trying to create a volume on an availability zone where you don't have a node in.  You can try restricting the standard <a href="https://kubernetes.io/docs/concepts/storage/storage-classes" rel="nofollow noreferrer"><code>StorageClass</code></a> to just the availability zones where you have Kubernetes nodes. Something like this:</p>

<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: standard
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-standard
allowedTopologies:
- matchLabelExpressions:
  - key: failure-domain.beta.kubernetes.io/zone
    values:
    - us-central1-a
    - us-central1-b
</code></pre>
