-
Notifications
You must be signed in to change notification settings - Fork 573
kubernetes driver // allow custom annotations and labels #1938
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
Conversation
3e506e3
to
1996822
Compare
150ac01
to
1d9422b
Compare
1d9422b
to
11f376c
Compare
docs/reference/buildx_create.md
Outdated
@@ -141,7 +141,7 @@ to achieve that. | |||
|
|||
Passes additional driver-specific options. | |||
|
|||
Note: When using quoted values for example for the `nodeselector` or | |||
Note: When using quoted values for example for the `nodeselector`, `annotations` or |
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.
Note: When using quoted values for example for the `nodeselector`, `annotations` or | |
Note: When using quoted values for example for the `nodeselector`, `annotations`, `labels` or |
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.
I was expecting this comment :)
Should I remove for example
from the sentence, since it's supposed to be all-inclusive?
Note: When using quoted values for example for the `nodeselector`, `annotations` or | |
Note: When using quoted values for the `nodeselector`, `annotations`, `labels` or |
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.
(note: I applied my suggestion)
driver/kubernetes/factory_test.go
Outdated
|
||
_, _, _, err := f.processDriverOpts(cfg.Name, "test", cfg) | ||
|
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.
nit: remove extra lines
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.
I applied this comment on the other identical surrounding tests as well. I also noticed an extra ns := "test"
at the beginning that was not necessary since it was rewritten in the next call.
11f376c
to
7a228d6
Compare
Co-authored-by: Akihiro Suda <suda.kyoto@gmail.com> Signed-off-by: Jonathan Piché <jpiche@coveo.com>
7a228d6
to
9c06f38
Compare
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.
LGTM thanks!
This implements custom annotations and labels to be included in kubernetes manifests. Currently, the user has to patch them in a subsequent call.
Motivation: We provide a tool for developers to create/remove buildx builders on a shared k8s cluster. To prevent wasting resources, the buildx deployments are patched with a label (for filtering) and an annotation (an
expire-after
timestamp). A cron janitor eventually finds and removes them. The user may also refresh the timestamp in order to retain their cache for longer if they desire.Issue: Because creating the builder and patching the annotations requires two calls, I need to handle the cases when the
create
call fails. This isn't always possible in an exception handler, for instance when this happens on a CI server that gets killed abruptly. This forces the janitor to include additional heuristics to find and remove the leaked deployments. It would be simpler if these annotations would be included from the start.