Category: Database, Data, Kubernetes, Docker, github, yaml

In this article we will pick up where we left off in the previous article in which we deployed our Tekton Pipelines environment and we will explore in detail how to find, build and customize Tekton Tasks to create all the necessary building blocks for our pipelines. On top of that, we will also look at how to maintain and test our newly built Tasks, while using all the best practices for creating reusable, testable, well-structured and simple tasks.

Back to the main topic of this example — PVC for database backup — considering that we want this data to be persistent, we cannot use PVC created using volumeClaimTemplate as shown previously as that would get cleaned up after Task finishes, so instead we need to create the PVC separately and pass it to Task this way: Here we use persistentVolumeClaim instead of volumeClaimTemplate and we specify name of existing PVC which is also defined in the above snippet.

In general though, for any particular Task in repositories of both of these projects, you can run the following commands to perform the test: For me personally — when it comes to testing Tasks — it’s sufficient to use the above basic testing approach for validation and ad-hoc testing.

Regardless of whether you choose basic or “all-out” approach for your testing though, try to make sure that you test more than just happy paths in the Tasks and Pipelines, otherwise you might end-up seeing a lot of bugs when they get deployed “in the wild”.

Related Articles