generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Document Tekton Pipeline support with pod integration #3898
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
site/content/en/docs/tasks/run/external_workloads/tektoncd.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: "Run A Tekton Pipeline" | ||
linkTitle: "Tekton Pipeline" | ||
date: 2025-02-01 | ||
weight: 7 | ||
description: > | ||
Integrate Kueue with Tekton Pipelines. | ||
--- | ||
|
||
This page shows how to leverage Kueue's scheduling and resource management capabilities when running [Tekton pipelines](https://tekton.dev/docs/). | ||
|
||
This guide is for [batch users](/docs/tasks#batch-user) that have a basic understanding of Kueue. For more information, see [Kueue's overview](/docs/overview). | ||
|
||
We demonstrate how to support scheduling Tekton Pipelines Tasks in Kueue based on the [Plain Pod](/docs/tasks/run_plain_pods) integration, where every Pod from a Pipeline is represented as a single independent Plain Pod. | ||
|
||
## Before you begin | ||
|
||
1. Learn how to [install Kueue with a custom manager configuration](/docs/installation/#install-a-custom-configured-released-version). | ||
|
||
1. Follow the steps in [Run Plain Pods](docs/tasks/run/plain_pods/#before-you-begin) to learn how to enable and configure the `v1/pod` integration. | ||
|
||
1. Check [Administrator cluster quotas](/docs/tasks/manage/administer_cluster_quotas/) for details on the initial Kueue step. | ||
|
||
1. Your cluster has tekton pipelines [installed](https://tekton.dev/docs/installation/pipelines/). | ||
|
||
|
||
## Tekton Background | ||
|
||
Tekton has the concept of [Pipelines](https://tekton.dev/vault/pipelines-v0.59.x-lts/pipelines/), [Tasks](https://tekton.dev/vault/pipelines-v0.59.x-lts/tasks/) and [PipelineRun](https://tekton.dev/vault/pipelines-v0.59.x-lts/pipelineruns/). | ||
|
||
A pipeline consists of tasks. Tasks and pipelines must be created before running a pipeline. | ||
|
||
A PipelineRun runs the pipeline. | ||
|
||
A TaskRun runs a single task. PipelineRuns will reuse TaskRuns to run each task in a pipeline. | ||
|
||
### Tekton Defintions | ||
|
||
As a simple example, we will define two tasks named sleep and hello: | ||
|
||
{{< include "examples/pod-based-workloads/tekton-sleep-task.yaml" "yaml" >}} | ||
|
||
{{< include "examples/pod-based-workloads/tekton-hello-task.yaml" "yaml" >}} | ||
|
||
A pipeline composes these tasks. | ||
|
||
{{< include "examples/pod-based-workloads/tekton-pipeline.yaml" "yaml" >}} | ||
|
||
## a. Targeting a single LocalQueue | ||
|
||
If you want every task to target a single [local queue](/docs/concepts/local_queue), | ||
it should be specified in the `metadata.label` section of the PipelineRun configuration. | ||
|
||
{{< include "examples/pod-based-workloads/tekton-pipeline-run.yaml" "yaml" >}} | ||
|
||
This will inject the kueue label on every pod of the pipeline. Kueue will gate the pods once you are over the quota limits. | ||
|
||
## Limitations | ||
|
||
- Kueue will only manage pods created by Tekton. | ||
- Each pod in a Workflow will create a new Workload resource and must wait for admission by Kueue. | ||
- There is no way to ensure that a Workflow will complete before it is started. If one step of a multi-step Workflow does not have | ||
available quota, Tekton pipelines will run all previous steps and then wait for quota to become available. |
14 changes: 14 additions & 0 deletions
14
site/static/examples/pod-based-workloads/tekton-hello-task.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Task | ||
metadata: | ||
name: hello | ||
spec: | ||
params: | ||
- name: username | ||
type: string | ||
steps: | ||
- name: hello | ||
image: ubuntu | ||
script: | | ||
#!/bin/bash | ||
echo "Hello $(params.username)!" |
13 changes: 13 additions & 0 deletions
13
site/static/examples/pod-based-workloads/tekton-pipeline-run.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: PipelineRun | ||
metadata: | ||
generateName: kueue-test | ||
labels: | ||
kueue.x-k8s.io/queue-name: my-local-queue | ||
spec: | ||
pipelineRef: | ||
name: kueue-test | ||
params: | ||
- name: username | ||
value: "Tekton" | ||
|
20 changes: 20 additions & 0 deletions
20
site/static/examples/pod-based-workloads/tekton-pipeline.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Pipeline | ||
metadata: | ||
name: kueue-test | ||
spec: | ||
params: | ||
- name: username | ||
type: string | ||
tasks: | ||
- name: sleep | ||
taskRef: | ||
name: sleep | ||
- name: hello | ||
runAfter: | ||
- sleep | ||
taskRef: | ||
name: hello | ||
params: | ||
- name: username | ||
value: $(params.username) |
12 changes: 12 additions & 0 deletions
12
site/static/examples/pod-based-workloads/tekton-sleep-task.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: tekton.dev/v1 | ||
kind: Task | ||
metadata: | ||
name: sleep | ||
spec: | ||
steps: | ||
- name: echo | ||
image: alpine | ||
script: | | ||
#!/bin/sh | ||
sleep 100 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I was adding this, I realized that argo-workflows was not going to render correctly. Fixed it here.