https://github.com/marcopaga/tekton-pipeline-and-task-test
This Demo repository will deploy and configure a Tekton CI System. It uses GitHub Actions to validate the Tekton config on every commit.
https://github.com/marcopaga/tekton-pipeline-and-task-test
flux github-actions tasks tekton testing
Last synced: 7 months ago
JSON representation
This Demo repository will deploy and configure a Tekton CI System. It uses GitHub Actions to validate the Tekton config on every commit.
- Host: GitHub
- URL: https://github.com/marcopaga/tekton-pipeline-and-task-test
- Owner: marcopaga
- Created: 2021-09-06T15:00:03.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2025-03-05T07:14:32.000Z (7 months ago)
- Last Synced: 2025-03-05T08:24:56.301Z (7 months ago)
- Topics: flux, github-actions, tasks, tekton, testing
- Language: Shell
- Homepage: https://marco-paga.eu/articles/
- Size: 740 KB
- Stars: 6
- Watchers: 5
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Tekton CI Demo
This Demo repository will deploy and configure a Tekton CI System. The Project will automatically bootstrap a K3d cluster with Flux.

## CI of the Tekton CI
This repository uses GitHub Actions to validate the Tekton config. Every commit triggers a cluster creation and validation.
The up-to-date bootstrap process is documented in the GitHub Actions workflow you can find in [this repo](./.github/workflows/create-cluster.yml).## Cluster Bootstrap
On a high level you need to provide a Github token with the following scopes: `repo_status`, `public_repo`. You can find the management dialog [here](https://github.com/settings/tokens). This token is used by the flux operator to connect to the git repository and roll-out the desired cluster state based on this repository.
#### 1. Create K3d cluster that exposes a http ingress
```sh
k3d cluster create -p "8081:80@loadbalancer" --agents 2
```This might take some time.
#### 2. Switch kubectl to K3d context & inspect cluster-info
```shell
kubectl config use-context k3d-k3s-default
kubectl cluster-info
```#### 3. Install Flux components with flux bootstrap:
```sh
GITHUB_TOKEN= GITHUB_USER= flux bootstrap github \
--owner= \
--repository=tekton-demo \
--private=false \
--personal=true \
--branch=main \
--path=clusters/local
```
#### 4. Check the progress of the deployment```shell
kubectl get Kustomization -n flux-system -w
```#### 5.(optional) Connect to the Tekton Dashboard
The Dashboard is deployed and accessible via the `tekton-dashboard` service on port 9097.
```shell
kubectl --namespace tekton-pipelines port-forward svc/tekton-dashboard 9097:9097
```## Using the Tekton sample pipeline
You can inspect the deployed tasks and pipelines by issuing those commands. Before following along make sure to install the [CLI tools](https://tekton.dev/docs/getting-started/#set-up-the-cli).
```shell
tkn task list
tkn pipeline list
```Create a pipeline run as follows and issue it via `kubectl create -f hello-goodbye-pipeline-run.yaml`. This command will return the created pipelinerun which you need for reference later. E.g. enter `tkn pr logs $PIPELINE_RUN_NAME` to get the log output of the pipeline.