Ability to set toleration, affinity and node selector
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.
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 ;-)
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.
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"
/assign
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"
@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?
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.
/remove-lifecycle stale
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.
/remove-lifecycle stale
I am working on it now, will put up a wip PR soon.