-
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
[v2] BugFix and Updates for Artemis ActiveMQ scaler #986
Conversation
This fix allows to use a scaler definition without kubernetes secret, passing username and password in scaler metadata according to documentation for scaler Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
This fix address an "invalid argument" exception, that throwing any time, when this line executed. Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
…e able to finetune ActiveMQ endpoint In different versions (or configurations) ActiveMQ REST andpoint can be different, than hardcoded in this scaler. To be able to finetune it, I have introduced an optional parameter to change this template. Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
For some reason, ActiveMQ scaler wasn't added to v2. This commit will fix it. Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
@spoplavskiy good catch, thanks! Could you please open another PR on kedacore/keda-docs repo and add documentation for the feature you have implemented? The scaler docs for v2 are in this file: |
@zroubalik , thanks for advice. |
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.
LGTM, thanks!
…#986 (kedacore#222) - Changed "scaleTargetRef" definition example according to V2 - Added metadata paramer "restApiTemplate", that introduced in PR: kedacore#986 Signed-off-by: Sergiy Poplavskyi <spopla@microsoft.com>
This PR has fixes for a bugs I faced with during deployment and setting up a scaler.
Also, I want to introduce additional metadata parameter "restApiTemplate" that address the following problem:
As of now, REST API url to get a queue size is hardcoded and looks like this:
"http://<<managementEndpoint>>/console/jolokia/read/org.apache.activemq.artemis:broker=\"<<brokerName>>\",component=addresses,address=\"<<brokerAddress>>\",subcomponent=queues,routing-type=\"anycast\",queue=\"<<queueName>>\"/MessageCount"
But there can be a cases, when a template is different. As an example, my endpoint looks like this:
"http://<<managementEndpoint>>/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=<<brokerName>>,destinationType=Queue,destinationName=<<queueName>>/QueueSize"
There is other examples of different endpoints for same api:
https://gist.github.com/yashpatil/de7437522bfccfeee4cb
https://activemq.apache.org/rest
To make this scaler more universal, "restApiTemplate" can be used to change a default REST endpoint.
Example value:
"http://<<managementEndpoint>>/api/jolokia/read/org.apache.activemq:type=Broker,brokerName=<<brokerName>>,destinationType=Queue,destinationName=<<queueName>>/QueueSize"
<<managementEndpoint>>, <<brokerName>> and <<queueName>>
will be automatically replaced by values from metadata in a runtime.This parameter doesn't break existing logic: if "restApiTemplate" is not specified, a default one will be used, which is the same, as it was before.
Checklist
Fixes #
Feature #
Docks #222
Signed-off-by: Sergiy Poplavskyi spopla@microsoft.com