Skip to content

Support setting pod tolerations/node selectors for Devfile containers via an attribute #689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
amisevsk opened this issue Nov 22, 2021 · 5 comments
Labels
area/api Enhancement or issue related to the api/devfile specification

Comments

@amisevsk
Copy link
Contributor

Which area this feature is related to?

/area api

Which functionality do you think we should add?

It would be convenient to have a way to specify pod tolerations and node selectors for containers in a Devfile. Since this is an advanced feature, it makes sense to implement as a top-level attribute

Why is this needed? Is your feature request related to a problem?

In some cases, pod tolerations and node selectors would enable running Devfile workloads on specific nodes in a cluster. This could be used to e.g. assign Devfiles to GPU-enabled nodes, or to constrain/allocate Devfile resources to specific nodes on the cluster.

Describe the solution you'd like

Define new attributes in devfile/api, e.g. pod-tolerations, and node-selector which would be used to define the fields in a Pod:

schemaVersion: 2.0.0
metadata:
  name: sample-tolerations
attributes:
  pod-tolerations:
    - key: "example-key"
      operator: "Exists"
      effect: "NoSchedule"
  node-selector:
    disktype: ssd

i.e. the structure of the pod-tolerations attribute is the same as the corresponding Kubernetes object, and the structure for node-selector is a key-value map.

Describe alternatives you've considered

The main alternative would be supporting it as a field somewhere in the Devfile (i.e. not an attribute). The issues with this are

  1. It's unclear how to do this, since we define containers in the devfile but the toleration/selector would apply to the Pod that includes multiple containers
  2. It's an advanced use case, so adding it to the Devfile spec would clutter to API.

Using an attribute for this purpose leaves the door open to including it as Devfile field in the future if there is a need, as migration would be relatively straightforward.

Additional context

Originally raised in devfile/devworkspace-operator#614. While we could implement this on the DevWorkspace Operator side via attribute, I think it's useful enough for all Devfiles that the specific attribute we read should be defined as part of the API.

Docs on tolerations: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/

Docs on node selectors https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/

@amisevsk
Copy link
Contributor Author

After discussion, a few concerns were raised:

  • Adding these settings (as attributes or as fields in the spec) adds complexity to the devfile API, and we want to keep it simple
  • As an attribute, it's unclear how support would be managed (i.e. do all tools using the devfile API have to respect these attributes?)

As a result, and since there isn't a good consensus on how this should be done, this issue is on hold for now.

@Jdubrick
Copy link
Contributor

Revisiting, is this still something we want to consider for devfile?

cc @michael-valdron @thepetk

@thepetk
Copy link
Contributor

thepetk commented Mar 1, 2024

@Jdubrick I think this should be closed for now because a lot of time passed since the creation of the issue.

@michael-valdron
Copy link
Member

Revisiting, is this still something we want to consider for devfile?

cc @michael-valdron @thepetk

@Jdubrick I think this should be closed for now because a lot of time passed since the creation of the issue.

+1 since devfile is focusing on maintaining the current schema atm, I would close this one as not planned for now and we can re-open on a future date if it becomes a priority.

@Jdubrick
Copy link
Contributor

Jdubrick commented Mar 1, 2024

Closing issue as not planned then, see above for reasoning.

@Jdubrick Jdubrick closed this as not planned Won't fix, can't repro, duplicate, stale Mar 1, 2024
@github-project-automation github-project-automation bot moved this to Done ✅ in Devfile Project Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api Enhancement or issue related to the api/devfile specification
Projects
Status: Done ✅
Development

No branches or pull requests

4 participants