Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
Link to getting started in tekton listener README
Browse files Browse the repository at this point in the history
And move some of the instructions to DEVELOPMENT.md
  • Loading branch information
bobcatfish authored and tekton-robot committed Jun 3, 2019
1 parent a69816c commit 702e52a
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 25 deletions.
20 changes: 20 additions & 0 deletions tekton-listener/DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Tekton Listener development guide

## Setup instructions

```bash
export KO_DOCKER_REPO='gcr.io/my-gcloud-project-name'
ko apply -f config/
```

### Minikube

To dev/test locally with minikube:

* Get the `ko` command: `go get -u github.com/google/ko/cmd/ko`
* Load your docker environment vars: `eval $(minikube docker-env)`
* Start a registry: `docker run -it -d -p 5000:5000 registry:2`
* Set `KO_DOCKER_REPO` to local registry: `export KO_DOCKER_REPO=localhost:5000/<myproject>`
* Apply tekton components: `ko apply -L -f config/`
* Create an EventBinding (such as the example above) and await cloud events.
* The Listener that the EventBinding creates can be used as an Eventing sink.
37 changes: 12 additions & 25 deletions tekton-listener/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,23 @@

This experimental directory defines two new CRDs - TektonListeners and EventBindings.

The `TektonListener` is a CRD which provides a listener component, which can listen for CloudEvents and spawn specific PipelineRuns as a result.
* [TektonListener](#tektonlistener)
* [EventBinding](#eventbinding)
* [Getting started](docs/getting-started.md)
* [Development guide](DEVELOPMENT.md)

The `TektonListener` is a CRD which provides a listener component, which can listen for
[CloudEvents](https://github.com/cloudevents/spec) and spawn specific PipelineRuns as a result.

The `EventBinding` CRD exposes a new, high-level concept of "binding" Events with a specified Pipeline. The EventBinding takes care of creating and deleting PipeLineResources and also spawns `TektonListener`s to handle event ingress and processing.

## TektonListener
The first new CRD, `TektonListener`, provides support for consuming CloudEvent and producing a predefined PipelineRun. Although only CloudEvents are currently supported, the listener is intentionally designed to allow for extension beyond CloudEvents.

The first new CRD, `TektonListener`, provides support for consuming a CloudEvent and producing a predefined PipelineRun. Although only CloudEvents are currently supported, the listener is intentionally designed to allow for extension beyond CloudEvents.

An example TektonListener:
```

```yaml
apiVersion: tektonexperimental.dev/v1alpha1
kind: TektonListener
metadata:
Expand Down Expand Up @@ -41,6 +49,7 @@ spec:
Since the Service fullfills the [Addressable](https://github.com/knative/eventing/blob/master/docs/spec/interfaces.md#addressable) contract, the listener service can be used as a sink for [github source](https://knative.dev/docs/reference/eventing/eventing-sources-api/#GitHubSource), for example.
## EventBinding
The `EventBinding` CRD provides a new high-level means of managing all of the resources needed to allow a Pipeline to be bound to a specific Event and produce PipelineRuns as a result of those events. Individual EventBindings are scoped to a specific pipeline - Bindings also create all their own PipelineResources and Listeners (and clean them up on removal as well). This spec will likely evolve the most as we discover the most effect ways to bind events to action.

An example EventBinding:
Expand Down Expand Up @@ -80,25 +89,3 @@ spec:
sourceref:
name: ulmaceae-source
```

# Instructions

TODO: icoffey is working on this next :)

## Getting Started

Preqs:

- A Tekton Pipeline must be created prior to creating an EventBinding. This is the Pipeline that will handle requests.

## Minikube instructions

To dev/test locally with minikube:

* Get the `ko` command: `go get -u github.com/google/ko/cmd/ko`
* Load your docker environment vars: `eval $(minikube docker-env)`
* Start a registry: `docker run -it -d -p 5000:5000 registry:2`
* Set `KO_DOCKER_REPO` to local registry: `export KO_DOCKER_REPO=localhost:5000/<myproject>`
* Apply tekton components: `ko apply -L -f config/`
* Create an EventBinding (such as the example above) and await cloud events.
* The Listener that the EventBinding creates can be used as an Eventing sink.

0 comments on commit 702e52a

Please sign in to comment.