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

Adding TriggerAuth example for pubsub #293

Merged
merged 1 commit into from
Oct 28, 2020
Merged
Changes from all 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
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
```