From bd7bcccb3142323fde6b9405895d21aab2b91e88 Mon Sep 17 00:00:00 2001 From: 26tanishabanik <26tanishabanik@gmail.com> Date: Tue, 1 Nov 2022 14:47:19 +0000 Subject: [PATCH 1/3] added couchdb docs Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com> --- content/docs/2.9/scalers/couchdb.md | 90 +++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 content/docs/2.9/scalers/couchdb.md diff --git a/content/docs/2.9/scalers/couchdb.md b/content/docs/2.9/scalers/couchdb.md new file mode 100644 index 000000000..5ff7c8037 --- /dev/null +++ b/content/docs/2.9/scalers/couchdb.md @@ -0,0 +1,90 @@ ++++ +title = "CouchDB" +availability = "v2.9+" +maintainer = "Community" +description = "Scale applications based on CouchDB query results." +go_file = "couchdb_scaler" ++++ + +### Trigger Specification + +This specification describes the `couchdb` trigger that scales based on the outputs of a CouchDB query. + +```yaml +triggers: +- type: couchdb + metadata: + hostname: "test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local" + port: "5984" + dbName: "animals" + queryValue: "1" + query: '{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }' + activationQueryValue: "1" + metricName: "global-metric" +``` + +**Parameter list:** + +- `host` - The hostname for connecting to the CouchDB service. +- `dbName` - Name of the database. +- `queryValue` - A threshold that will define when scaling should occur. +- `port` - The port number of the CouchDB service. +- `query` - A CouchDB query that should return single numeric value. +- `activationQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional) +- `metricName` - Name to assign to the metric. (Default: `s-couchdb-`, Optional, In case of `metricName` is specified, it will be used to generate the `metricName` like this: `s-couchdb-`, where `` is the index of the trigger in a ScaledObject) + +### Authentication Parameters + +You can authenticate by using a username and password via `TriggerAuthentication` configuration. + +**Password Authentication:** + +- `password` - Password for configured user to login to the Couchdb instance. +- `username` - Username for configured user to login to the Couchdb instance. + +### Example + +Here is an example of a couchdb scaler with Basic Authentication, where the `Secret` and `TriggerAuthentication` are defined as follows: + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: couchdb-secrets +data: + username: COUCHDB_USERNAME + password: COUCHDB_PASSWORD +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: keda-trigger-auth-couchdb-secret +spec: + secretTargetRef: + - parameter: password + name: couchdb-secrets + key: password + - parameter: username + name: couchdb-secrets + key: username +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: couchdb-scaledobject +spec: + scaleTargetRef: + name: nginx-deployment + triggers: + - type: couchdb + metadata: + hostname: "test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local" + port: "5984" + dbName: "animals" + queryValue: "1" + query: '{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }' + activationQueryValue: "1" + metricName: "global-metric" + authenticationRef: + name: keda-trigger-auth-couchdb-secret +``` From e72f48375b670a9dac2a1c164fc6559f3d37f40c Mon Sep 17 00:00:00 2001 From: 26tanishabanik <26tanishabanik@gmail.com> Date: Mon, 5 Dec 2022 16:31:19 +0530 Subject: [PATCH 2/3] added connection string Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com> --- content/docs/2.9/scalers/couchdb.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/2.9/scalers/couchdb.md b/content/docs/2.9/scalers/couchdb.md index 5ff7c8037..d843f02a8 100644 --- a/content/docs/2.9/scalers/couchdb.md +++ b/content/docs/2.9/scalers/couchdb.md @@ -14,13 +14,13 @@ This specification describes the `couchdb` trigger that scales based on the outp triggers: - type: couchdb metadata: + connectionString: "http://admin:password@test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local:5984/" hostname: "test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local" port: "5984" dbName: "animals" queryValue: "1" query: '{ "selector": { "feet": { "$gt": 0 } }, "fields": ["_id", "feet", "greeting"] }' activationQueryValue: "1" - metricName: "global-metric" ``` **Parameter list:** @@ -31,7 +31,7 @@ triggers: - `port` - The port number of the CouchDB service. - `query` - A CouchDB query that should return single numeric value. - `activationQueryValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional) -- `metricName` - Name to assign to the metric. (Default: `s-couchdb-`, Optional, In case of `metricName` is specified, it will be used to generate the `metricName` like this: `s-couchdb-`, where `` is the index of the trigger in a ScaledObject) +- `connectionString` - Connection string for CouchDB database. ### Authentication Parameters From 6759246dcfae9d6769a0e271ade262eec1b5a429 Mon Sep 17 00:00:00 2001 From: 26tanishabanik <26tanishabanik@gmail.com> Date: Thu, 8 Dec 2022 15:58:59 +0530 Subject: [PATCH 3/3] fixed host name Signed-off-by: 26tanishabanik <26tanishabanik@gmail.com> --- content/docs/2.9/scalers/couchdb.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/2.9/scalers/couchdb.md b/content/docs/2.9/scalers/couchdb.md index d843f02a8..8e446a6ef 100644 --- a/content/docs/2.9/scalers/couchdb.md +++ b/content/docs/2.9/scalers/couchdb.md @@ -15,7 +15,7 @@ triggers: - type: couchdb metadata: connectionString: "http://admin:password@test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local:5984/" - hostname: "test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local" + host: "test-release-svc-couchdb.couchdb-test-ns.svc.cluster.local" port: "5984" dbName: "animals" queryValue: "1"