volcano icon indicating copy to clipboard operation
volcano copied to clipboard

Replace `hostPath` with `emptyDir`or PVC in Scheduler Deployment

Open strangiato opened this issue 1 year ago • 3 comments

What would you like to be added:

Currently the Scheduler Deployment utilizes a hostPath to setup a volume for /tmp/klog-socks:

https://github.com/volcano-sh/volcano/blob/b834fa8939f6ecbb8e96d80a5f1151323956dfdc/installer/helm/chart/volcano/templates/scheduler.yaml#L178C19-L178C19

https://github.com/volcano-sh/volcano/blob/b834fa8939f6ecbb8e96d80a5f1151323956dfdc/installer/volcano-development.yaml#L4117

Instead of utilizing hostPath the deployments could instead utilize an emptyDir or a PVC.

Why is this needed:

As the official k8s documentation states, hostPath presents a security risk and should only be considered if absolutely necessary:

https://kubernetes.io/docs/concepts/storage/volumes/#hostpath

As far as I can tell Volcano is only writing logs to that location and it does not fit the recommended use cases outlined in the k8s docs.

emptyDir is a great option for a temporary storage location that can be discarded any time the pod restarts. Since this volume is writing to /tmp I would assume that it is not critical to keep these logs.

A PVC would be more ideal if the logs do need to persist across the pod restarts.

strangiato avatar Jan 11 '24 22:01 strangiato

Yeah, you're right, feel free to make corresponding modifications based on your thought: )

Monokaix avatar Jan 12 '24 09:01 Monokaix

PR Submitted: #3303

strangiato avatar Jan 17 '24 21:01 strangiato

/assign @strangiato

justankiit avatar Feb 06 '24 09:02 justankiit