Skip to content

Commit

Permalink
Merge branch 'main' into release-blog-dec-22
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffhollan authored Dec 8, 2022
2 parents 2939b17 + 88caea1 commit 7bdfde8
Show file tree
Hide file tree
Showing 2 changed files with 119 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/docs/2.8/scalers/apache-kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ triggers:
allowIdleConsumers: false
scaleToZeroOnInvalidOffset: false
version: 1.0.0
partitionLimitation: '1,2,10-20,31'
```
**Parameter list:**
Expand All @@ -48,6 +49,7 @@ partitions on a topic, allowing for idle consumers. (Default: `false`, Optional)
If 'false' (the default), the scaler will keep a single consumer for that partition. Otherwise ('true'), the consumers for that
partition will be scaled to zero. See the [discussion](https://github.com/kedacore/keda/issues/2612) about this parameter.
- `version` - Version of your Kafka brokers. See [samara](https://github.com/Shopify/sarama) version (Default: `1.0.0`, Optional)
- `partitionLimitation` - Comma separated list of partition ids to scope the scaling on. Allowed patterns are "x,y" and/or ranges "x-y". If set, the calculation of the lag will only take these ids into account. (Default: All partitions, Optional)

> **Note:**
>
Expand Down
117 changes: 117 additions & 0 deletions content/docs/2.9/scalers/etcd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
+++
title = "Etcd"
availability = "v2.9+"
maintainer = "Huawei Cloud"
description = "Scale applications based on an etcd key-value pair. By watching an etcd key, a passively received push mode, the scaler can activate applications with lower load usage than frequent pull mode"
go_file = "etcd_scaler"
+++

### Trigger Specification

This specification describes the `etcd` trigger that scales based on an etcd key-value pair.

```yaml
triggers:
- type: etcd
metadata:
endpoints: 172.0.0.1:2379,172.0.0.2:2379,172.0.0.3:2379
watchKey: length
value: '5.5'
activationValue: '0.5'
watchProgressNotifyInterval: '600'
```
**Parameter list:**
- `endpoints` - Etcd servers' endpoints information. It supports multiple endpoints split by a comma character (`,`).
- `watchKey` - Name of the etcd key used for the scaler client to get/watch the etcd value from etcd servers.
- `value` - Target relation between the scaled workload and the etcd value. It will be calculated following this formula: relation = (etcd value) / (scaled workload pods). (This value can be a float)
- `activationValue` - Target value for activating the scaler. Learn more about activation [here](./../concepts/scaling-deployments.md#activating-and-scaling-thresholds).(Default: `0`, Optional, This value can be a float)
- `watchProgressNotifyInterval` - Set this parameter to the same as `--experimental-watch-progress-notify-interval` parameter of etcd servers. (Default: `600`, units are seconds, Optional)

### Authentication Parameters

You can use `TriggerAuthentication` CRD to configure the authenticate by tls. It is required you should set `tls` to `enable`. If required for your etcd configuration, you may also provide a `ca`, `cert`, `key` and `keyPassword`. `cert` and `key` must be specified together.

**Credential based authentication:**

**TLS:**

- `tls` - To enable SSL auth for Kafka, set this to `enable`. If not set, TLS for Kafka is not used. (Values: `enable`, `disable`, Default: `disable`, Optional)
- `ca` - Certificate authority file for TLS client authentication. (Optional)
- `cert` - Certificate for client authentication. (Optional)
- `key` - Key for client authentication. (Optional)
- `keyPassword` - If set the `keyPassword` is used to decrypt the provided `key`. (Optional)

### Example

Your etcd cluster no TLS auth:

```yaml
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: etcd-scaledobject
spec:
scaleTargetRef:
name: my-app-target
pollingInterval: 30
triggers:
- type: etcd
metadata:
endpoints: 172.0.0.1:2379,172.0.0.2:2379,172.0.0.3:2379
watchKey: length
value: '5.5'
```

Your etcd cluster turn on SASL/TLS auth:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: keda-etcd-secrets
namespace: default
data:
tls: ZW5hYmxl
ca: <your ca>
cert: <your cert>
key: <your key>
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-etcd-credential
namespace: default
spec:
secretTargetRef:
- parameter: tls
name: keda-etcd-secrets
key: tls
- parameter: ca
name: keda-etcd-secrets
key: ca
- parameter: cert
name: keda-etcd-secrets
key: cert
- parameter: key
name: keda-etcd-secrets
key: key
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: etcd-scaledobject
spec:
scaleTargetRef:
name: my-app-target
pollingInterval: 30
triggers:
- type: etcd
metadata:
endpoints: 172.0.0.1:2379,172.0.0.2:2379,172.0.0.3:2379
watchKey: length
value: '5.5'
authenticationRef:
name: keda-trigger-auth-etcd-credential
```

0 comments on commit 7bdfde8

Please sign in to comment.