Add task UUID label to Kubernetes pods#5544
Merged
Merged
Conversation
henkka
commented
Sep 23, 2025
Contributor
|
Surge PR preview deployment succeeded. View it at https://woodpecker-ci-woodpecker-pr-5544.surge.sh |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5544 +/- ##
=======================================
Coverage 26.32% 26.33%
=======================================
Files 405 405
Lines 29028 29031 +3
=======================================
+ Hits 7641 7644 +3
Misses 20688 20688
Partials 699 699 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
xoxys
approved these changes
Sep 23, 2025
xoxys
left a comment
Member
There was a problem hiding this comment.
Thanks! I like this approach as a pragmatic way to solve the current issue.
Contributor
Author
|
Thank you for the really quick turnaround on this pull request! We're amazed by how well this project is run and how easily we can contribute to it. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Slightly relates to #5402 and #3344
Problem
When using the Kubernetes backend with ReadWriteOnce PersistentVolumes, volumes can only be attached to one Kubernetes worker node at a time. This creates scheduling conflicts when workflow steps are scheduled to run on different nodes (due to worker node size constraints for example).
Background
The somewhat ideal solution would be to implement Kubernetes PodAffinity and PodAntiAffinity rules directly in Woodpecker to ensure:
However, a previous attempt to add this functionality (PR #3345) was declined as there's different views how the root problem should be resolved. In our opinion, #3366 sounds like a good approach, but at this moment we cannot afford to wait for implementing such a major change.
Proposed Solution
Instead of modifying Woodpecker's core scheduling logic, this PR enables external solutions by adding a
woodpecker-ci.org/task-uuidlabel to each pod. This label:TL;DR: We figured this approach is the path of least resistance that allows Woodpecker CI users to overcome the background issue without big changes to Woodpecker CI project itself.