diff --git a/content/docs/2.16/scalers/redis-cluster-lists.md b/content/docs/2.16/scalers/redis-cluster.md similarity index 67% rename from content/docs/2.16/scalers/redis-cluster-lists.md rename to content/docs/2.16/scalers/redis-cluster.md index 6e6c240e9..767a1941f 100644 --- a/content/docs/2.16/scalers/redis-cluster-lists.md +++ b/content/docs/2.16/scalers/redis-cluster.md @@ -1,15 +1,15 @@ +++ -title = "Redis Lists (supports Redis Cluster)" +title = "Redis Lists Or Strings (supports Redis Cluster)" availability = "v2.1+" maintainer = "Community" category = "Data & Storage" -description = "Redis Lists scaler with support for Redis Cluster topology" +description = "Redis Lists or Strings scaler with support for Redis Cluster topology" go_file = "redis_scaler" +++ ### Trigger Specification -This specification describes the `redis-cluster` trigger that scales based on the length of a list in a Redis Cluster. +This specification describes the `redis-cluster` trigger that scales based on the length of a list or string in a Redis Cluster. ```yaml triggers: @@ -18,9 +18,12 @@ triggers: addresses: localhost:6379 # Comma separated list of the format host:port usernameFromEnv: REDIS_USERNAME # optional passwordFromEnv: REDIS_PASSWORD - listName: mylist # Required - listLength: "5" # Required + listName: mylist # optional + listLength: "5" # optional activationListLength: "5" # optional + keyName: mykey # optional + keyValue: "1.5" # optional + activationValue: "5" # optional enableTLS: "false" # optional unsafeSsl: "false" # optional databaseIndex: "0" # optional @@ -37,9 +40,12 @@ triggers: - `usernameFromEnv` - Environment variable to read the authentication username from to authenticate with the Redis server. - `passwordFromEnv` - Environment variable to read the authentication password from to authenticate with the Redis server. - Both the hostname, username and password fields need to be set to the names of the environment variables in the target deployment that contain the host name, username and password respectively. -- `listName` - Name of the Redis List that you want to monitor. -- `listLength` - Average target value to trigger scaling actions. -- `activationListLength` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) +- `listName` - Name of the Redis List that you want to monitor. One of `listName` or `keyName` must be set, and cannot be set at the same time. (Optional, Mutually exclusive with `keyName`) +- `listLength` - Average target value to trigger scaling actions, make sense only when using with `listName`.(Optional, Mutually exclusive with `keyValue`) +- `activationListLength` - Target value for activating the scaler, make sense only when using with `listName`. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) +- `keyName` - Name of the Redis Key that you want to monitor. One of `listName` or `keyName` must be set, and cannot be set at the same time. (Optional, Mutually exclusive with `listName`) +- `keyValue` - Average target value to trigger scaling actions, make sense only when using with `keyName`. (Optional, Mutually exclusive with `listLength`) +- `activationValue` - Target value for activating the scaler, make sense only when using with `keyName`. Learn more about activation [here](./../concepts/scaling-deployments.md#) - `enableTLS` - Allow a connection to a redis queue using tls. (Values: `true`, `false`, Default: `false`, Optional) - `unsafeSsl` - Used for skipping certificate check e.g: using self-signed certs. (Values: `true`,`false`, Default: `false`, Optional, This requires `enableTLS: true`) - `databaseIndex` - Index of Redis database to use. If not specified, the default value is 0. @@ -77,7 +83,7 @@ Parameters used for configuring TLS authentication. Note this can not be used to ### Example -Here is an example of how to deploy a scaled object with the `redis-cluster` scale trigger which uses `TriggerAuthentication`. +Here is an example of how to deploy a scaled object with the `redis-cluster` scale trigger which uses `TriggerAuthentication`, and monitor a Redis List named `mylist`. You can also provide the `usernameFromEnv` and `passwordFromEnv` on the `ScaledObject` directly. @@ -123,3 +129,48 @@ spec: authenticationRef: name: keda-trigger-auth-redis-secret ``` + +Here is an example of how to deploy a scaled object with the `redis` scale trigger which uses `Key` instead of `List`. + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: votes-db-secret + namespace: my-project +type: Opaque +data: + redis_username: YWRtaW4= + redis_password: YWRtaW4= +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: keda-trigger-auth-redis-secret + namespace: my-project +spec: + secretTargetRef: + - parameter: username + name: votes-db-secret + key: redis_username + - parameter: password + name: votes-db-secret + key: redis_password +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: redis-scaledobject + namespace: my-project +spec: + scaleTargetRef: + name: votes + triggers: + - type: redis-cluster + metadata: + addresses: node1:6379, node2:6379, node3:6379 + keyName: mykey + keyValue: "10" + authenticationRef: + name: keda-trigger-auth-redis-secret +``` \ No newline at end of file diff --git a/content/docs/2.16/scalers/redis-sentinel-lists.md b/content/docs/2.16/scalers/redis-sentinel.md similarity index 71% rename from content/docs/2.16/scalers/redis-sentinel-lists.md rename to content/docs/2.16/scalers/redis-sentinel.md index 1ce8b9805..af7d03271 100644 --- a/content/docs/2.16/scalers/redis-sentinel-lists.md +++ b/content/docs/2.16/scalers/redis-sentinel.md @@ -1,15 +1,15 @@ +++ -title = "Redis Lists (supports Redis Sentinel)" +title = "Redis Lists Or Strings (supports Redis Sentinel)" availability = "v2.5+" maintainer = "Community" category = "Data & Storage" -description = "Redis Lists scaler with support for Redis Sentinel topology" +description = "Redis Lists or Strings scaler with support for Redis Sentinel topology" go_file = "redis_scaler" +++ ### Trigger Specification -This specification describes the `redis-sentinel` trigger that scales based on the length of a list in a Redis Sentinel setup. +This specification describes the `redis-sentinel` trigger that scales based on the length of a list or string in a Redis Sentinel setup. ```yaml triggers: @@ -21,9 +21,12 @@ triggers: sentinelUsernameFromEnv: REDIS_SENTINEL_USERNAME # optional sentinelPasswordFromEnv: REDIS_SENTINEL_PASSWORD # optional sentinelMasterFromEnv: REDIS_SENTINEL_MASTER # optional - listName: mylist # Required - listLength: "5" # Required + listName: mylist # optional + listLength: "5" # optional activationListLength: "5" # optional + keyName: mykey # optional + keyValue: "1.5" # optional + activationValue: "5" # optional enableTLS: "false" # optional unsafeSsl: "false" # optional databaseIndex: "0" # optional @@ -43,9 +46,12 @@ triggers: - `sentinelUsernameFromEnv` - Environment variable to read the authentication username from to authenticate with the Redis Sentinel server. - `sentinelPasswordFromEnv` - Environment variable to read the authentication password from to authenticate with the Redis Sentinel server. - sentinelMaster - The name of the primary (still referred to as the 'master' in Sentinel) to get the Redis server address for. -- `listName` - Name of the Redis List that you want to monitor. -- `listLength` - Average target value to trigger scaling actions. -- `activationListLength` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) +- `listName` - Name of the Redis List that you want to monitor. One of `listName` or `keyName` must be set, and cannot be set at the same time. (Optional, Mutually exclusive with `keyName`) +- `listLength` - Average target value to trigger scaling actions, make sense only when using with `listName`.(Optional, Mutually exclusive with `keyValue`) +- `activationListLength` - Target value for activating the scaler, make sense only when using with `listName`. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) +- `keyName` - Name of the Redis Key that you want to monitor. One of `listName` or `keyName` must be set, and cannot be set at the same time. (Optional, Mutually exclusive with `listName`) +- `keyValue` - Average target value to trigger scaling actions, make sense only when using with `keyName`. (Optional, Mutually exclusive with `listLength`) +- `activationValue` - Target value for activating the scaler, make sense only when using with `keyName`. Learn more about activation [here](./../concepts/scaling-deployments.md#) - `enableTLS` - Allow a connection to a redis queue using tls. (Values: `true`, `false`, Default: `false`, Optional) - `unsafeSsl` - Used for skipping certificate check e.g: using self-signed certs. (Values: `true`,`false`, Default: `false`, Optional, This requires `enableTLS: true`) - `databaseIndex` - Index of Redis database to use. If not specified, the default value is 0. @@ -91,7 +97,7 @@ Parameters used for configuring TLS authentication. Note this can not be used to ### Example -Here is an example of how to deploy a scaled object with the `redis-sentinel` scale trigger which uses `TriggerAuthentication`. +Here is an example of how to deploy a scaled object with the `redis` scale trigger which uses `TriggerAuthentication`, and monitor a Redis List named `mylist`. You can also provide the `usernameFromEnv` and `passwordFromEnv` on the `ScaledObject` directly. @@ -138,3 +144,48 @@ spec: authenticationRef: name: keda-trigger-auth-redis-secret ``` + +Here is an example of how to deploy a scaled object with the `redis` scale trigger which uses `Key` instead of `List`. +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: votes-db-secret + namespace: my-project +type: Opaque +data: + redis_username: YWRtaW4= + redis_password: YWRtaW4= +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: keda-trigger-auth-redis-secret + namespace: my-project +spec: + secretTargetRef: + - parameter: username + name: votes-db-secret + key: redis_username + - parameter: password + name: votes-db-secret + key: redis_password +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: redis-scaledobject + namespace: my-project +spec: + scaleTargetRef: + name: votes + triggers: + - type: redis-sentinel + metadata: + addresses: node1:26379, node2:26379, node3:26379 + keyName: mykey + keyValue: "10" + sentinelMaster: "myprimary" + authenticationRef: + name: keda-trigger-auth-redis-secret +``` \ No newline at end of file diff --git a/content/docs/2.16/scalers/redis-lists.md b/content/docs/2.16/scalers/redis.md similarity index 67% rename from content/docs/2.16/scalers/redis-lists.md rename to content/docs/2.16/scalers/redis.md index e8b0ad83f..b00f7623e 100644 --- a/content/docs/2.16/scalers/redis-lists.md +++ b/content/docs/2.16/scalers/redis.md @@ -1,15 +1,15 @@ +++ -title = "Redis Lists" +title = "Redis Lists Or Strings" availability = "v1.0+" maintainer = "Community" category = "Data & Storage" -description = "Scale applications based on Redis Lists." +description = "Scale applications based on Redis Lists Or Strings." go_file = "redis_scaler" +++ ### Trigger Specification -This specification describes the `redis` trigger that scales based on the length of a list in Redis. +This specification describes the `redis` trigger that scales based on the length of a list or string in Redis. ```yaml triggers: @@ -18,9 +18,12 @@ triggers: address: localhost:6379 # Format must be host:port usernameFromEnv: REDIS_USERNAME # optional passwordFromEnv: REDIS_PASSWORD - listName: mylist # Required - listLength: "5" # Required + listName: mylist # optional + listLength: "5" # optional activationListLength: "5" # optional + keyName: mykey # optional + keyValue: "1.5" # optional + activationValue: "5" # optional enableTLS: "false" # optional unsafeSsl: "false" # optional databaseIndex: "0" # optional @@ -37,9 +40,12 @@ triggers: - `usernameFromEnv` - Environment variable to read the authentication username from to authenticate with the Redis server. - `passwordFromEnv` - Environment variable to read the authentication password from to authenticate with the Redis server. - Both the hostname, username and password fields need to be set to the names of the environment variables in the target deployment that contain the host name, username and password respectively. -- `listName` - Name of the Redis List that you want to monitor. -- `listLength` - Average target value to trigger scaling actions. -- `activationListLength` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) +- `listName` - Name of the Redis List that you want to monitor. One of `listName` or `keyName` must be set, and cannot be set at the same time. (Optional, Mutually exclusive with `keyName`) +- `listLength` - Average target value to trigger scaling actions, make sense only when using with `listName`.(Optional, Mutually exclusive with `keyValue`) +- `activationListLength` - Target value for activating the scaler, make sense only when using with `listName`. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds). (Default: `0`, Optional) +- `keyName` - Name of the Redis Key that you want to monitor. One of `listName` or `keyName` must be set, and cannot be set at the same time. (Optional, Mutually exclusive with `listName`) +- `keyValue` - Average target value to trigger scaling actions, make sense only when using with `keyName`. (Optional, Mutually exclusive with `listLength`) +- `activationValue` - Target value for activating the scaler, make sense only when using with `keyName`. Learn more about activation [here](./../concepts/scaling-deployments.md#) - `enableTLS` - Allow a connection to a redis queue using tls. (Values: `true`, `false`, Default: `false`, Optional) - `unsafeSsl` - Used for skipping certificate check e.g: using self-signed certs. (Values: `true`,`false`, Default: `false`, Optional, This requires `enableTLS: true`) - `databaseIndex` - Index of Redis database to use. If not specified, the default value is 0. @@ -77,7 +83,7 @@ Parameters used for configuring TLS authentication. Note this can not be used to ### Example -Here is an example of how to deploy a scaled object with the `redis` scale trigger which uses `TriggerAuthentication`. +Here is an example of how to deploy a scaled object with the `redis` scale trigger which uses `TriggerAuthentication`, and monitor a Redis List named `mylist`. You can also provide the `usernameFromEnv` and `passwordFromEnv` on the `ScaledObject` directly. @@ -123,3 +129,48 @@ spec: authenticationRef: name: keda-trigger-auth-redis-secret ``` + +Here is an example of how to deploy a scaled object with the `redis` scale trigger which uses `Key` instead of `List`. + +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: votes-db-secret + namespace: my-project +type: Opaque +data: + redis_username: YWRtaW4= + redis_password: YWRtaW4= +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: keda-trigger-auth-redis-secret + namespace: my-project +spec: + secretTargetRef: + - parameter: username + name: votes-db-secret + key: redis_username + - parameter: password + name: votes-db-secret + key: redis_password +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: redis-scaledobject + namespace: my-project +spec: + scaleTargetRef: + name: votes + triggers: + - type: redis + metadata: + address: localhost:6379 + keyName: mykey + keyValue: "10" + authenticationRef: + name: keda-trigger-auth-redis-secret +```