What is a trigger?¶
Trigger is the resource executed by sensor once the event dependencies are resolved. Any K8s resource can act as a trigger (Custom Resources included).
How to define a trigger?¶
The framework provides support to fetch trigger resources from different sources.
Inlined artifacts are included directly within the sensor resource and decoded as a string. Example
Artifacts are accessed from web via RESTful API. Example
Artifacts stored in Kubernetes configmap are accessed using the key. Example
Artifacts stored in either public or private Git repository. Example
Artifacts defined as generic K8s resource template. This is specially useful if you use tools like Kustomize to generate the sensor spec. Example
What resource types are supported out of box?¶
How to trigger standard Kubernetes Resource instead of Argo Workflow?¶
There could be a case where you may want to trigger a standard Kubernetes resource like Pod, Deployment etc. instead of an Argo Workflow. The sensor allows you to trigger any K8s resource the same way you would trigger an Argo Workflow.
To trigger other standard K8s resources, change the group and version in
How can I add my custom resource as trigger?¶
The set of currently supported resources are implemented in the
You need to register your custom resource in order for sensor to be able to trigger it. Once you register your custom resource, you'll need to rebuild the sensor image.
Follow these steps,
- Go to
- Import your custom resource api package.
initmethod, add the scheme to your custom resource api.
- Make sure there are no errors.
- Rebuild the sensor binary using
- To build the image, first change
Makefileto your docker registry and then run