Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59690

Support multiple Pod/Slave labels

XMLWordPrintable

    • kubernetes 1.27.0

      EDIT: This appears to be specific to the PodTemplate "Step" and not the global configuration.

      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:

      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.
       

            scddev Dietmar Scheidl
            jremitz Jake Remitz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: