Skip to content

Commit

Permalink
SchedulerName config (flyteorg#78)
Browse files Browse the repository at this point in the history
Add SchedulerName option that will propagate to PodSpec
  • Loading branch information
vsbus authored Apr 13, 2020
1 parent 9721448 commit 69d5008
Show file tree
Hide file tree
Showing 6 changed files with 119 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ type K8sPluginConfig struct {
// Node Selector Labels for interruptible pods: Similar to InterruptibleTolerations, these node selector labels are added for pods that can tolerate
// eviction.
InterruptibleNodeSelector map[string]string `json:"interruptible-node-selector" pflag:"-,Defines a set of node selector labels to add to the interruptible pods."`
// Scheduler name.
SchedulerName string `json:"scheduler-name" pflag:",Defines scheduler name."`
}

// Retrieves the current k8s plugin config or default.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ func ToK8sPodSpec(ctx context.Context, taskExecutionMetadata pluginsCore.TaskExe
Tolerations: GetPodTolerations(taskExecutionMetadata.IsInterruptible(), c.Resources),
ServiceAccountName: taskExecutionMetadata.GetK8sServiceAccount(),
NodeSelector: config.GetK8sPluginConfig().InterruptibleNodeSelector,
SchedulerName: config.GetK8sPluginConfig().SchedulerName,
}, nil
}
return &v1.PodSpec{
Expand All @@ -51,6 +52,7 @@ func ToK8sPodSpec(ctx context.Context, taskExecutionMetadata pluginsCore.TaskExe
Containers: containers,
Tolerations: GetPodTolerations(taskExecutionMetadata.IsInterruptible(), c.Resources),
ServiceAccountName: taskExecutionMetadata.GetK8sServiceAccount(),
SchedulerName: config.GetK8sPluginConfig().SchedulerName,
}, nil

}
Expand Down
4 changes: 4 additions & 0 deletions flyteplugins/go/tasks/plugins/presto/config/config_flags.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

88 changes: 88 additions & 0 deletions flyteplugins/go/tasks/plugins/presto/config/config_flags_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69d5008

Please sign in to comment.