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

Pods are not terminating properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Critical Critical
    • kubernetes-plugin
    • None
    • Jenkins ver. 2.107.3
      kubernetes-plugin 1.12.2
      Kubernetes 1.8

      Recently i've upgraded the plugin to 1.12.2 and started to face issues with idle agents termination.

      It looks like when jenkins decides to remove the k8s agent (according to retention policy) it disconnects the computer, but leaves the pod as it is.
      Thats why after some time the pod ends up in "Error" state since connection to agent is broken.

      Corresponding logs here: 

      2018-09-05 21:42:58.121+0000 [id=212] INFO o.c.j.p.k.KubernetesSlave#_terminate: Terminating Kubernetes instance for agent test-r4q15
      2018-09-05 21:42:58.122+0000 [id=212] FINE o.c.j.p.k.KubernetesCloud#connect: Building connection to Kubernetes kubernetes URL  namespace nstest
      2018-09-05 21:42:58.124+0000 [id=212] FINE o.c.j.p.k.KubernetesFactoryAdapter#createClient: Configuring Kubernetes client from kubeconfig file
      2018-09-05 21:42:58.134+0000 [id=212] FINE o.c.j.p.k.KubernetesFactoryAdapter#createClient: Creating Kubernetes client: KubernetesFactoryAdapter [serviceAddress=, namespace=nstest, caCertData=null, credentials=org.jenkinsci.plugins.plaincredentials.impl.FileCredentialsImpl@123, skipTlsVerify=false, connectTimeout=0, readTimeout=0]
      2018-09-05 21:42:58.140+0000 [id=212] FINE o.c.j.p.k.KubernetesCloud#connect: Connected to Kubernetes kubernetes URL 

      From the code perspective it looks like nothing happens next to this line: https://github.com/jenkinsci/kubernetes-plugin/blob/kubernetes-1.12.2/src/main/java/org/csanchez/jenkins/plugins/kubernetes/KubernetesSlave.java#L245

            csanchez Carlos Sanchez
            fduch Alex Medvedev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: