PersistentVolume not attached

This validator detects a condition when a PersistentVolume is not used or referenced from PersistentVolumeClaim.

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

Example

apiVersion: v1 kind: PersistentVolume metadata: name: pvc-00000000-0000-0000-0000-000000000000 # This PV is not used ...

Resolution

  • Check if the workloads and PVCs were removed, and if this persistent volume should be deleted.
  • If the volume should be in use, it can be bound the PersistentVolumeClaim
  • Resolution Example

    apiVersion: v1 kind: PersistentVolumeClaim spec: resources: requests: storage: 8Gi volumeMode: Filesystem volumeName: pvc-00000000-0000-0000-0000-000000000000 # Reference here accessModes: - ReadWriteOnce storageClassName: gp2

    Need other validation rules?

    Please let us know if there are other built-in validation rules you would like to see in Kubevious to detect misconfigurations and violations to best practices. Optionally, you can provide your details so we can reach out to you with follow-up questions.

    Share this article on:
    message