The Tekton Sample Custom Task Controller is a simple implementation of a Tekton custom task that evaluates a regular expression.
The sample demonstrates how to
- be notified of Run objects that reference a particular
apiVersion
andkind
- process parameters in a Run object
- set the successful condition and a result in the Run object's status
For more information about the running custom tasks, see the Run documentation.
You need to have Go and ko installed on your workstation to build and deploy the sample custom task controller.
You need to configure ko
to push images to your Docker repository.
- Clone the repository to your workstation.
- Set the current directory to the location where you cloned the repository.
- Use the following command to build and deploy the controller.
$ ko apply -f config/
ko apply
will invokekubectl
and therefore apply to whatever kubectl context is active. - Check that the pod for the controller is running.
$ kubectl get pods -n tekton-sample-custom-task NAME READY STATUS RESTARTS AGE tekton-sample-custom-task-controller-79bd557c4-sp2j4 1/1 Running 0 1m
You can use the YAML files provides in the examples folder to run the sample custom task.
You can use the sample as a base for your own custom task.
You should change the groupName
, version
and kind
constants defined in controller.go
to values that are specific and unique to your custom task.