This demonstrates a simple “scratch” volume kubernetes plugin.

It is implemented here as a separate plugin, but it could also have been combined with the general plugin with the use of an additional property. The plugin is deployed to all the cluster nodes, along with stashed credentials (in the form of a keytab file) for a principal that is authorized to perform the necessary operations on a target server. The volume property specifies a ‘mktemp’ template used to build the final volume name. The volume is created and mounted into the pod. When the pod is deleted, the volume is unmounted and deleted.