Ideally should be in cluster advance option there is spark configuration.
It can be set from pyspark code as well.
There is policy as well which you can create and your cluster should use it so will install libs and I think configuration also. A