Support nodeSelector in spark-submit pod (#1250)

This commit is contained in:
urihoenig 2021-05-04 02:30:29 +03:00 committed by GitHub
parent 6f35a11526
commit 0ac8b878d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -130,6 +130,10 @@ func (sjm *realSubmissionJobManager) createSubmissionJob(app *v1beta2.SparkAppli
if app.Spec.ServiceAccount != nil {
job.Spec.Template.Spec.ServiceAccountName = *app.Spec.ServiceAccount
}
if len(app.Spec.NodeSelector) > 0 {
job.Spec.Template.Spec.NodeSelector = app.Spec.NodeSelector
}
// Copy the labels on the SparkApplication to the Job.
for key, val := range app.Labels {
job.Labels[key] = val