Skip to content
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

Ability to set toleration, affinity and node selector #1841

Closed
Shashankft9 opened this issue Aug 3, 2023 · 10 comments · Fixed by #1924
Closed

Ability to set toleration, affinity and node selector #1841

Shashankft9 opened this issue Aug 3, 2023 · 10 comments · Fixed by #1924
Assignees
Labels
kind/feature New feature or request

Comments

@Shashankft9
Copy link
Member

Feature request

I should be able to set toleration, affinity and node selector on my ksvc, when enabled through the featuregate mentioned here: https://knative.dev/docs/serving/configuration/feature-flags.

Use case

I have a cluster where two nodes are having a different mtu set on them, so I don't want my ksvc pods to be scheduled there. Would have been helpful if i could set it globally through some configmap in knative-serving, but I dont think thats available.

@Shashankft9 Shashankft9 added the kind/feature New feature or request label Aug 3, 2023
@rhuss
Copy link
Contributor

rhuss commented Aug 3, 2023

That's a good idea, and it shouldn't be hard to implement it with some extra options. If you are fancy feel free to add it after we have discussed about the naming. We ❤️ contributions ;-)

@dsimansk
Copy link
Contributor

dsimansk commented Aug 3, 2023

I wonder if the impl should check for feature flags to be enabled though. It might be really trick to provide appropriate feedback to user otherwise.

@rhuss
Copy link
Contributor

rhuss commented Aug 3, 2023

Good point, but I'm afraid that there is no Knative-only API for querying this information ... maybe just try and returning an error with a descriptive error message as feedback. In the help message we can indicate this (e..g with a footnote like add ing a "*" to the message text and then in the bottom something like "only if enabled in the Knative installation"

@Shashankft9
Copy link
Member Author

/assign

@Shashankft9
Copy link
Member Author

would the following work?

--tolerations stringArray    Tolerations to be set. Example: --tolerations Key="key1", Operator="Equal", Value="value1", Effect="NoSchedule"
--affinity stringArray       Node Affinity to be set. Examples: --affinity Type="Required", Key="topology.kubernetes.io/zone", Operator="In", Values="antarctica-east1, antarctica-west1"
--node-selector string       Node Selector to be set. Examples: --node-selector Disktype="ssd"

@dsimansk
Copy link
Contributor

dsimansk commented Aug 15, 2023

@Shashankft9 yes that looks like a good start. Please make sure key values are case insensitive on user inputs, but correctly represented on .PodSpec.

Do you need any hints wrt/ the implementation? You can check similar flags in the flags package.

Btw I wonder how Serving validation webhook reacts to providing these values with disabled feature flags. Could you check it please?

Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 14, 2023
@rhuss rhuss reopened this Dec 14, 2023
@rhuss
Copy link
Contributor

rhuss commented Dec 14, 2023

/remove-lifecycle stale

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 14, 2023
Copy link

This issue is stale because it has been open for 90 days with no
activity. It will automatically close after 30 more days of
inactivity. Reopen the issue with /reopen. Mark the issue as
fresh by adding the comment /remove-lifecycle stale.

@github-actions github-actions bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 14, 2024
@Shashankft9
Copy link
Member Author

/remove-lifecycle stale

I am working on it now, will put up a wip PR soon.

@knative-prow knative-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
3 participants