Skip to content

llhhbc/triggers

Repository files navigation

Tekton Triggers

Triggers is a Kubernetes Custom Resource Defintion (CRD) controller that allows you to extract information from events payloads (a "trigger") to create Kubernetes resources.

🚨 The contents of this repo are currently a WIP 🚨 We are working toward implementing this design (visible to members of the Tekton mailing list).

Background

Tekton is a Kubernetes-native, continuous integration and delivery (CI/CD) framework that enables you to create containerized, composable, and configurable workloads declaratively through CRDs. Naturally, CI/CD events contain information that should:

  • Identify the kind of event (Github Push, Gitlab Issue, Docker Hub Webhook, etc.)
  • Be accessible from and map to particular pipelines (Take SHA from payload to use it in pipeline X)
  • Deterministically trigger pipelines (Events/pipelines that trigger pipelines based on certain payload values)

The Tekton API enables functionality to be seperated from configuration (e.g. Pipelines vs PipelineRuns) such that steps can be reusable, but it does not provide a mechanism to generate the resources (notably, PipelineRuns and PipelineResources) that encapsulate these configurations dynamically. Triggers extends the Tekton architecture with the following CRDs:

  • TriggerTemplate - Templates resources to be created (e.g. Create PipelineResources and PipelineRun that uses them)
  • TriggerBinding - Validates events and extracts payload fields
  • EventListener - Connects TriggerBindings and TriggerTemplates into an addressable endpoint (the event sink) with. When hit, it validates the event if validate task is provided. Then, it uses extracted event parameters from each TriggeringBinding to instantiate resources specified in the corresponding TriggerTemplates.

Using tektoncd/triggers in conjunction with tektoncd/pipeline enables you to easily create full-fledged CI/CD systems where the execution is defined entirely through Kubernetes resources. This repo draws inspiration from Tekton, but can used stand alone since TriggerTemplates can create any Kubernetes resource.

You can learn more by checking out the docs

Want to start using Tekton Triggers

Probably a bit early! In the meantime, consider ramping up on Tekton Pipelines

Want to contribute

Hooray!

About

Event triggering with Tekton!

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 93.3%
  • Shell 4.9%
  • Python 1.8%