-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Implement duck-typing for ScaledObject #591
Comments
@zroubalik not sure if this is something you were interested to lead out? |
@jeffhollan yes, happy to do so :) assigning to myself |
Can we add a link to the concept for the folks who are not aware? Might help understands what's coming! |
@tomkerkhove absolutely, I will add some details to the description later on |
Here is a KubeCon talk I found about this: https://www.youtube.com/watch?reload=9&v=kldVg63Utuw |
You can ask me questions if you have them. |
Me too 🍿 |
If we want to add a KEDA duck type, in particular it will mean, that we define a shape of a on object (the properties needed by KEDA, basically these ones which are currently in For example we have a
the CR extended by properties needed for KEDA could look like this: apiVersion: foo.bar/v1alpha1
kind: MyCustomResource
metadata:
name: ResourceScaledByKeda
labels:
myLabel: value # labels specified on the CR
...
duck.keda.sh/scalable: true # KEDA could discover CRs by a label
spec:
specField1: value1 # spec field that is originally specified by this particular CR
specField2: value2 # spec field that is originally specified by this particular CR
...
status:
myCustomResourceStatusField1: value # status field that is originally specified by this particular CR
myCustomResourceStatusField2: value # status field that is originally specified by this particular CR
...
kedaSpec: # values needed by KEDA, originally in scaledObject.spec
pollingInterval: 30
cooldownPeriod: 300
minReplicaCount: 0
maxReplicaCount: 10
triggers:
... # triggers section
kedaStatus: # values needed by KEDA, originally in scaledObject.status
lastActiveTime: value
externalMetricNames: values
... Concerns
Proposal @n3wscott @mattmoor please correct me, if I am wrong in my assumptions |
You don't want to stuff things into another resource's schema. You can define a KEDA CRD with the spec/status you want and associate it (OwnerRefs) with that resource. In this world, the original resource acts as the source-of-truth for the original partial schema to seed KEDA's state, and this is projected into a new concrete child resource that codifies KEDA's state. I believe (@n3wscott correct me) this is somewhat similar to how Knative Channels work. There is both a concrete Channel and domain-specific variants KafkaChannel. |
We have decided to go with the direction on generic scaling based on Closing this for now. We can reopen if there's a demand in the future. |
Signed-off-by: Joshua Jackson <[email protected]>
There is a pattern to have CRDs utilize "duck-typing" so that they can flexibly support other types that it may not even know about. I'm not an expert on this :) - but I believe this could help make our
ScaledObject
a bit nicer between the 3 kinds: Scale Deployment, Scale Jobs, Scale StatefulSet.We could implement this pattern for a future release
The text was updated successfully, but these errors were encountered: