Skip to content

Conversation

jlpettersson
Copy link
Member

@jlpettersson jlpettersson commented Jun 3, 2020

Changes

To be able to run Tekton workload on a subset of the Nodes in a cluster,
a NodeSelector or Tolerations can be set on the pods, e.g. by specifying a
custom PodTemplate.

When using the Affinity Assistant, this was not supported to customize.

This commit, also propagate NodeSelector and Tolerations to the Affinity Assistant pod,
so that Tekton workload can be kept to a subset of the Nodes in a cluster, also when
using the Affinity Assistant.

My original idea #2630 (comment) was that it could be useful to specify a specific PodTemplate for the AffinityAssistant.
But I think it is better to inherit some values from the already specified custom PodTemplate.

Fixes #2742
Fixes #2679
/kind feature

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

See the contribution guide for more details.

Double check this list of stuff that's easy to miss:

Reviewer Notes

If API changes are included, additive changes must be approved by at least two OWNERS and backwards incompatible changes must be approved by more than 50% of the OWNERS, and they must first be added in a backwards compatible way.

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 3, 2020
@tekton-robot tekton-robot requested review from bobcatfish and a user June 3, 2020 18:57
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 3, 2020
@tekton-robot
Copy link
Collaborator

This PR cannot be merged: expecting exactly one kind/ label

Available kind/ labels are:

kind/bug: Categorizes issue or PR as related to a bug.
kind/flake: Categorizes issue or PR as related to a flakey test
kind/cleanup: Categorizes issue or PR as related to cleaning up code, process, or technical debt.
kind/design: Categorizes issue or PR as related to design.
kind/documentation: Categorizes issue or PR as related to documentation.
kind/feature: Categorizes issue or PR as related to a new feature.
kind/misc: Categorizes issue or PR as a miscellaneuous one.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/affinity_assistant.go 90.7% 91.8% 1.1

@jlpettersson jlpettersson force-pushed the propagate_nodeselector_and_tolerations_to_affinity-assistant branch from 105c362 to b5f67da Compare June 3, 2020 20:09
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/affinity_assistant.go 90.7% 91.8% 1.1

@jlpettersson jlpettersson force-pushed the propagate_nodeselector_and_tolerations_to_affinity-assistant branch from b5f67da to 8e028f9 Compare June 3, 2020 20:17
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/affinity_assistant.go 90.7% 91.8% 1.1

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

just some minor feedback from me!

@jlpettersson jlpettersson force-pushed the propagate_nodeselector_and_tolerations_to_affinity-assistant branch from 8e028f9 to 090e463 Compare June 3, 2020 21:26
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/affinity_assistant.go 90.7% 91.8% 1.1

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

apologies, i continue to have feedback about the test!

but in general:
/approve

will be scheduled to the same Node as the Affinity Assistant pod. This means that Affinity Assistant is incompatible
with e.g. NodeSelectors or other affinity rules configured for the `TaskRun` pods. The Affinity Assistant
with e.g. other affinity rules configured for the `TaskRun` pods. If the `PipepineRun` has a custom
[PodTemplate](pipelineruns.md#specifying-a-pod-template) configured, the `NodeSelector` and `Tolerations` fields
Copy link
Collaborator

Choose a reason for hiding this comment

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

thanks!

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bobcatfish

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

The pull request process is described 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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 3, 2020
To be able to run Tekton workload on a subset of the Nodes in a cluster,
a NodeSelector or Tolerations can be set on the pods, e.g. by specifying a
custom PodTemplate.

When using the Affinity Assistant, this was not supported to customize.

This commit, also propagate NodeSelector and Tolerations to the Affinity Assistant pod,
so that Tekton workload can be kept to a subset of the Nodes in a cluster, also when
using the Affinity Assistant.

Fixes tektoncd#2742
/kind feature
@jlpettersson jlpettersson force-pushed the propagate_nodeselector_and_tolerations_to_affinity-assistant branch from 090e463 to ea82f73 Compare June 3, 2020 21:51
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/pipelinerun/affinity_assistant.go 90.7% 91.8% 1.1

Copy link
Collaborator

@bobcatfish bobcatfish left a comment

Choose a reason for hiding this comment

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

/lgtm
/meow

t.Errorf("unexpected NodeSelector in the StatefulSet")
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

🎉 thanks for redoing these twice 🙏

@tekton-robot
Copy link
Collaborator

@bobcatfish: cat image

In response to this:

/lgtm
/meow

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 3, 2020
@jlpettersson
Copy link
Member Author

/test pull-tekton-pipeline-integration-tests

@tekton-robot tekton-robot merged commit 038ce4e into tektoncd:master Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support using Tekton on a subset of Nodes when Affinity Assistant is enabled Add option to specify PodTemplate for Affinity Assistant
3 participants