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:
nodes are available: 3 node(s) didn't match node selector, 4 node(s) had no available volume zone.
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.
pvc1:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-log
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 20Gi
storageClassName: standard
pvc2:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-redis
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 20Gi
storageClassName: standard
deployment:
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