Skip to content

allow setting Kubernetes node affinity in KFP pipelines #3155

Open
@mikekaram

Description

@mikekaram

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 or preferredDuringSchedulingIgnoredDuringExecution), (weight*), key, operator, and value(s).
* Since only the preferredDuringSchedulingIgnoredDuringExecution type needs a weight 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    component:pipeline-runtimeissues related to pipeline runtimes e.g. kubeflow pipelineskind:enhancementNew feature or requestplatform: pipeline-KubeflowRelated to usage of Kubeflow Pipelines as pipeline runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions