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

Kubernetes plugin does not respect 'no_proxy' configurations when calling Kubernetes API

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Blocker Blocker
    • kubernetes-plugin
    • None

      Kubernetes plugin does not respect 'no_proxy' Java property, Environment Variable or Jenkins Proxy config from 'Jenkins->Manage Jenkins->Manage Plugins->Advanced Tab'.

       

      I have confirmed Kubernetes API access works from the console of the Jenkins server via 'curl' with appropriate proxy environment variables set.

       

      I have used the 'Validate Proxy' button from the 'Jenkins->Manage Jenkins->Manage Plugins->Advanced Tab' I get ' Failed to connect to https://xxxxxxxxxxxxxx.

      javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated' and confirmed the request never hits the proxy using proxy logs.

       

      If I configure the Kubernetes plugin slaves never start and if I use the 'Test Connection' button in the plugin config I get 'Error testing connection https://xxxxxxxxxxxxxx: java.io.IOException: Unexpected response code for CONNECT: 403' and have confirmed the request does hit the proxy using proxy logs.

       

          [JENKINS-55123] Kubernetes plugin does not respect 'no_proxy' configurations when calling Kubernetes API

          Dax Games created issue -
          Dax Games made changes -
          Summary Original: Kubernetes plugin does not respect 'no_proxy' environment variable. New: Kubernetes plugin does not respect 'no_proxy' configurations

          Dax Games added a comment -

          Any word on this?

          Dax Games added a comment - Any word on this?

          Viktor K added a comment -

          I have exactly the same problem..Could you please let us know what is the problem here?

          Viktor K added a comment - I have exactly the same problem..Could you please let us know what is the problem here?

          Steve Collins added a comment - - edited

          I also have this problem when the docker image has 'no_proxy' set in the image.

          I had to remove the no_proxy env var from the image to be able to set no_proxy using Env/Node/etc properties.

          This was not a good workaround as it pushed proxy info back to the user (100's of Jenkins) and not able to use as we hope in other contexts outside of Jenkins without passing in no_proxy env var.

          thanks. Plugin is really great!

           

          Steve Collins added a comment - - edited I also have this problem when the docker image has 'no_proxy' set in the image. I had to remove the no_proxy env var from the image to be able to set no_proxy using Env/Node/etc properties. This was not a good workaround as it pushed proxy info back to the user (100's of Jenkins) and not able to use as we hope in other contexts outside of Jenkins without passing in no_proxy env var. thanks. Plugin is really great!  
          Dax Games made changes -
          Summary Original: Kubernetes plugin does not respect 'no_proxy' configurations New: Kubernetes plugin does not respect 'no_proxy' configurations when calling Kubernetes API

          Dax Games added a comment -

          I found this code that passes the master env vars related to proxy settings to the slave.

          The problem is the pod never starts because the plugin can't talk to the Kubernetes API because it ignores the no_proxy settings.

          Dax Games added a comment - I found this code that passes the master env vars related to proxy settings to the slave. The problem is the pod never starts because the plugin can't talk to the Kubernetes API because it ignores the no_proxy settings.
          Dax Games made changes -
          Comment [ Carlos/Plugin Maintainers,

          Can we have a way to pass proxy and no_proxy settings from the Jenkins master to the Kubernetes slave?

          Thanks. ]

          If you are talking about the communication between Jenkins and Kubernetes API the following system properties are used to configure proxy

          • http.proxy
          • https.proxy
          • no.proxy
          • proxy.username
          • proxy.password

          https://github.com/fabric8io/kubernetes-client/blob/9e850ad769134566e32f8c41498e5e64ecf8b799/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java#L106

          You can see a test that is passing here https://github.com/jenkinsci/kubernetes-plugin/pull/477

          Carlos Sanchez added a comment - If you are talking about the communication between Jenkins and Kubernetes API the following system properties are used to configure proxy http.proxy https.proxy no.proxy proxy.username proxy.password https://github.com/fabric8io/kubernetes-client/blob/9e850ad769134566e32f8c41498e5e64ecf8b799/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/Config.java#L106 You can see a test that is passing here https://github.com/jenkinsci/kubernetes-plugin/pull/477
          Carlos Sanchez made changes -
          Remote Link New: This issue links to "PR-477 (Web Link)" [ 22761 ]

            Unassigned Unassigned
            daxgames Dax Games
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: