From e1348d10b712d7f336e71d622b8858bf4bf9ff62 Mon Sep 17 00:00:00 2001 From: ithesadson Date: Sun, 19 Mar 2023 00:15:57 +0300 Subject: [PATCH 1/6] add docs for solr Signed-off-by: ithesadson --- content/docs/2.11/scalers/solr.md | 80 +++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 content/docs/2.11/scalers/solr.md diff --git a/content/docs/2.11/scalers/solr.md b/content/docs/2.11/scalers/solr.md new file mode 100644 index 000000000..515db4584 --- /dev/null +++ b/content/docs/2.11/scalers/solr.md @@ -0,0 +1,80 @@ ++++ +title = "Solr" +availability = "v2.11+" +maintainer = "Community" +description = "Scale applications based on Solr query results." +go_file = "solr_scaler" ++++ + +### Trigger Specification + +This specification describes the solr trigger that scales based on the outputs of a Solr query. + +```yaml +triggers: + - type: solr + metadata: + host: "http://solr-service.solr-ns.svc.cluster.local:8983" + query: "*:*" + core: "my_core" + targetQueryValue: "1" + activationTargetQueryValue : "3" + username: "solr" +``` + +**Parameter list:** + +- `host` - The hostname for connecting to the Solr service. +- `query`- A Solr query that should return single numeric value. (Default: `*:*`, Optional) +- `core` - Your collection name on Solr. +- `targetQueryValue` - A threshold that is used as targetValue or targetAverageValue (depending on the trigger metric type) in HPA. (This value can be a float) +- `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional) +- `username` - Username credential to connect to the Solr service. + +### Authentication Parameters + +You can authenticate by using a password via TriggerAuthentication configuration. + +**Credential based authentication:** + +- `password` - Password for configured user to login to the Solr instance. + +### Example + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: solr-secret +type: Opaque +data: + solr_password: SOLR_PASSWORD +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: trigger-auth-solr +spec: + secretTargetRef: + - parameter: password + name: solr-secret + key: solr_password +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: solr-scaledobject +spec: + scaleTargetRef: + name: nginx-deploy + triggers: + - type: solr + metadata: + host: "http://solr-service.solr-ns.svc.cluster.local:8983" + query: "*:*" + core: "my_core" + targetQueryValue: "1" + username: "solr" + authenticationRef: + name: trigger-auth-solr +``` From 00eb6a0fb3513e552938606fb86f0c613bccf0fe Mon Sep 17 00:00:00 2001 From: ithesadson Date: Sun, 19 Mar 2023 00:28:47 +0300 Subject: [PATCH 2/6] change version Signed-off-by: ithesadson --- content/docs/2.11/scalers/solr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/2.11/scalers/solr.md b/content/docs/2.11/scalers/solr.md index 515db4584..d8a129bd3 100644 --- a/content/docs/2.11/scalers/solr.md +++ b/content/docs/2.11/scalers/solr.md @@ -1,6 +1,6 @@ +++ title = "Solr" -availability = "v2.11+" +availability = "v2.10+" maintainer = "Community" description = "Scale applications based on Solr query results." go_file = "solr_scaler" From f8df3574ebb9ef83f27a1e4514c9bb6a72fc4606 Mon Sep 17 00:00:00 2001 From: ithesadson Date: Sun, 19 Mar 2023 00:36:40 +0300 Subject: [PATCH 3/6] change version Signed-off-by: ithesadson --- content/docs/{2.11 => 2.10}/scalers/solr.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename content/docs/{2.11 => 2.10}/scalers/solr.md (100%) diff --git a/content/docs/2.11/scalers/solr.md b/content/docs/2.10/scalers/solr.md similarity index 100% rename from content/docs/2.11/scalers/solr.md rename to content/docs/2.10/scalers/solr.md From a5a931886123ec481758ecf08c3688901bb69b33 Mon Sep 17 00:00:00 2001 From: ithesadson Date: Mon, 20 Mar 2023 13:41:34 +0300 Subject: [PATCH 4/6] rename core to collection Signed-off-by: ithesadson --- content/docs/2.10/scalers/solr.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/2.10/scalers/solr.md b/content/docs/2.10/scalers/solr.md index d8a129bd3..ee036684d 100644 --- a/content/docs/2.10/scalers/solr.md +++ b/content/docs/2.10/scalers/solr.md @@ -16,7 +16,7 @@ triggers: metadata: host: "http://solr-service.solr-ns.svc.cluster.local:8983" query: "*:*" - core: "my_core" + collection: "my_core" targetQueryValue: "1" activationTargetQueryValue : "3" username: "solr" @@ -26,7 +26,7 @@ triggers: - `host` - The hostname for connecting to the Solr service. - `query`- A Solr query that should return single numeric value. (Default: `*:*`, Optional) -- `core` - Your collection name on Solr. +- `collection` - Your collection name on Solr. - `targetQueryValue` - A threshold that is used as targetValue or targetAverageValue (depending on the trigger metric type) in HPA. (This value can be a float) - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional) - `username` - Username credential to connect to the Solr service. @@ -72,7 +72,7 @@ spec: metadata: host: "http://solr-service.solr-ns.svc.cluster.local:8983" query: "*:*" - core: "my_core" + collection: "my_core" targetQueryValue: "1" username: "solr" authenticationRef: From 9d73a84a3f08b40ce09713fe7fb50c44cb03618d Mon Sep 17 00:00:00 2001 From: ithesadson Date: Mon, 20 Mar 2023 19:27:21 +0300 Subject: [PATCH 5/6] change version Signed-off-by: ithesadson --- content/docs/{2.10 => 2.11}/scalers/solr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename content/docs/{2.10 => 2.11}/scalers/solr.md (98%) diff --git a/content/docs/2.10/scalers/solr.md b/content/docs/2.11/scalers/solr.md similarity index 98% rename from content/docs/2.10/scalers/solr.md rename to content/docs/2.11/scalers/solr.md index ee036684d..cd46e6822 100644 --- a/content/docs/2.10/scalers/solr.md +++ b/content/docs/2.11/scalers/solr.md @@ -1,6 +1,6 @@ +++ title = "Solr" -availability = "v2.10+" +availability = "v2.11+" maintainer = "Community" description = "Scale applications based on Solr query results." go_file = "solr_scaler" From 837625748a99adb21937f6e5107fc2320cecbd69 Mon Sep 17 00:00:00 2001 From: ithesadson Date: Tue, 21 Mar 2023 14:50:42 +0300 Subject: [PATCH 6/6] define username under TriggerAuthentication Signed-off-by: ithesadson --- content/docs/2.11/scalers/solr.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/content/docs/2.11/scalers/solr.md b/content/docs/2.11/scalers/solr.md index cd46e6822..1082cd198 100644 --- a/content/docs/2.11/scalers/solr.md +++ b/content/docs/2.11/scalers/solr.md @@ -19,7 +19,6 @@ triggers: collection: "my_core" targetQueryValue: "1" activationTargetQueryValue : "3" - username: "solr" ``` **Parameter list:** @@ -29,7 +28,6 @@ triggers: - `collection` - Your collection name on Solr. - `targetQueryValue` - A threshold that is used as targetValue or targetAverageValue (depending on the trigger metric type) in HPA. (This value can be a float) - `activationTargetQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional) -- `username` - Username credential to connect to the Solr service. ### Authentication Parameters @@ -37,6 +35,7 @@ You can authenticate by using a password via TriggerAuthentication configuration **Credential based authentication:** +- `username` - Username for configured user to login to the Solr instance. - `password` - Password for configured user to login to the Solr instance. ### Example @@ -48,6 +47,7 @@ metadata: name: solr-secret type: Opaque data: + solr_username: SOLR_USERNAME solr_password: SOLR_PASSWORD --- apiVersion: keda.sh/v1alpha1 @@ -56,6 +56,9 @@ metadata: name: trigger-auth-solr spec: secretTargetRef: + - parameter: username + name: solr-secret + key: solr_username - parameter: password name: solr-secret key: solr_password @@ -74,7 +77,6 @@ spec: query: "*:*" collection: "my_core" targetQueryValue: "1" - username: "solr" authenticationRef: name: trigger-auth-solr ```