[JIRA] (JENKINS-57184) Kubernetes Plugin inversely applies NodeSelector

2 views
Skip to first unread message

darrienglasser@gmail.com (JIRA)

unread,
Apr 25, 2019, 10:17:03 AM4/25/19
to jenkinsc...@googlegroups.com
Darrien Glasser created an issue
 
Jenkins / Bug JENKINS-57184
Kubernetes Plugin inversely applies NodeSelector
Issue Type: Bug Bug
Assignee: Carlos Sanchez
Attachments: Screen Shot 2019-04-25 at 9.20.37 AM.png
Components: kubernetes-plugin
Created: 2019-04-25 14:16
Environment: Jenkins version 2.173
Host OS: CentOS 7
openjdk version "1.8.0_181"
Kubernetes Plugin version: 1.15.1
Kubernetes version: 1.13.2
Kubernetes nodes: Container Linux by CoreOS 1911.4.0 (Rhyolite)
Priority: Minor Minor
Reporter: Darrien Glasser

Adding a NodeSelector to slaves provisioned with the Kubernetes appears to apply an anti-affinity to that NodeSelector rather than actually using the NodeSelector.

We share our Kubernetes Cluster with Jenkins and a number of other projects. For our Jenkins slaves, we only want certain fast nodes, so they're labeled with `jenkins-slave=true` and our slow nodes do not have that corresponding label.

 

When configuring slaves in Jenkins, we applied the NodeSelector with the given label:

 

With the expectation it would only run on the fast nodes. But instead it only ran on the slow nodes without the label.

It seems like rather than apply a NodeSelector, it's applying the opposite of the NodeSelector (anti-affinity).

We can't do too much testing on our production instance of Jenkins, so for now we've just removed the NodeSelector and are letting Jenkins Slaves run everywhere, but this is very frustrating when a slave is scheduled on our slow nodes.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Apr 25, 2019, 10:47:03 AM4/25/19
to jenkinsc...@googlegroups.com
Carlos Sanchez commented on Bug JENKINS-57184
 
Re: Kubernetes Plugin inversely applies NodeSelector

I can't reproduce, the pod is created with this yaml

apiVersion: v1
kind: Pod
metadata:
  creationTimestamp: "2019-04-25T14:42:23Z"
  labels:
    jenkins: slave
    jenkins/node-selector-test: "true"
  name: node-selector-test-59d36
  namespace: jx
...
spec:
...
  nodeSelector:
    jenkins-slave: "true"
  priority: 0
  restartPolicy: Never
  schedulerName: default-scheduler
  securityContext: {}
  serviceAccount: default
  serviceAccountName: default
  terminationGracePeriodSeconds: 30
  tolerations:
  - effect: NoExecute
    key: node.kubernetes.io/not-ready
    operator: Exists
    tolerationSeconds: 300
  - effect: NoExecute
    key: node.kubernetes.io/unreachable
    operator: Exists
    tolerationSeconds: 300
status:
  conditions:
  - lastProbeTime: null
    lastTransitionTime: "2019-04-25T14:42:23Z"
    message: '0/1 nodes are available: 1 node(s) didn''t match node selector.'
    reason: Unschedulable
    status: "False"
    type: PodScheduled
  phase: Pending
  qosClass: BestEffort

jenkins-ci@carlossanchez.eu (JIRA)

unread,
Apr 25, 2019, 10:48:02 AM4/25/19
to jenkinsc...@googlegroups.com
Carlos Sanchez edited a comment on Bug JENKINS-57184
I can't reproduce, the pod is created with this yaml which is correct

{code}
{code}

jglick@cloudbees.com (JIRA)

unread,
Jul 16, 2019, 3:44:04 PM7/16/19
to jenkinsc...@googlegroups.com
Jesse Glick assigned an issue to Unassigned
 
Change By: Jesse Glick
Assignee: Carlos Sanchez
Reply all
Reply to author
Forward
0 new messages