public static Map<String, Set<String>> getServiceVolumeNames(List<V1PersistentVolumeClaim> pvcList) {
		if (pvcList == null || pvcList.isEmpty()) {
			return null;
		}

		Map<String, Set<String>> serviceVolumes = new HashMap<>();

		pvcList.stream().forEach(pvc -> {
			Map<String, String> labels = pvc.getMetadata().getLabels();
			String serviceName = ResourceLabelUtil.getServiceName(labels);
			if (serviceVolumes.get(serviceName) == null) {
				serviceVolumes.put(serviceName, new HashSet<>());
			}
			serviceVolumes.get(serviceName).add(getVolumeName(pvc));
		});

		return serviceVolumes;
	}
Utility to get volume related information from resource
deployer/deployer-services/src/main/java/io/hyscale/deployer/services/util/KubernetesVolumeUtil.java