Add support for setting adapter Affinity#1381
Conversation
odacremolbap
left a comment
There was a problem hiding this comment.
Nicely done.
The CRDs are now humongous, but this is the way of implementing this. ✔️
|
Oh my... are you sure that we want our CRDs to look like this? This update makes them 5 times bigger (~12Kb vs 62Kb) 😨 |
|
@tzununbekov @odacremolbap I've updated the PR to make the affinity arbitrary and I've added checks at the Webhook to verify things like some wrong names in the affinity. |
|
Thanks. I see a lot of things done for the webhook and I'm struggling to find the reason. Could you point me to the code that implements webhook validation logic? |
|
@tzununbekov There are some Unmarshal that are done automatically. if I add an affinity like this: it will return this error at the creation time: We could add more checks in the Validate func but I don't see what could we checks at this point |
|
I'm pretty sure that the Defaulting webhook error is a side-effect of internal object processing and not its direct function; the Validation webhook should do that kind of validation. Nevertheless, we can live with that. I tested the Affinity function and it doesn't work for me. I did some digging and it looks like it is not the way it works in the Knative. Are you sure that it works for you? Please try to create the Kn-based adapter and check if it is online. |
|
@tzununbekov What do you mean that it doesn't works for you? I've tested creating a source, the adapter is running and checking if the deployment has the affinity set: About the Webhook, to check our objects with the webhook we need to add them to the |
|
It looks like you tested only a Deployment-based component, not a Kn-based one. Knative serving, by default, does not allow setting the affinity parameter, it should be enabled through the Features and Extensions configuration. Otherwise, adapter deployment won't pass Serving validation. Btw, the same goes for the IMO, this detail must have been mentioned because without knowing that, setting these adapter overrides may cost some hours of debugging the "outdated adapter specs" kind of issue. Regarding the webhook implementation, I think we're on different pages. What I'm saying is that there is not much sense in having a webhook controller up and running while none of our components have Validation and Default methods implemented (those numerous
I leaning towards the first option. Looks like Knative also does not care about validating these features (here). |
|
We already have support for tolerations in the same way, I just follow that pattern. Webhook: |
tzununbekov
left a comment
There was a problem hiding this comment.
A couple of small comments before the merge.
|
@FranBarrera can you please add an example of how can I add |
|
Hi @mukundjalan The syntax in the spec is Does that help ? We can discuss more on Slack if you want |
Closes #768.
Example:
Result: