"pod has unbound immediate PersistentVolumeClaims" : Issue with Dynamic Volume Provisioning

363 views Asked by At

I have created a kubernetes cluster using 2 droplets (digital ocean machines) 1 machine is set to be master and another is set to be worker

Now, I am running a project which has 2 PVCs. (Their configs are same as below)

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  name: pvc1
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
  storageClassName: my-storageclass
status: {}

I set the storage class of this PVCs to ...

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: my-storageclass
  labels:
    doks.digitalocean.com/managed: "true"
provisioner: dobs.csi.digitalocean.com
allowVolumeExpansion: true
parameters:
  type: pd-ssd

My goal is to dynamically create PVs using the Dobs (Digital Ocean Block Storage) CSI

Currently when I run my application on kubernetes (I do that using helm), my pod gives me following error :

0/2 nodes are available: 1 node(s) had taint {node-role.kubernetes.io/master: }, that the pod didn't tolerate, 1 pod has unbound immediate PersistentVolumeClaims

I understand that master node will be having taints and therefore of no use to run my pods. the second part of error is "1 pod has unbound immediate PersistentVolumeClaims"

how do I fix that ? Thanks in advance !

Note: I have successfully ran my project with DOKS & EKS, I am doing this exercise to understand the concepts of volume binding in depth.

-------- Deployment ------

apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 1
  strategy:
    type: Recreate
  template:
    spec:
      containers:
        - args:
            - /bin/sh
            - -c
            - go run server.go
          image: ***.dkr.ecr.us-east-2.amazonaws.com/my-app
          imagePullPolicy: Always
          name: my-app
          ports:
            - containerPort: 9000
          resources: {}
          volumeMounts:
            - mountPath: /app/test1
              name: pvc1
            - mountPath: /app/test2
              name: pvc2
      imagePullSecrets:
        - name: my-registery-key
      restartPolicy: Always
      volumes:
        - name: pv1
          persistentVolumeClaim:
            claimName: pvc1
        - name: pv2
          persistentVolumeClaim:
            claimName: pvc2
0

There are 0 answers