Take your function online using Knative Build Pipeline
In our previous post on Build Pipeline we showed how to migrate build templates to the new framework. Today Knative Serving v0.2.3 was released, which enables the full Source-to-URL workflow to make use of pipeline Tasks. In this post we’ll demonstrate how to launch your function code as a container using the new pipeline resource definitions.
As the release notes say you can replace the old Build part of Service resources with anything that “indicate completion via … type: Succeeded status: True | False | Unknown”. If you have a completed TaskRun somewhere, run kubectl describe on it and you’ll notice:
Which means we should be good to go with Build Pipeline.
As with standalone use of Build Pipeline we first have to create the Task and its Resources. Let’s use an example from our triggermesh/pipeline-tasks repository. With that applied we can take a typical Service yaml and simply replace everything under “build:” with any TaskRun yaml (feel free to test it independently first). Our example then contains:
Now let’s run this on a cluster where Knative Build isn’t even installed:
Our function is now live! Used like this there’s no apparent advantage with Build Pipeline over the old Build, but in upcoming posts we’ll explore how to make use of the extended feature set. You could also set a watch on our pipeline-tasks repository to follow how examples evolve.