PersistentVolumeClaim not attached

PersistentVolumeClaims allow mounting permanent storage volumes to workloads. This validator detects a condition when a PersistentVolumeClaim is not used or referenced from workloads.

Affected Resources: Deployment, DaemonSet, StatefulSet, CronJob, Job, ReplicaSet, Pod

Example

apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-minio # This PVC is not used ...

Resolution

  • Check if the workloads were removed, and the PVC should also be deleted.
  • Check if there was a typo in the workload volume spec.
  • Resolution Example

    kind: Deployment spec: template: spec: volumes: - name: data persistentVolumeClaim: claimName: test-minio # Fix the claimName ...
    Share this article on:
    message