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

Any change to Jenkins system config via UI incorrectly sets the namespace for the kubernetes-plugin

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • kubernetes-plugin
    • None
    • Kubernetes

      Not sure if this is kubernetes-plugin issue or the Jenkins UI however...

      I preload a Jenkins config.xml when jenkins starts which doesn't contain the kubernetes plugin <namespace> element so that the plugin will use the current namespace to create build pods.

      After making a change to any config vi the http://jenkins.example.io/configure UI the kubernetes plugin config now has a Namespace of 'default'.

      If Jenkins is not running in the default namespace (which most set ups will use custom namespaces) then the jenkins service account doesn't have the permissions to create a build pod in the default namespace resulting in a logs error of..

      io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: POST at: https://kubernetes.default/api/v1/namespaces/default/pods. Message: Forbidden!Configured service account doesn't have access. Service account may have been revoked

      I think there was a change to the plugin so that the current namespace is used to run build pods so I'm hoping the optional config via the UI can just be removed perhaps?

            Unassigned Unassigned
            jrawlings James Rawlings
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: