Dekorate supports generating
Since Dekorate knows, how your project is build, packaged into containers and
deployed, converting that knowledge into a pipeline comes natural.
tekton module is added to the project:
<dependency> <groupId>io.dekorate</groupId> <artifactId>tekton-annotations</artifactId> <version>3.7.0</version> </dependency>
Two sets of resources will be generated, each representing a different configuration style the use user can choose from:
- Pipeline based
- Task based
This set of resources contains:
- Task (build, package and push, deploy)
- RBAC resources
These are the building blocks of a Tekton pipeline that grabs your project from scm, builds and containerizes the project (in cluster) and finally deploys it.
This set of resources provides the some functionality as above, but everything is collapsed under a single task (for usability reasons), In detail it contains:
- PipelineResource (git, output image)
- RBAC resources
Pipeline vs Task
If unsure which style to pickup, note that the
task style has less
configuration requirements and thus easier to begin with. The
is easier to slice and dice, once your are more comfortable with
Regardless of the choice, Dekorate provides a rich set of configuration options
to make using
tekton as easy as it gets.
The generated tasks and pipelines, assume the project is under version control and more specifically git.
So, in order to
run the pipeline or the
PipelineResource of type
git is required.
If the project is added to git, the resource will be generated for you. If for any reason the use of an external resource is
preferred then it needs to be configured, like:
dekorate.tekton.external-git-pipeline-resource=<<the name of the resource goes here>>
Both the pipeline and the task based resources include steps that perform a build of the project. Dekorate, tries to identify a suitable builder image for the project. Selection is based on the build tool, jdk version, jdk flavor and build tool version (in that order). At the moment only maven and gradle are supported.
You can customize the build task by specifying:
- custom builder image:
- custom build command:
- custom build arguments:
Configuring a Workspace PVC
One of the main differences between the two styles of configuration, is that
Pipelines require a
PersistentVolumeClaim in order to share the workspace
between Tasks. On the contrary when all steps are part of single bit fat Task
(which is baked by a Pod) and
EmptyDir volume will suffice.
Out of the box, for the pipeline style resources a
after the application will be generated and used.
The generated pvc can be customized using the following properties:
- dekorate.tekton.source-workspace-claim.size (defaults to
- dekorate.tekton.source-workspace-claim.storage-class (defaults to
The option to provide an existing pvc (by name) instead of generating one is also
Configuring the Docker registry for Tekton
The generated Pipeline / Task includes steps for building a container image and pushing it to a registry.
The registry can be configured using
dekorate.docker.registry as is done for
the rest of the resources.
For the push to succeed credentials for the registry are required. The user is able to:
- Provide own Secret with registry credentials
- Provide username and password
- Upload local
To provide an existing secret for the job (e.g.
To provide username and password:
If none of the above is provided and a
.docker/config.json exists, it can be
used if explicitly requested: