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

Create a Knative Service Controller #2

Open
salaboy opened this issue Sep 29, 2021 · 2 comments
Open

Create a Knative Service Controller #2

salaboy opened this issue Sep 29, 2021 · 2 comments
Assignees

Comments

@salaboy
Copy link
Owner

salaboy commented Sep 29, 2021

Based on #1
Let's create a simple controller inside this project that watch Knative Services and emit a CloudEvent when a new Knative Service is created:

You can follow the following examples inside the tekton controller which creates a "Controller" and a "Reconciler"

https://github.com/tektoncd/experimental/blob/main/cloudevents/pkg/reconciler/pipelinerun/controller.go#L39

https://github.com/tektoncd/experimental/blob/main/cloudevents/pkg/reconciler/pipelinerun/reconciler.go#L75

The reconciler emits the event in the linked line.

The controller register the watches for the resources that we are interested.

@salaboy
Copy link
Owner Author

salaboy commented Sep 29, 2021

This is where all gets instantiated.. meaning this is what is going to be executed inside the docker container that ko will generate: https://github.com/tektoncd/experimental/blob/main/cloudevents/cmd/controller/main.go#L27

@salaboy
Copy link
Owner Author

salaboy commented Sep 29, 2021

As mentioned in #1 this is a Kubernetes controller that don't manage any new CRD, it just monitors existing CRDs, I think this is an important distinction to be made here.

@carlisia carlisia self-assigned this Sep 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants