[JIRA] (JENKINS-59690) Support multiple Pod/Slave labels

9 views
Skip to first unread message

Jake.Remitz@carlsonwagonlit.com (JIRA)

unread,
Oct 7, 2019, 2:34:02 PM10/7/19
to jenkinsc...@googlegroups.com
Jake Remitz created an issue
 
Jenkins / Bug JENKINS-59690
Support multiple Pod/Slave labels
Issue Type: Bug Bug
Assignee: Unassigned
Components: kubernetes-plugin
Created: 2019-10-07 18:32
Labels: labels
Priority: Minor Minor
Reporter: Jake Remitz

Bug JENKINS-37087 seems to imply that the kubernetes-plugin can support multiple pod labels, resulting in a jenkins slave having multiple labels.  I cannot seem to find documentation of this and any attempt at adding multiple labels such as "k8s python alpine" for three slave labels fails with error:

ERROR: Labels must follow required specs - https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set

I've tried defining in a similar method with custom yaml:

 

podTemplate(label: "python", yaml: """
  apiVersion: v1
  kind: Pod
  metadata:
    labels:
      jenkins/python: "true"
      jenkins/k8s: "true"
  spec:
    containers:
    - command:
      - cat
      tty: true
      image: python:alpine
      name: python
  """

However only the python label shows, not the k8s, when the slave is created.

Is this possible with the current design? The end goal is to match specific CustomTools that require slave labels to run custom install scripts. Otherwise the labels aren't found and the tool cannot install.
 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

Jake.Remitz@carlsonwagonlit.com (JIRA)

unread,
Oct 7, 2019, 2:34:03 PM10/7/19
to jenkinsc...@googlegroups.com
Jake Remitz updated an issue
Change By: Jake Remitz
Bug JENKINS-37087 seems to imply that the kubernetes-plugin can support multiple pod labels, resulting in a jenkins slave having multiple labels.  I cannot seem to find documentation of this and any attempt at adding multiple labels such as "k8s python alpine
" for three slave labels fails with error:
{quote}{{ERROR: Labels must follow required specs - [https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set]}}
{quote}

I've tried defining in a similar method with custom yaml:

 {code}

podTemplate(label: "python", yaml: """
  apiVersion: v1
  kind: Pod
  metadata:
    labels:
      jenkins/python: "true"
      jenkins/k8s: "true"
  spec:
    containers:
    - command:
      - cat
      tty: true
      image: python:alpine
      name: python
  """
{code}


However only the {{python}} label shows, not the k8s, when the slave is created.

Is this possible with the current design?  The end goal is to match specific [CustomTools|https://plugins.jenkins.io/custom-tools-plugin] that require slave labels to run custom install scripts. Otherwise the labels aren't found and the tool cannot install.
 

Jake.Remitz@carlsonwagonlit.com (JIRA)

unread,
Oct 7, 2019, 2:35:03 PM10/7/19
to jenkinsc...@googlegroups.com
Jake Remitz updated an issue
Bug JENKINS-37087 seems to imply that the kubernetes-plugin can support multiple pod labels, resulting in a jenkins slave having multiple labels.  I cannot seem to find documentation of this and any attempt at adding multiple labels such as "k8s python" for three two slave labels fails with error:

Jake.Remitz@carlsonwagonlit.com (JIRA)

unread,
Oct 7, 2019, 2:54:02 PM10/7/19
to jenkinsc...@googlegroups.com
Jake Remitz updated an issue
- Bug JENKINS-37087 seems to imply that the kubernetes-plugin can support multiple pod labels, resulting in a jenkins slave having multiple labels. -  
I cannot seem to find documentation of this and any attempt at adding multiple labels such as "k8s python" for two slave labels fails with error:

Jake.Remitz@carlsonwagonlit.com (JIRA)

unread,
Oct 7, 2019, 2:59:02 PM10/7/19
to jenkinsc...@googlegroups.com
Jake Remitz updated an issue
- EDIT: This appears to be specific to the PodTemplate "Step" and not the global configuration.

Reply all
Reply to author
Forward
0 new messages