Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 9 additions & 24 deletions docs/eventing/samples/gcp-pubsub-source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ source is most useful as a bridge from other GCP services, such as
addition, install the GCP PubSub event source from `release-gcppubsub.yaml`:

```shell
kubectl apply --filename https://github.com/knative/eventing-sources/releases/download/v0.3.0/release-gcppubsub.yaml
kubectl apply --filename https://github.com/knative/eventing-sources/releases/download/v0.5.0/gcppubsub.yaml
```

1. Enable the `Cloud Pub/Sub API` on your project:
Expand Down Expand Up @@ -74,26 +74,11 @@ source is most useful as a bridge from other GCP services, such as

## Deployment

1. Create a Channel. This example creates a Channel called `pubsub-test` which
uses the in-memory provisioner, with the following definition:

```yaml
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
metadata:
name: pubsub-test
spec:
provisioner:
apiVersion: eventing.knative.dev/v1alpha1
kind: ClusterChannelProvisioner
name: in-memory-channel
```

If you're in the samples directory, you can apply the `channel.yaml` file:
1. Create the `default` Broker in your namespace. These instructions assume the namespace `default`, feel free to change to any other namespace you would like to use instead:

```shell
kubectl apply --filename channel.yaml
```
```shell
kubectl label namespace default knative-eventing-injection=enabled
```

1. Create a GCP PubSub Topic. If you change its name (`testing`), you also need
to update the `topic` in the
Expand All @@ -111,8 +96,8 @@ source is most useful as a bridge from other GCP services, such as
apply in one command:

```shell
sed "s/MY_GCP_PROJECT/$PROJECT_ID/g" gcp-pubsub-source.yaml | \
kubectl apply --filename -
sed "s/MY_GCP_PROJECT/$PROJECT_ID/g" gcp-pubsub-source.yaml | \
kubectl apply --filename -
```

If you are replacing `MY_GCP_PROJECT` manually, then make sure you apply the
Expand All @@ -122,10 +107,10 @@ source is most useful as a bridge from other GCP services, such as
kubectl apply --filename gcp-pubsub-source.yaml
```

1. Create a function and subscribe it to the `pubsub-test` channel:
1. Create a function and create a Trigger that will send all events from the Broker to the function:

```shell
kubectl apply --filename subscriber.yaml
kubectl apply --filename trigger.yaml
```

## Publish
Expand Down
9 changes: 0 additions & 9 deletions docs/eventing/samples/gcp-pubsub-source/channel.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ spec:
topic: testing
sink:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: pubsub-test
kind: Broker
name: default
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,14 @@ spec:

---

# Subscription from the GcpPubSubSource's output Channel to the Knative Service below.
# The GcpPubSubSource's output goes to the default Broker. This Trigger subscribes to events in the
# default Broker.

apiVersion: eventing.knative.dev/v1alpha1
kind: Subscription
kind: Trigger
metadata:
name: gcppubsub-source-sample
spec:
channel:
apiVersion: eventing.knative.dev/v1alpha1
kind: Channel
name: pubsub-test
subscriber:
ref:
apiVersion: serving.knative.dev/v1alpha1
Expand Down