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

Only create & mount Downward API volume when necessary #4953

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

hWorblehat
Copy link
Contributor

@hWorblehat hWorblehat commented Jun 9, 2022

Changes

Addresses #4937

  • Instead of always mounting a Downward API volume for reading the "ready" annotation on task Pods, we only create it if the pod will not be "immediately ready" (i.e. if it has sidecars).
  • Add new await-sidecar-readiness feature flag, defaulted to true. Tasks will always be considered "immediately ready" if this is false.

/kind feature

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Docs included if any changes are user facing
  • Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been filled in
    (if there are no user facing changes, use release note "NONE")

Release Notes

Added an `await-sidecar-readiness` feature flag, which can be used to remove the of DownwardAPI volumes in TaskRun pods. (#4953, @hWorblehat)

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Jun 9, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 9, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: hWorblehat / name: Rowan Lonsdale (d7fb7e3)

@tekton-robot tekton-robot added the do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. label Jun 9, 2022
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 9, 2022
@tekton-robot
Copy link
Collaborator

Hi @hWorblehat. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@pritidesai
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 10, 2022
@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/pod/entrypoint.go 88.3% 88.8% 0.4
pkg/pod/pod.go 88.3% 88.6% 0.3

@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/pod/entrypoint.go 88.3% 88.8% 0.4
pkg/pod/pod.go 88.3% 88.6% 0.3

@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/apis/config/feature_flags.go 88.0% 86.5% -1.5
pkg/pod/entrypoint.go 88.3% 88.8% 0.4
pkg/pod/pod.go 88.3% 88.4% 0.1

@hWorblehat hWorblehat changed the title WIP - Only create & mount Downward API volume when necessary Only create & mount Downward API volume when necessary Jun 10, 2022
@hWorblehat hWorblehat marked this pull request as ready for review June 10, 2022 12:09
@tekton-robot tekton-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 10, 2022
@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/apis/config/feature_flags.go 88.0% 86.5% -1.5
pkg/pod/entrypoint.go 88.3% 88.8% 0.4
pkg/pod/pod.go 88.3% 88.4% 0.1

@hWorblehat
Copy link
Contributor Author

I think this is ready for an initial review now. Do I need to assign someone particular for that?

@hWorblehat
Copy link
Contributor Author

/assign @imjasonh

Sorry to bug - is there anything else I need to do to prompt a review here, or is it just a case of waiting until people have some free time?

@hWorblehat
Copy link
Contributor Author

/unassign @imjasonh
/cc @imjasonh

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 22, 2022
@lbernick
Copy link
Member

hi @hWorblehat would you mind squashing into one commit please? (a bit more detail about that in the tekton commit message standards)

@hWorblehat
Copy link
Contributor Author

Hi @lbernick,

Sorry for slow response, I've been off work this last week.

I'd seen the commit message standards, and had thought it made sense to leave the changes as 2 commits as they cover logically distinct behaviours:

  1. Not creating/mounting the downwardAPI volume when it's known not to be needed.
  2. Providing a feature flag to disable waiting for sidecars (therefore making the downwardAPI volume unneeded in all scenarios)

Still, I'm happy to squash this all into one commit if you'd prefer.

Copy link
Member

@lbernick lbernick left a comment

Choose a reason for hiding this comment

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

I wonder if it would make sense to add a warning if someone has "await-sidecar-readiness=false" but they are using sidecars. If someone enables this they probably have a good reason but would still be nice to have. Can probably be tracked in a separate issue

pkg/pod/pod.go Outdated Show resolved Hide resolved
@lbernick
Copy link
Member

lbernick commented Jul 8, 2022

I'd seen the commit message standards, and had thought it made sense to leave the changes as 2 commits as they cover logically distinct behaviours

Possibly our commit message standards could use some improvement :) We typically prefer one commit per PR unless there's a strong reason not to. If you wouldn't mind squashing that would be great, LGTM other than that.

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vdemeester

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

@hWorblehat
Copy link
Contributor Author

Hi @lbernick,

Squashed as requested. I've also rejigged the isPodReadyImmediately function as requested, and added a line of logging.

@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/apis/config/feature_flags.go 83.0% 81.8% -1.2
pkg/pod/entrypoint.go 88.3% 88.8% 0.4
pkg/pod/pod.go 88.3% 88.8% 0.5

Instead of always mounting a Downward API volume for reading the "ready"
annotation on task Pods, we only create it if the pod will not be
"immediately ready" (i.e. if it has sidecars).

In addition, a new feature flag is added: "await-sidecar-readiness".
Setting this to `false` will mean that pods will always be considered
"immediately ready", so the Downward API volume will never be mounted.
@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/apis/config/feature_flags.go 83.0% 81.8% -1.2
pkg/pod/entrypoint.go 88.3% 88.8% 0.4
pkg/pod/pod.go 88.3% 88.8% 0.5

@lbernick
Copy link
Member

awesome thanks!

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 11, 2022
@vdemeester
Copy link
Member

/retest

1 similar comment
@hWorblehat
Copy link
Contributor Author

/retest

@tekton-robot tekton-robot merged commit 3f01be0 into tektoncd:main Jul 12, 2022
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

6 participants