allow setting Kubernetes node affinity in KFP pipelines #3155
Labels
component:pipeline-runtime
issues related to pipeline runtimes e.g. kubeflow pipelines
kind:enhancement
New feature or request
platform: pipeline-Kubeflow
Related to usage of Kubeflow Pipelines as pipeline runtime
Similar to #2823
Is your feature request related to a problem? Please describe.
It is common practice in Kubernetes to select where pods are running by providing a node affinity to pods that match a node label or field, thus making sure that the pod will be scheduled to specific nodes that meet specific requirements (e.g., belong to specific zones or regions, have federated non-shareable data, have custom HW that the vendor hasn't created any device plugins and admission controllers yet or other use cases).
Currently, there is no way to specify a Node affinity in Elyra Kubeflow pipelines, this means that the selection of the node for running Elyra pipelines can be done only with node tolerations, a cumbersome practice in certain use cases.
Describe the solution you'd like
We can resolve this by allowing users to specify a list of "node affinities" in a similar way to the "node taints" (see PR #2848).
We only need to allow the user to set the type of node affinity (
requiredDuringSchedulingIgnoredDuringExecution
orpreferredDuringSchedulingIgnoredDuringExecution
), (weight*), key, operator, and value(s).* Since only the
preferredDuringSchedulingIgnoredDuringExecution
type needs aweight
for its definition, I think it's an implementation decision if the user is allowed to select this parameter as well.Additional context
See the Assigning Pods to Nodes k8s docs
See kfp.dsl.BaseOp().add_affinity() for more information about adding affinity in KFP
See the Node Affinity v1 core spec for details about how a node affinity is defined.
The text was updated successfully, but these errors were encountered: