-
Notifications
You must be signed in to change notification settings - Fork 102
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
Not creating app deployments #78
Conversation
Fixes kedacore#35 Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Also generalizing test "infrastructure" code Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some docs please?
Users provide a scale target ref, which is the name of the deployment to scale and the service to route to. They are required to have already deployed these things already Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
@tomkerkhove yup, documentation added here. I also removed the functionality that creates application |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good, thanks for making the change!
Added a few suggestions and was wondering why we are adding the xkcd Helm chart? Maybe we should leave that one out?
As said above, you need to route your HTTP traffic to the `Service` that the add on has created. If you have existing systems - like an ingress controller - you'll need to anticipate the name of these created `Service`s. Each one will be named consistently like so, in the same namespace as the `HTTPScaledObject` and your application (i.e. `$NAMESPACE`): | ||
|
||
```shell | ||
<deployment name>-interceptor-proxy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also make the interceptor service configurable?
kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
name: xkcd
spec:
scaleTargetRef:
deployment: xkcd
service: xkcd
port: 8080
service:
name: my-interceptor-proxy
port: 9999
type: LoadBalancer
Or just surface it like this:
kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
name: xkcd
spec:
scaleTargetRef:
deployment: xkcd
service: xkcd
port: 8080
service:
name: my-interceptor-proxy
spec:
selector:
app: MyApp
ports:
- protocol: TCP
port: 80
targetPort: 9376
Happy to open an issue if you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomkerkhove yea, can you create an issue for that? One thing I wonder is, should we not have it create a Service
at all? By not doing so, we won't impose limitations on how they're configured.
We could then add to the documentation that users can create a Service
with a specific label selector if they want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think @zroubalik?
I think having it part of the spec might be useful? Users and reading docs doesn't always go that well 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good point 😆. Would it be possible to merge this and then either add the service
field or remove Service
creation altogether in a follow up (depending on what you and @zroubalik decide)?
Also, if this helps:
In the scope doc, it says the following is in scope: Route HTTP traffic from a given source to an arbitrary HTTP server, as far as we need to efficiently accomplish (1)
. That could help the decision. I'd like to prefer having the operator create less things, but I'll defer to what you and @zroubalik think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving to another PR is fine for me, but this feels like something we need to have to be able to work imo since this is for the interceptor.
If they have to create the service for KEDA, then it's too much infrastructure imo.
It's all about how you approach it. When I create an HTTPScaledObject you could add a field that surfaces the port + IP (if need be) so that it's all in that CRD when doing k get HTTPScaledObject
and users don't even know about the service that was created. (not saying we should but a possibility).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, yea I tend to agree with that @tomkerkhove . I'm happy to add the fields that surface port, IP, and maybe other fields. This PR is blocking some other work (since it makes such big fundamental changes to the operator). If there's nothing else you'd like to change in it, I'd like us to merge it and I will concurrently open a follow-up PR that adds those fields. What do you think @tomkerkhove @zroubalik ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine by me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#107 is the follow-up issue
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
Signed-off-by: Aaron Schlesinger <aaron@ecomaz.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good
// ScaleTargetRef contains all the details about an HTTP application to scale and route to | ||
type ScaleTargetRef struct { | ||
// The name of the deployment to scale according to HTTP traffic | ||
Deployment string `json:"deployment"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a nit. Do you want to target just Deployments
, what about StatefulSet
or CustomResources
with /scale
subresoure? Might be worth checking how is this handled in ScaledObject: https://github.com/kedacore/keda/blob/6dc4c3524ba6278276cd1338cc7e4e9a7dd88963/api/v1alpha1/scaledobject_types.go#L75-L81
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to target Deployment
s for now, and open it up to other HTTP workloads that folks might want to scale in the future. Does that sound ok to you @zroubalik ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zroubalik I am going to merge this PR now, and we can create a follow-up if you think we need to support StatefulSet
or other resources with a /scale
subresource right now.
Create resource
Fixes #35
Previous to this PR, the operator created an application
Deployment
andService
. This pull request removes that functionality and requires that a user creates those things themself. In doing so, we're focusing the HTTP add on directly on:This PR also changes the schema of the CRD. The new CRD needs to allow the user to specify what to scale and how to route. To achieve that, I've added a
scaleTargetRef
field to match the pattern that KEDA core has. It looks similar to this:The above would instruct the operator to scale a
Deployment
calledxkcd
and route traffic through aService
calledxkcd
on port 8080.Checklist
Fixes #35
Fixes #74