Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kannon92
Copy link
Contributor

What type of PR is this?

/kind documentation

What this PR does / why we need it:

Example integration with TektonCD

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. labels Dec 20, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kannon92
Once this PR has been reviewed and has the lgtm label, please assign moficodes for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 20, 2024
Copy link

netlify bot commented Dec 20, 2024

Deploy Preview for kubernetes-sigs-kueue ready!

Name Link
🔨 Latest commit dc850ed
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/6765c639bbf985000869861d
😎 Deploy Preview https://deploy-preview-3898--kubernetes-sigs-kueue.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kannon92 kannon92 changed the title Tekton Pipeline Integration Document Tekton Pipeline support with pod integration Dec 21, 2024
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this great documentation!

My question is are there Tekton specific features to schedule gang (Pods)?

date: 2024-01-03
weight: 7
description: >
Integrate Kueue with TektonCD Pipelines.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Integrate Kueue with TektonCD Pipelines.
Integrate Kueue with Tekton Pipelines.

Isn't it the appropriate name is Tekton Pipeline instead of TektonCD Pipeline?
https://github.com/tektoncd/pipeline?tab=readme-ov-file#-tekton-pipelines

Integrate Kueue with TektonCD Pipelines.
---

This page shows how to leverage Kueue's scheduling and resource management capabilities when running [TektonCD pipelines](https://tekton.dev/docs/).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This page shows how to leverage Kueue's scheduling and resource management capabilities when running [TektonCD pipelines](https://tekton.dev/docs/).
This page shows how to leverage Kueue's scheduling and resource management capabilities when running [Tekton pipelines](https://tekton.dev/docs/).

Comment on lines +13 to +14
As of the writing of this doc, Kueue doesn't support TektonCD Pipelines [Pipelines](https://github.com/tektoncd/pipeline/blob/main/docs/README.md) resources directly,
but you can take advantage of the ability for Kueue to [manage plain pods](/docs/tasks/run_plain_pods) to integrate them.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
As of the writing of this doc, Kueue doesn't support TektonCD Pipelines [Pipelines](https://github.com/tektoncd/pipeline/blob/main/docs/README.md) resources directly,
but you can take advantage of the ability for Kueue to [manage plain pods](/docs/tasks/run_plain_pods) to integrate them.
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.

I would like to keep mentioning only end user-facing descriptions here.

Comment on lines +18 to +20
1. By default, the integration for `v1/pod` is not enabled.
Learn how to [install Kueue with a custom manager configuration](/docs/installation/#install-a-custom-configured-released-version)
and enable the `pod` integration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
1. By default, the integration for `v1/pod` is not enabled.
Learn how to [install Kueue with a custom manager configuration](/docs/installation/#install-a-custom-configured-released-version)
and enable the `pod` integration.
1. Learn how to [install Kueue with a custom manager configuration](/docs/installation/#install-a-custom-configured-released-version).
2. 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.
3. Check [Administrator cluster quotas](/docs/tasks/manage/administer_cluster_quotas/) for details on the initial Kueue step.

Could you delegate the duplicated descriptions to the existing documentation?

Comment on lines +22 to +51
The pod integration for TektonCD Pipelines could look like:

```yaml
apiVersion: config.kueue.x-k8s.io/v1beta1
kind: Configuration
integrations:
frameworks:
- "pod"
podOptions:
# You can change namespaceSelector to define in which
# namespaces kueue will manage the tektoncd pods.
namespaceSelector:
matchExpressions:
- key: kubernetes.io/metadata.name
operator: NotIn
values: [ kube-system, kueue-system ]
# Tekton pipelines uses the app.kubernetes.io/managed-by label to
# keep track of pods it manages. We will use that as a hint for Kueue
# to find Tekton pods.
podSelector:
matchExpressions:
- key: app.kubernetes.io/managed-by
operator: In
values: [ "tekton-pipelines" ]
```

2. Pods that belong to other API resources managed by Kueue are excluded from being queued by `pod` integration.
For example, pods managed by `batch/v1.Job` won't be managed by `pod` integration.

3. Check [Administer cluster quotas](/docs/tasks/administer_cluster_quotas) for details on the initial Kueue setup.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once we describe the basic Kueue setting the above, we can get rid of these configurations.

Comment on lines +40 to +45
# to find Tekton pods.
podSelector:
matchExpressions:
- key: app.kubernetes.io/managed-by
operator: In
values: [ "tekton-pipelines" ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that we should configure this Pod selector since this selector prevents the management of Pod except for the Tekton Pipeline Pods.

Comment on lines +55 to +76
## Motivation

Let's say you are providing a build platform for a software delivery service.
During a busy time of a year, you have many engineers creating build pipelines and your cluster is at capacity due to the number of builds created.
One can use Kueue to limit the number of pods that are created by using the pod integration.
Kueue provides quota limits on core resources so one could create a clusterqueue that limits the number of pods.

```yaml
apiVersion: kueue.x-k8s.io/v1beta1
kind: ClusterQueue
metadata:
name: "cluster-queue"
spec:
namespaceSelector: {} # match all.
resourceGroups:
- coveredResources: ["pods"]
flavors:
- name: "default-flavor"
resources:
- name: "pods"
nominalQuota: 2
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Motivation
Let's say you are providing a build platform for a software delivery service.
During a busy time of a year, you have many engineers creating build pipelines and your cluster is at capacity due to the number of builds created.
One can use Kueue to limit the number of pods that are created by using the pod integration.
Kueue provides quota limits on core resources so one could create a clusterqueue that limits the number of pods.
```yaml
apiVersion: kueue.x-k8s.io/v1beta1
kind: ClusterQueue
metadata:
name: "cluster-queue"
spec:
namespaceSelector: {} # match all.
resourceGroups:
- coveredResources: ["pods"]
flavors:
- name: "default-flavor"
resources:
- name: "pods"
nominalQuota: 2
```

I do not think that we want to mention this here since this is end users like batch users' documentation.

As a simple example, we will define two tasks named sleep and hello:

Tasks:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


This will inject the kueue label on every pod of the pipeline. Kueue will gate the pods once you are over the quota limits.

## c. How it works
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should remove this section since this page does not indicate the concept and mechanism. We just describe the user's documentation step by step.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants