Update heartbeats image (#4540)

This commit is contained in:
Ashleigh Brennan 2021-12-03 11:58:37 -06:00 committed by GitHub
parent 9436b1213a
commit f7103c9c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 24 deletions

View File

@ -11,15 +11,7 @@ container image, and a ContainerSource that uses your image URI.
## Before you begin ## Before you begin
Before you can create a ContainerSource object: Before you can create a ContainerSource object, you must have [Knative Eventing](../../../install/eventing/install-eventing-with-yaml.md) installed on your cluster.
- You must have [Knative Eventing](../../../install/eventing/install-eventing-with-yaml.md)
installed on your cluster.
- If you want to use the following example heartbeats event source, you must also:
- Install [ko](https://github.com/google/ko)
- Set `KO_DOCKER_REPO`. For example, `gcr.io/[gcloud-project]` or `docker.io/<username>`
- Authenticate with your `KO_DOCKER_REPO`
- Install [`docker`](https://docs.docker.com/install/)
## Develop, build and publish a container image ## Develop, build and publish a container image
@ -30,17 +22,26 @@ You can develop a container image by using any language, and can build and publi
## Create a ContainerSource object ## Create a ContainerSource object
1. Build an image of your event source and publish it to your image repository. 1. Build an image of your event source and publish it to your image repository. Your image must read the environment variable `K_SINK` and post messages to the URL specified in `K_SINK`.
Your image must read the environment variable `K_SINK` and post messages to the
URL specified in `K_SINK`. If you do not already have an image, you can use
the following example heartbeats event source by running the commands:
```bash You can use the following YAML to deploy a demo `heartbeats` event source:
git clone -b "{{ branch }}" https://github.com/knative/eventing.git
```
```bash ```yaml
ko publish ko://knative.dev/eventing/cmd/heartbeats apiVersion: sources.knative.dev/v1
kind: ContainerSource
metadata:
name: heartbeat-source
spec:
template:
spec:
containers:
- image: gcr.io/knative-nightly/knative.dev/eventing/cmd/heartbeats:latest
name: heartbeats
sink:
ref:
apiVersion: serving.knative.dev/v1
kind: Service
name: event-display
``` ```
1. Create a namespace for your ContainerSource by running the command: 1. Create a namespace for your ContainerSource by running the command:
@ -49,11 +50,9 @@ the following example heartbeats event source by running the commands:
kubectl create namespace <namespace> kubectl create namespace <namespace>
``` ```
Where `<namespace>` is the namespace that you want your ContainerSource to use. Where `<namespace>` is the namespace that you want your ContainerSource to use. For example, `heartbeat-source`.
For example, `containersource-example`.
1. Create a sink. If you do not already have a sink, you can use the following Knative 1. Create a sink. If you do not already have a sink, you can use the following Knative Service, which dumps incoming messages into its log:
Service, which dumps incoming messages into its log:
!!! note !!! note
To create a Knative service you must have Knative Serving installed on your cluster. To create a Knative service you must have Knative Serving installed on your cluster.

View File

@ -39,7 +39,7 @@ spec:
template: template:
spec: spec:
containers: containers:
- image: gcr.io/[gcloud-project]/knative.dev/eventing/cmd/heartbeats - image: gcr.io/knative-nightly/knative.dev/eventing/cmd/heartbeats
name: heartbeats name: heartbeats
args: args:
- --period=1 - --period=1

View File

@ -151,7 +151,7 @@ any extra overrides given by `CE_OVERRIDES`.
restartPolicy: Never restartPolicy: Never
containers: containers:
- name: single-heartbeat - name: single-heartbeat
image: gcr.io/knative-releases/knative.dev/eventing-contrib/cmd/heartbeats image: gcr.io/knative-nightly/knative.dev/eventing/cmd/heartbeats
args: args:
- --period=1 - --period=1
env: env: