Skip to content
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

feat: Move http scaled object from single host to multi host system #585

Closed
wants to merge 13 commits into from

Conversation

someshkoli
Copy link
Contributor

@someshkoli someshkoli commented Jan 26, 2023

Signed-off-by: Somesh Koli somesh.koli@headout.com

Initial tests, Moving http scaled object from single host association to multi host.
Breaking schema change.

Checklist

  • Commits are signed with Developer Certificate of Origin (DCO)
  • Any necessary documentation is added, such as:
  • Breaking schema change, update docs and merge carefully.

Fixes #552

@someshkoli someshkoli requested a review from a team as a code owner January 26, 2023 21:25
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Thanks for the contribution ❤️
e2e tests is broken due to this breaking change, you need to update the example xkcd chart also with this change. We use it as part of e2e tests and that's why they are failing.
About the breaking change, @tomkerkhove , is this allowed for the add-on or should we maintain both cases (at least some time)?

@JorTurFer JorTurFer requested a review from a team January 26, 2023 22:20
@tomkerkhove
Copy link
Member

We should only do breaking changes in 1.0 IMO; but this might be a good example where we can bump API version and support both in 0.5.0 :)

@someshkoli someshkoli force-pushed the ft-multihost-spec branch 2 times, most recently from 1a8974c to 3c90e48 Compare January 30, 2023 23:21
@someshkoli someshkoli changed the title fead: Move http scaled object from single host to multi host system feat: Move http scaled object from single host to multi host system Jan 30, 2023
@someshkoli someshkoli requested a review from JorTurFer January 30, 2023 23:37
@tomkerkhove
Copy link
Member

We should only do breaking changes in 1.0 IMO; but this might be a good example where we can bump API version and support both in 0.5.0 :)

@someshkoli would you mind doing the change in a non-breaking change?

@someshkoli
Copy link
Contributor Author

We should only do breaking changes in 1.0 IMO; but this might be a good example where we can bump API version and support both in 0.5.0 :)

@someshkoli would you mind doing the change in a non-breaking change?

Can do, but it'll create a bit of redundancy to support backward compatibility.
Do we want to go on that path?

@tomkerkhove
Copy link
Member

Meh it's still in preview - Let's just break things :)

@tomkerkhove
Copy link
Member

Can you document the breaking change in our new changelog please?

@someshkoli
Copy link
Contributor Author

Will do, need to run e2e, @tomkerkhove can you update status for that ?
Also can I trigger them on my own ?

@tomkerkhove
Copy link
Member

Can you rebase please?

Signed-off-by: Somesh Koli <somesh.koli@headout.com>
Signed-off-by: Somesh Koli <somesh.koli@headout.com>
Signed-off-by: Somesh Koli <somesh.koli@headout.com>
Signed-off-by: Somesh Koli <somesh.koli@headout.com>
Signed-off-by: Somesh Koli <somesh.koli@headout.com>
@someshkoli
Copy link
Contributor Author

Okay looks like there has been a major revamp in types :") have a lot to rebase

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the conflicts, :(
Could you rebase the PR please?

@someshkoli
Copy link
Contributor Author

someshkoli commented Apr 12, 2023

I didn't see the conflicts, :(
Could you rebase the PR please?

I do see some big conflicts while rebasing, mostly because hosts has been moved from spec to triggers.

@JorTurFer
Copy link
Member

I see these:
image

@someshkoli
Copy link
Contributor Author

someshkoli commented Apr 12, 2023

I see these:
image

Yeah, they have some good level of refactor to httpscaled object. Will try to onboard these changes.

@OdyX
Copy link

OdyX commented May 2, 2023

Any news on that front? Would you need help rebasing?

@someshkoli
Copy link
Contributor Author

Any news on that front? Would you need help rebasing?

Have been quite occupied lately, would appreciate help with rebase. lmk if you'd like to connect and get this done ?

@jocelynthode
Copy link
Contributor

jocelynthode commented May 10, 2023

Hey @someshkoli and @JorTurFer I've started working on the rebase here: https://github.com/jocelynthode/http-add-on/pull/1/files.

However, I noticed some things in the PR which I think might cause issues. For example when defining the ScaledObject you opted to go with metadata.hosts being an array of hosts just like the HTTPScaledObject. However KEDA type struct for ScaledObject only allows types map[string]string for metadata field. I think we should instead define multiple triggers, having one for each host.

This would let us respect the struct of KEDA. I've started in the above mentioned PR this refactoring. Please let me know if I missed something and this is a non issue.

Edit: Actually by investigating a bit more it looks like this metadata is only a metadata (cf https://github.com/kedacore/keda/blob/cf3cd1dc49bd77e86d57e8a7b12689f70dd91348/pkg/scalers/external_scaler.go#L104 where only scalerAddress and tlsCertFile actually do something) so I opted to concatenate the array to a comma separated string. Let me know if this can't work.

@JorTurFer
Copy link
Member

Edit: Actually by investigating a bit more it looks like this metadata is only a metadata (cf kedacore/keda@cf3cd1d/pkg/scalers/external_scaler.go#L104 where only scalerAddress and tlsCertFile actually do something) so I opted to concatenate the array to a comma separated string. Let me know if this can't work.

You can provide all the elements that you want:
https://github.com/kedacore/keda/blob/4ae8975af4a2a43d94e66b0b7be895e189312d39/pkg/scalers/external_scaler.go#L142-L151

@jocelynthode
Copy link
Contributor

Edit: Actually by investigating a bit more it looks like this metadata is only a metadata (cf kedacore/keda@cf3cd1d/pkg/scalers/external_scaler.go#L104 where only scalerAddress and tlsCertFile actually do something) so I opted to concatenate the array to a comma separated string. Let me know if this can't work.

You can provide all the elements that you want: https://github.com/kedacore/keda/blob/4ae8975af4a2a43d94e66b0b7be895e189312d39/pkg/scalers/external_scaler.go#L142-L151

Yes but they must fit in map[string]string which made the solution in this PR unfeasible as the metadata field value was not a string but an array.

@JorTurFer
Copy link
Member

I close this PR in favor of the other

@JorTurFer JorTurFer closed this May 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow multiple host feilds in the HttpScaledObject
6 participants