Firstly would like to mention that, spark dynamic allocation not supported for kubernetes yet(as of version 3.0.1), its in pipeline for future release Link
while for the requirement you have posted, you could address by running a resource monitor code snippet before the job initialized and terminate the initialization pod itself with error.
if you want to run this from CLI you could use kubectl describe nodes
/ kube-capacity utility to monitor the resources
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…