Cloud Native CI/CD with Tekton - Building Custom Tasks

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • tekton-kickstarter

    Templates, scripts and samples for quickly building CI/CD with Tekton.

  • # https://github.com/MartinHeinz/tekton-kickstarter/blob/master/misc/config.yaml apiVersion: v1 kind: ConfigMap metadata: name: repo-app-mapping data: repo-app-mapping.yaml: | '[email protected]:kelseyhightower/nocode.git': 'nocode' '[email protected]:MartinHeinz/blog-frontend.git': 'blog-backend' '[email protected]:MartinHeinz/game-server-operator.git': 'game-server-operator' '[email protected]:MartinHeinz/python-project-blueprint.git': 'sample-python-app' --- # https://github.com/MartinHeinz/tekton-kickstarter/blob/master/tasks/get-application-name/get-application-name.yaml apiVersion: tekton.dev/v1beta1 kind: ClusterTask metadata: name: get-application-name spec: params: - name: repository-url type: string - name: mapping-file type: string steps: - name: get-application-name image: mikefarah/yq script: | #!/usr/bin/env sh set -xe yq e '."$(params.repository-url)"' /config/$(params.mapping-file) | tr -d '\012\015' > /tekton/results/application-name results: - name: application-name # Can be accessed by other Tasks with $(tasks.get-application-name.results.application-name) workspaces: - name: config mountPath: /config

  • catalog

    Catalog of shared Tasks and Pipelines. (by tektoncd)

  • Another common thing that you might need in your Tasks is some kind of a storage where you can write data that can be used by subsequent steps in the Task or by other Tasks in the pipeline. The most common use case for this would be a place to fetch git repo. This kind of a storage is called workspace in Tekton and the following example shows a Tasks that mounts and clears the storage using rmdir:

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • dive

    A tool for exploring each layer in a docker image

  • Final thing I want to show here is the usage of sidecar containers. These are not so common, but can be useful when you need to run some service (which your Task depends on) for the duration of Task execution. One such service can be Docker daemon sidecar with exposed socket. To demonstrate this we can create a Task that performs Docker image efficiency analysis using tool called Dive:

  • pipeline

    A cloud-native Pipeline resource.

  • This covers most of the features of Tekton Tasks, but one thing I didn't mention so far and you will surely run into when reading Tekton docs is PipelineResource object, which can be used as Tasks input or output - for example GitHub sources as input or Docker image as output. So, why haven't I mentioned it yet? Well, PipelineResource is part of Tekton that I prefer to not use for a couple of reasons:

  • community

    Community documentation for the Tekton project (by tektoncd)

  • Tekton Design Principles

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts