kubeflow / fairing

Python SDK for building, training, and deploying ML models
Apache License 2.0
337 stars 144 forks source link

Apply node_selector for pod_spec_mutator #559

Closed Aachunella closed 3 years ago

Aachunella commented 3 years ago

/kind feature

Describe the solution you'd like When I use the fairing we couldn't apply node selector for pod_spec_mutator easily. I could designate node selector by a function,

def set_node_selector(node_selector):
    def _set_node_selector(kube_master, pod_spec, namespace):
        if node_selector is not None:
            pod_spec.node_selector = node_selector

    return _set_node_selector

Anything else you would like to add: It would be better to add a function to kubernetes/utils.py.

Can I make a PR for this function?