Currently we allow setting spark.app.name which will set the application name that the other resource names are derived from. However, we allow setting the driver pod's name directly, but if the driver pod's name is set, the executor pod names are still derived from the Spark application name. This could make naming inconsistent, as observed in #318.
Separately, however, we could take a step back and consider if we should be setting the specific names of each of the components in the system. That is, should we allow setting the specific name of the driver pod in general? One argument against this could be that we are actually similar in precedent to other controller-like entities in the Kubernetes ecosystem, such as ReplicaSets and Deployments. These other higher-order API objects which construct children pods only allow the children's names to be derived from the parent. Or to put it another way, the children pod names cannot be specified directly, but can only be derived from the parent Deployment or ReplicaSet name.
One could propose that when we roll out the CustomResource - that is, the SparkJob object, that this should:
- Serve as the equivalent of the parent Kubernetes entity,
- The user should only be specifying the name of this parent resource, and
- The names of the children would be derived from the parent.
The downside is that this imposes the requirement of having the CustomResource type set up on their cluster, which is a dependency that shouldn't truly be mandatory.
We could remove the API to set the driver pod name directly, which forces everything to be derived from the application name, and thus everything would always be consistent. If the user has the CustomResource type configured, then we would set the CustomResource's name to equal the application name, which makes the derivation and the tree clear as is discussed above. However, users have shown interest in setting this pod's name specifically before (see #258).