Skip to content
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

add-graphite-basic-auth #446

Closed
wants to merge 3 commits into from
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions content/docs/2.3/scalers/graphite.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ triggers:
- `threshold` - Value to start scaling for
- `queryTime` - Query Time to from Seconds/Minutes

### Authentication Parameters

Graphite Scaler supports three types of authentication - basic authentication.
shuoliu1 marked this conversation as resolved.
Show resolved Hide resolved

You can use `TriggerAuthentication` CRD to configure the authentication.`authModes: "basic"` Specify `authModes` and other trigger parameters along with secret credentials in `TriggerAuthentication` as mentioned below:

**Basic authentication:**
- `authMode`: It must contain `basic` in case of Basic Authentication. Specify this in trigger configuration.
shuoliu1 marked this conversation as resolved.
Show resolved Hide resolved
- `username`: This is a required field. Provide the username to be used for basic authentication.
shuoliu1 marked this conversation as resolved.
Show resolved Hide resolved
- `password`: Provide the password to be used for authentication. For convenience, this has been marked optional, because many applications implement basic auth with a username as apikey and password as empty.
shuoliu1 marked this conversation as resolved.
Show resolved Hide resolved

### Example

Expand All @@ -51,3 +61,53 @@ spec:
query: stats.counters.http.hello-world.request.count.count
queryTime: '-10Minutes'
```


shuoliu1 marked this conversation as resolved.
Show resolved Hide resolved
Here is an example of scaling with the Graphite scaler with basic authentication by defining the `Secret` and `TriggerAuthentication` as follows:

```yaml
apiVersion: v1
kind: Secret
metadata:
name: keda-graphite-secret
namespace: default
data:
username: "username"
password: "password"
---
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-graphite-creds
namespace: default
spec:
secretTargetRef:
- parameter: username
name: keda-graphite-secret
key: username
- parameter: password
name: keda-graphite-secret
key: password
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: graphite-scaledobject
namespace: keda
labels:
deploymentName: dummy
spec:
maxReplicaCount: 12
scaleTargetRef:
name: dummy
triggers:
- type: graphite
metadata:
serverAddress: http://<graphite-host>:9090
metricName: request-count
threshold: '100'
query: stats.counters.http.hello-world.request.count.count
queryTime: '-10Minutes'
shuoliu1 marked this conversation as resolved.
Show resolved Hide resolved
authenticationRef:
name: keda-graphite-creds
```