Deploy Application With Custom Build Tool/Framework
This use case demonstrates how to implement custom CI/CD pipelines within the KubeRocketCI platform to address project-specific requirements. KubeRocketCI extends this capability by supporting the customization of Applications (Projects) and Tekton pipelines, allowing teams to integrate and develop functionalities or services not readily available on the platform.
Goalsβ
The goal of this is to configure KubeRocketCI in a way to:
- Incorporate and manage custom Tekton pipeline libraries that addresses project requirements.
- Modify existing pipelines and tasks within these libraries to align with specific developmental goals and introduce novel functionalities.
- Facilitate a swift setup and implementation process, enabling teams to focus on development without being hindered by platform limitations.
Preconditionsβ
Before starting this use case, ensure that:
- KubeRocketCI instance with GitHub and Tekton is configured;
- Developer has access to the KubeRocketCI instances using the Single-Sign-On approach;
- Developer has
Writepermissions for GitHub repository to merge the code; - Argo CD instance is configured with the Add-ons repository added.
Scenarioβ
To streamline the process of implementing custom logic within the KubeRocketCI platform, follow this scenario:
- Add Custom Application: Begin by adding your application to the KubeRocketCI platform.
- Add Custom Tekton Library: Create and add a custom Tekton library designed to implement the CI/CD logic required by your application.
- Validate the Implementation: After setting up your Application and Tekton library, conduct testing to ensure that the pipelines execute as intended.
Add Custom Application to KubeRocketCIβ
A Custom Application refers to any application that utilizes a programming language, framework, or build tool not natively supported by the platform, or an existing application that necessitates specific customizations to its pipeline.
This encompasses scenarios where the default pipeline configurations and toolchains are unable to meet the unique requirements of the application, thereby requiring the development and integration of tailored solutions.
-
Log in to the KubeRocketCI portal:

-
On the main menu, click the Manage Namespaces button:

-
Ensure the
Namespacevalue points to the namespace with the KubeRocketCI installation:
noteDon't forget to press Enter to add the namespace to the allowed namespaces list.
-
Select the Projects section and click + Create project:

-
Create a new Project of the
Applicationtype using theClonestrategy since we are cloning the application from the existing repository:
-
In the Git & project info tab, define the following values and click the Continue button:
- Repository URL:
https://github.com/epmd-edp/go-go-beego.git - Git Server: select the available GitHub server
- Owner:
github_account_name - Repository name:
tekton-hello-world - Project name:
tekton-hello-world - Default branch:
main - Description:
Custom tekton-hello-world application

- Repository URL:
-
In the Build config tab, define the values and click the Continue button:
- Deployment option:
helm-chart - Application code language:
Other - Language version/framework:
go - Build tool:
shell - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT

- Deployment option:
-
On the Review tab, verify the project configuration and click Create project:

-
On the congratulations page, click View all projects:

-
Check the application status. It should be green:
Now that the application is successfully created, proceed to adding the Tekton library to the KubeRocketCI platform.
It's important to align with the Tekton Pipeline name to ensure correct pipeline execution for review and build events.
The name for PipelineRun is dynamically generated via TriggerTemplates located in the pipelines-library and aligned to the structure provided below:
pipelineRef:
name: github-$(tt.params.buildtool)-$(tt.params.framework)-$(tt.params.cbtype)-build-$(tt.params.versioning-type)
pipelineRef:
name: github-$(tt.params.buildtool)-$(tt.params.framework)-$(tt.params.cbtype)-review
This naming convention facilitates the automatic creation of PipelineRun instances in response to payload from GitHub: the review pipeline runs during Merge Request events, and the build pipeline runs after the changes are merged. Ensure that the Pipeline name matches this structure to enable the correct triggering of pipeline executions.
In our case, the build pipeline name should be github-shell-go-app-build-semver and the review pipeline name should be github-shell-go-app-review.
Add Tekton Libraryβ
KubeRocketCI allows for the creation of custom Tekton libraries to address specific project requirements. This feature enables the modification of existing pipelines and tasks to align with the unique needs of the application.
-
Select the Projects tab and push the create + Create Project button:

-
Select Custom configuration, Library, Create and click Continue:
noteThe KubeRocketCI
Createstrategy will automatically pull the code for the Tekton Helm application from the template. -
In the Git & project info tab, define the following values and click the Continue button:
- Git Server: select the available GitHub server
- Owner:
github_account_name - Repository name:
custom-tekton-chart - Project name:
custom-tekton-chart - Description:
Repository for storing and managing custom Tekton resources

-
In the Build config tab, define the values and click the Continue button:
- Application code language:
Helm - Language version/framework:
Pipeline - Build tool:
Helm - Default branch:
main - Codebase versioning type:
semver - Start version from:
0.1.0 - Suffix:
SNAPSHOT

- Application code language:
-
On the Review tab, verify the project configuration and click Create project:

-
On the congratulations page, click View all projects.
-
Check the codebases' status:

You have successfully added the custom Tekton library to the KubeRocketCI platform and are now ready to modify the Tekton pipeline to align with the specific requirements of your custom application.
Modify Tekton Pipelineβ
We strongly advise against altering the platform's default Tekton resources. To ensure seamless upgrades and maintain custom functionality, it is recommended to develop and manage your custom pipelines within a dedicated Custom Tekton Library. This approach safeguards your customizations and facilitates a smoother update process.
Now that the Tekton Helm library is created, it is time to clone, modify and then apply it to the Kubernetes cluster.
-
In the Projects tab, click one of the
custom-tekton-chartto enter the application menu:
-
Navigate to Branches and click to the Git button:

-
Clone the repository with
SSHusing Code button:
-
Examine the repository structure. It should look this way by default:
tekton-custom-pipelinesβββ Chart.yamlβββ templatesβΒ Β βββ pipelinesβΒ Β βΒ Β βββ deployβΒ Β βΒ Β βΒ Β βββ custom-clean.yamlβΒ Β βΒ Β βΒ Β βββ custom-deploy.yamlβΒ Β βΒ Β βββ bitbucket-build-default.yamlβΒ Β βΒ Β βββ bitbucket-build-semver.yamlβΒ Β βΒ Β βββ bitbucket-build-lib-default.yamlβΒ Β βΒ Β βββ bitbucket-build-lib-semver.yamlβΒ Β βΒ Β βββ bitbucket-review.yamlβΒ Β βΒ Β βββ gerrit-build-default.yamlβΒ Β βΒ Β βββ gerrit-build-semver.yamlβΒ Β βΒ Β βββ gerrit-build-lib-default.yamlβΒ Β βΒ Β βββ gerrit-build-lib-semver.yamlβΒ Β βΒ Β βββ gerrit-review.yamlβΒ Β βΒ Β βββ github-build-default.yamlβΒ Β βΒ Β βββ github-build-semver.yamlβΒ Β βΒ Β βββ github-build-lib-default.yamlβΒ Β βΒ Β βββ github-build-lib-semver.yamlβΒ Β βΒ Β βββ github-review.yamlβΒ Β βΒ Β βββ gitlab-build-default.yamlβΒ Β βΒ Β βββ gitlab-build-semver.yamlβΒ Β βΒ Β βββ gitlab-build-lib-default.yamlβΒ Β βΒ Β βββ gitlab-build-lib-semver.yamlβΒ Β βΒ Β βββ gitlab-review.yamlβΒ Β βββ resourcesβΒ Β βΒ Β βββ npm-settings.yamlβΒ Β βββ tasksβΒ Β βΒ Β βββ deployβΒ Β βΒ Β βΒ Β βββ hello-world-deploy.yamlβΒ Β βΒ Β βββ hello-world.yamlβΒ Β βββ triggersβΒ Β βββ custom-clean.yamlβΒ Β βββ custom-deploy.yamlβββ values.yamlFor more detailed information and explanations regarding the repository structure, please refer to Creating and Using Custom Tekton Pipelines use case.
noteUpdate the values in the
values.yamlfile.The dnsWildCard parameter is the platform address.
Below is a sample configuration for the
values.yamlfile:dnsWildCard: "example.domain.com" -
Modify and add tasks or pipelines.
Consider the scenario where it's necessary to incorporate the
helm-linttask into the review pipeline. To achieve this, set themetadata.namefield togithub-shell-go-app-reviewand append the following code snippet to thetemplates/pipelines/github-review.yamlfile, specifically below thehello-worldtask, located here: github-review.yaml:apiVersion: tekton.dev/v1kind: Pipelinemetadata:name: github-shell-go-app-review...- name: hello-worldtaskRef:name: hello-worldrunAfter:- init-valuesparams:- name: BASE_IMAGEvalue: "$(params.image-version)"- name: usernamevalue: "$(params.username)"workspaces:- name: sourceworkspace: shared-workspacesubPath: source- name: helm-linttaskRef:kind: Taskname: helm-lintrunAfter:- hello-worldparams:- name: EXTRA_COMMANDSvalue: |ct lint --validate-maintainers=false --charts deploy-templates/workspaces:- name: sourceworkspace: shared-workspacesubPath: sourcenoteThe
helm-linttask references to the defaultpipeline-libraryHelm chart which is deployed to the cluster as part of the KubeRocketCI setup process.The
runAfterparameter indicates the execution sequence, specifying that thehelm-linttask is scheduled to run subsequent to the completion of thehello-worldtask.Also, in the
templates/pipelines/github-build-semver.yamlfile, specify the namegithub-shell-go-app-build-semverfor the custom build pipeline:apiVersion: tekton.dev/v1kind: Pipelinemetadata:name: github-shell-go-app-build-semver... -
Commit and push the modified Tekton Helm chart to GitHub:
git checkout -b helmgit add .git commit -m "Add Helm chart testing for go-shell application"git push -u origin helm -
Navigate Github -> Pull requests -> Compare & pull request -> Create pull request.

-
Check the GitHub code review for the custom Helm chart pipelines repository in KubeRocketCI. Navigate to Projects -> Project name and click to the review pipeline run:

-
Explore the pipeline status and steps:

-
Go to the GitHub Pull requests -> Add Helm chart testing for go-shell application and click Merge pull request:

Deliver Custom Tekton Pipelines to the clusterβ
To deploy custom pipelines to the cluster, you can use Argo CD, which includes a repository with add-ons.
To deliver custom Tekton pipelines to the cluster, follow these steps:
-
Clone the forked repository with add-ons and make the following changes. In the
clusters/core/apps/values.yamlfile, set therepoUrlandnamespacefields to specify the Git URL of thecustom-tekton-chartrepository and the namespace where the KubeRocketCI platform is deployed. Also, set thekuberocketci-pipelines.enablefield totrueto enable the deployment of thekuberocketci-pipelinesArgo CD Application:kuberocketci-pipelines:enable: truenamespace: <krci-namespace>repoUrl: ssh://git@github.com:22/<account-name>/custom-tekton-chart.git -
Commit and push the changes to the repository.
After making the necessary changes, commit and push the changes to the repository. Use the following commands to commit and push the changes:
git add .git commit -m "Enable custom Tekton pipelines deployment"git push origin main -
After pushing the changes, access Argo CD, navigate to the Application that corresponds to the repository with the add-ons, and initiate the
Syncprocess. This will apply thecustom-tekton-chartHelm Chart to the cluster within the specified namespace:
-
Open the kuberocketci-pipelines component by clicking the link button:

-
Find the github-shell-go-app-build-semver pipeline and select Details:

-
On the resource window, click Sync -> Synchronize:

-
Repeat the steps 5-6 for the github-shell-go-app-review pipeline:

Create Application Merge Requestβ
Since we applied the Tekton library to the Kubernetes cluster in the previous step, let's test the review and build pipelines for our tekton-hello-world application.
Perform the below steps to merge new code (Merge Request) that passes the Code Review flow. For the steps below, we use GitHub UI but the same actions can be performed using the command line and Git tool:
-
In the Projects tab, click on the
tekton-hello-worldname to enter the application details page. -
Navigate to Branches and click to the branch name button:

-
Navigate to the Branches menu, create a new branch from the New branch menu with name
test, and click on the test branch:
-
Change file
deploy-templates/values.yamlby changing thereplicaCountvalue:...replicaCount: 2... -
Click Pull requests -> Compare & pull request -> and click Create pull request.
-
Check the Review Pipeline status. Navigate KubeRocketCI -> Projects ->
tekton-hello-worldand click on review pipeline. Thehelm-linttask should be displayed there:
-
After review procedure successfully ended - approve merge request. Navigate Github -> Pull requests ->
testand click on Merge pull request button. Then, your code is merged to the main branch, triggering the Build Pipeline:
-
Check the pipelines in the KubeRocketCI dashboard:

Under the hood, the following process takes place:
- GitHub sends a payload to the Tekton EventListener when a Merge Request event occurs.
- The EventListener captures the payload with the assistance of an Interceptor.
- The TriggerTemplate creates a PipelineRun.
The detailed scheme is shown below:
This chart will be using the core of common-library and pipelines-library and custom resources on the top of them.