Minor fixes in easy event source tutorial (#2512)

* Minor fixes in easy event source tutorial

* Grammar fix
This commit is contained in:
Ali Ok 2020-05-28 18:15:00 +03:00 committed by GitHub
parent 9fc30564e5
commit afb60b1d62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -4,8 +4,7 @@ FROM node:10
WORKDIR /usr/src/app WORKDIR /usr/src/app
# Install app dependencies # Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied # A wildcard is used to ensure both package.json AND package-lock.json
# where available (npm@5+)
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install

View File

@ -3,14 +3,16 @@
As stated in [tutorial on writing a Source with a Receive Adapter](../writing-receive-adapter-source/README.md), there are multiple ways to As stated in [tutorial on writing a Source with a Receive Adapter](../writing-receive-adapter-source/README.md), there are multiple ways to
create event sources. The way in that tutorial is to create an independent event source that has its own CRD. create event sources. The way in that tutorial is to create an independent event source that has its own CRD.
In this tutorial though, you will build an event source in Javascript and use it with This tutorial provides a simpler mechanism to build an event source in Javascript and use it with
[ContainerSource](../../../eventing/sources/README.md#meta-sources) and / or [SinkBinding](../../../eventing/sources/README.md#meta-sources). [ContainerSource](../../../eventing/sources/README.md#meta-sources) and / or the [SinkBinding](../../../eventing/sources/README.md#meta-sources).
[ContainerSource](../../../eventing/sources/README.md#meta-sources) is an easy way to turn any dispatcher container into an Event Source. [ContainerSource](../../../eventing/sources/README.md#meta-sources) is an easy way to turn any dispatcher container into an Event Source.
Similarly, another option is using [SinkBinding](../../../eventing/sources/README.md#meta-sources) Similarly, another option is using [SinkBinding](../../../eventing/sources/README.md#meta-sources)
which provides a framework for injecting environment variables into any Kubernetes resource which has a `spec.template` that looks like a Pod (aka PodSpecable). which provides a framework for injecting environment variables into any Kubernetes resource which has a `spec.template` that looks like a Pod (aka PodSpecable).
Code for this tutorial is available [here](./). SinkBinding is a newer concept and it should be preferred over ContainerSource.
Code for this tutorial is available [here](https://github.com/knative/docs/tree/master/docs/eventing/samples/writing-event-source-easy-way).
# Bootstrapping # Bootstrapping
@ -131,7 +133,7 @@ EOS
Check the logs of the event display service. You will see a new message is pushed every second: Check the logs of the event display service. You will see a new message is pushed every second:
```bash ```bash
$ kubectl logs event-display-dpplv-deployment-67c9949cf9-bvjvk -c user-container $ kubectl logs -l serving.knative.dev/service=event-display -c user-container
☁️ cloudevents.Event ☁️ cloudevents.Event
Validation: valid Validation: valid
@ -147,7 +149,7 @@ Data,
} }
``` ```
If you are interested in to see what is injected into the event source, check the logs of it: If you are interested in seeing what is injected into the event source as a `K_SINK`, you can check the logs:
```bash ```bash
$ kubectl logs test-heartbeats-deployment-7575c888c7-85w5t $ kubectl logs test-heartbeats-deployment-7575c888c7-85w5t