Skip to content

Commit

Permalink
Adding pubsub auth trigger
Browse files Browse the repository at this point in the history
Signed-off-by: Harsh Thakur <[email protected]>
  • Loading branch information
RealHarshThakur committed Oct 28, 2020
1 parent 475c7d5 commit ae8a784
Showing 1 changed file with 36 additions and 2 deletions.
38 changes: 36 additions & 2 deletions content/docs/2.0/scalers/gcp-pub-sub.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,17 @@ The `credentialsFromEnv` property maps to the name of an environment variable in

`subscriptionName` defines the subscription that should be monitored. The `subscriptionSize` determines the target average which the deployment will be scaled on. The default `subscriptionSize` is 5.

Here's an [example](https://github.com/kedacore/sample-go-gcppubsub).

### Authentication Parameters
You can use `TriggerAuthentication` CRD to configure the authenticate by providing the service account credentials in JSON.


**Credential based authentication:**

Not supported yet.
- `GoogleApplicationCredentials` - Service account credentials in JSON

### Example
### Example

```yaml
apiVersion: keda.sh/v1alpha1
Expand All @@ -48,3 +54,31 @@ spec:
subscriptionName: "mysubscription" # Required
credentialsFromEnv: GOOGLE_APPLICATION_CREDENTIALS_JSON # Required
```

### Example using TriggerAuthentication

```yaml
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: keda-trigger-auth-gcp-credentials
spec:
secretTargetRef:
- parameter: GoogleApplicationCredentials
name: pubsub-secret # Required. Refers to the name of the secret
key: GOOGLE_APPLICATION_CREDENTIALS_JSON # Required.
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: pubsub-scaledobject
spec:
scaleTargetRef:
name: keda-pubsub-go
triggers:
- type: gcp-pubsub
authenticationRef:
name: keda-trigger-auth-gcp-credentials
metadata:
subscriptionName: "input" # Required
```

0 comments on commit ae8a784

Please sign in to comment.