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

Allow adding jenkins job metadata to the pods using the KubernetesComputer extenion point #383

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

kenankule
Copy link

Kubernetes Computer ExtensionPoint

Similar to #238, we would like to add metadata of the running jenkins jobs to
the pods.

Ideally we would like to have the JOB_NAME, BUILD_NUMBER, BUILD_TAG (of which
may or may not be meaningful) available in the pods. Unlike #238, we
would like to use labels not annotations as it is easier to correlate those in
prometheus using the kube_node_labels series.

In our discussions we've realized that the display name of a job may differ
based on the job type and our naming scheme would only hold for certain jobs
and it is difficult to come up with a generic solution (especially keeping in
mind that label values can only use the following chars :[a-z0-9A-Z], dashes
(-), underscores (_), dots (.)).

One of the solutions we can think of is to create an extension point that will
allow different KubernetesComputer implementations. I've tried to reuse the
implementation in the refactoring of PlanningNode but i also feel that having
multiple providers of KubernetesComputer may lead to ambiguous class
resolution. A better approach could be to manage/activate KubernetesComputer
providers from the plugin configuration.

I can probably work on this further to get at least JOB_NAME and job status in
with the default KubernetesComputer implementation (similar to #238) and focus on the not so
generic requests (BUILD_TAG, BUILD_NUMBER) on a separate plugin that will use
the extension point provided by this change.

KubernetesComputer creation is delegated to a factory that provides an
extention point. This way, users will be able to provide their own
KubernetesComputer implementations.
@carlossg carlossg merged commit a268eaf into jenkinsci:master Oct 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants