-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Proposed feature: Plugable revision deployers #4152
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: jroper If they are not already assigned, you can assign the PR to them by writing The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Hi @jroper. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/ok-to-test |
My 2 cents here is the contract between (Revision, Autoscaler) <=> Deployment is very highly coupled and doesn't have a clear interface/separation ie. There are expectations for Deployments to sidecar a queue-proxy for things to work. Thus I think 3rd party Deployers will suffer a lot of churn as these informal contracts/assumptions change. |
I agree. Perhaps we should hash this out in an issue first? |
This PR is being raised primarily to solicit feedback in the context of code. I expect there to be iterations back and forth on this change, and I hope to attend to the knative serving API working group to discuss there as well. Also, no tests yet, so at very least that needs to be addressed before merging.
The context (ie, use case) for this can be seen in this mailing list post:
https://groups.google.com/d/msg/knative-dev/ZjB1EJOkZRg/eu5Gic3iBAAJ
Based on feedback there, I've created this PR. What this PR does is makes the deployment of revisions plugable. This is done by adding a
deployer
field to the revision spec. It defaults toKnativeServing
, and if it isKnativeServing
, then the controller will create and update the deployment as normal. However, if it is anything other thanKnativeServing
, then the controller will not create or update the deployment, and it will expect another operator, supplied by a third party, to create and update the deployment instead.Using this change, we have created an operator that uses this, and deploys functions with a sidecar written in Akka that implements stateful functions (in some ways, similar to Azure's stateful entities, however far more powerful). Note though that this use case is far more than just replacing the sidecar image, a custom deployer is needed to be able to wire the sidecar to an appropriate persistence store, as well as to configure the sidecar to form a cluster (this is used to shard event sourced entities across the user functions). So it wouldn't be enough to just make the sidecar image configurable, we needed to be able to customise the deployment itself.
You can see this work here, though it's a big project:
https://github.com/lightbend/stateful-serverless/tree/knative-integration
Perhaps most pertinent is what it actually looks like to deploy a function that uses this feature, that can be seen here:
It was suggested that we might use an annotation to specify the deployer, and while this would work for selecting the deployer, the problem with it is that deployers may need their own configuration, for example, in this case, the function needs to be associated with a configured journal resource (another CRD that our project provides), and some configuration is required to say how that journal should be used (in this case, the keyspace is specified). This configuration could all be supplied using annotations too, but that feels like an abuse of annotations - it feels more natural and logical to include it in the spec. That's why we've gone for an approach of including the deployer in the spec. The deployers
config
property is handled by the knative serving controller as raw JSON message, so it's passed from service to configuration to revision as is, and it's up to the deployer to make sense of it.