I've always understood the Spark shells, be it PySpark or Scala, run in the client mode. And correct me if I'm wrong, there isn't an out-of-the-box configuration to use them in cluster mode.
Why is this the case? What makes cluster mode unsuitable for these interactive shells?
Network latency between the client and driver may be one factor. And if YARN is used, there may a higher initial startup time since cluster resources for the driver needs to be provisioned from the YARN Resource Manager. But it seems to me these two factors are not serious blockers.
EDIT
The question Spark-submit / spark-shell > difference between yarn-client and yarn-cluster mode is related, but doesn't focus on (and the answers do not cover) why the shells cannot run in cluster mode.
pyspark --deploy-mode cluster
Error: Cluster deploy mode is not applicable to Spark shells.