Hi, As far as I understood you're using Jenkins Kubernetes plugin and you have your own Kubernetes cluster with a few physical nodes connected to it. In that case you should label your Kubernetes nodes like this (assuming you have working kubectl setup): kubectl label node node1.example.com hw_type=type1
kubectl label node node2.example.com hw_type=type2 Then you should specify label you need in podTemplate section of your Jenkins pipeline (I slightly changed code from examples folder in Kubernetes plugin repo - https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/maven.groovy) podTemplate(nodeSelector: 'hw_type=type1', containers: [ containerTemplate(name: 'maven', image: 'maven:3.3.9-jdk-8-alpine', ttyEnabled: true, command: 'cat', ) ]) { node(POD_LABEL) { stage('Tests on hardware type 1') { git 'https://github.com/jenkinsci/kubernetes-plugin.git' container('maven') { sh 'mvn -B clean package' } } } } On Monday, January 20, 2020 at 9:19:00 AM UTC+3, touseef wrote: > > Can anyone point me in right direction, > > I have a use case as follow: > > Kubernetes master running the jenkins and i have n number of physical > machine connected with different hardwares,So what i want to achieve is > when a specific job is triggered in jenkins to execute a test on hardware , > k8's(kubernetes master) should route and connect to that machine in a pool > which has requiste hardware and execute the tests. > > Any pointer how to achieve is appreciated > -- You received this message because you are subscribed to the Google Groups "Jenkins Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e8069c44-fab0-44b0-8708-d453d31724ad%40googlegroups.com.
