We are developing app controller which requires disk to be assigned to Pod. We get the disk details from user in yaml format and create PV/PVC and assign the disks to the Pod.
We do not have a mechanism to determine if the disk is passed is a valid disk unless the pod creation fails. Is there a way we can determine if the disk passed are valid disks? For example, we pass following:
apiVersion: app.example.com/v1alpha1
kind: SystemApp
metadata:
name: systemapp-1
namespace: app1
spec:
appDetails:
- name: app1
port: 3030
- name: app2
port: 3031
DiskDetails:
diskName:
- /dev/sdf1
- /dev/sdg1
workerNodes:
- worker1
- worker2
How do I know if /dev/sdf1 and /dev/sdg1 are valid devices before Pod failure? Can we validate these disks in Webhook if they really exist on mentioned worker nodes?
4