• 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.
       

          [JENKINS-59690] Support multiple Pod/Slave labels

          Jake Remitz created issue -
          Jake Remitz made changes -
          Description Original: 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.
           
          New: 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 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 made changes -
          Description Original: 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 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.
           
          New: 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:
          {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 made changes -
          Description Original: 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:
          {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.
           
          New: -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:
          {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 made changes -
          Description Original: -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:
          {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.
           
          New: 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:
          {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.
           
          Dietmar Scheidl made changes -
          Assignee New: Dietmar Scheidl [ scddev ]
          Dietmar Scheidl made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Dietmar Scheidl added a comment - PR: https://github.com/jenkinsci/kubernetes-plugin/pull/818
          Dietmar Scheidl made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Dietmar Scheidl made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Fixed but Unreleased [ 10203 ]

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

              Created:
              Updated:
              Resolved: