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

Kubernetes plugin keeps trying to build when quota reached

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • Jenkins 2.121.3
      kubernetes 1.12.6

      We use Jenkins to build containers in OpenShift (which offers a kubernetes API). However, we found that the Kubernetes plugin doesn't handle quota limits well. It keeps trying over and over again to build new containers without checking to see if the quota limit has been reached.

      io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://172.56.0.1/api/v1/namespaces/myproject/pods. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked. pods "mycontainer" is forbidden: exceeded quota: myproject-quota, requested: limits.cpu=8, used: limits.cpu=64, limited: limits.cpu=64.
      
      

      I would like to see the plugin do something like this:

      1. Plugin checks the current quota usage
      2. If the quota has been reached, sleep for a configurable amount of time
      3. Check the quota again
      4. Repeat steps 2 and 3 until there is room within the quota to build the container
      5. Request the new container via kubernetes API

            Unassigned Unassigned
            mhayden Major Hayden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: