Home > Software engineering >  0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims. preemption: 0/2 nodes a
0/2 nodes are available: 2 pod has unbound immediate PersistentVolumeClaims. preemption: 0/2 nodes a

Time:09-19

I am deploying a jenkins on one master one node Kubernetes cluster, iam getting error when i try to do Dynamic Volume Provisioning. not sure what went wrong. please help.

enter image description here

my storageclass file

kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: standard
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
reclaimPolicy: Retain
mountOptions:
  - debug
volumeBindingMode: Immediate

my PVC file

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: jenkins-pvc
  labels:
    type: amazonEBS
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 40Gi
  storageClassName: standard
  volumeMode: Filesystem

Deployment file

apiVersion: apps/v1
kind: Deployment
metadata:
  name: jenkins
spec:
  selector:
    matchLabels:
      app: jcasc
  replicas: 1
  template:
    metadata:
      labels:
        app: jcasc
    spec:
      volumes:
       - name: jenkins-pvc
         persistentVolumeClaim:
           claimName: jenkins-pvc

      containers:
        - name: jenkins
          image: jenkins:latest
          ports:
            - containerPort: 8080
          volumeMounts:
            - name: jenkins-pvc
              mountPath: "/var/jenkins_home"

CodePudding user response:

Find this troubleshooting doc for Fixing Pod Has Unbound Immediate PersistentVolumeClaims Error and also For dynamic provisioning you can see this doc. For pv doc

CodePudding user response:

kubectl get pvc can you see your pvc in output ?

  • Related