Commit a6e7097d authored by Erik Wilson's avatar Erik Wilson

Ignore proxy settings for kubelet client

Proxy settings may interfere with a kubelet client communicating with the API server, so set the proxy to nil.
parent e3fd23df
...@@ -169,6 +169,7 @@ func CreateServerChain(completedOptions completedServerRunOptions, stopCh <-chan ...@@ -169,6 +169,7 @@ func CreateServerChain(completedOptions completedServerRunOptions, stopCh <-chan
if DefaultProxyDialerFn != nil { if DefaultProxyDialerFn != nil {
completedOptions.KubeletConfig.Dial = DefaultProxyDialerFn completedOptions.KubeletConfig.Dial = DefaultProxyDialerFn
completedOptions.KubeletConfig.Proxy = http.ProxyURL(nil)
} }
kubeAPIServerConfig, insecureServingInfo, serviceResolver, pluginInitializer, admissionPostStartHook, err := CreateKubeAPIServerConfig(completedOptions, proxyTransport) kubeAPIServerConfig, insecureServingInfo, serviceResolver, pluginInitializer, admissionPostStartHook, err := CreateKubeAPIServerConfig(completedOptions, proxyTransport)
......
...@@ -19,6 +19,7 @@ package client ...@@ -19,6 +19,7 @@ package client
import ( import (
"context" "context"
"net/http" "net/http"
"net/url"
"strconv" "strconv"
"time" "time"
...@@ -51,6 +52,9 @@ type KubeletClientConfig struct { ...@@ -51,6 +52,9 @@ type KubeletClientConfig struct {
// Dial is a custom dialer used for the client // Dial is a custom dialer used for the client
Dial utilnet.DialFunc Dial utilnet.DialFunc
// Proxy is a custom proxy function for the client
Proxy func(*http.Request) (*url.URL, error)
} }
// ConnectionInfo provides the information needed to connect to a kubelet // ConnectionInfo provides the information needed to connect to a kubelet
...@@ -77,6 +81,7 @@ func MakeTransport(config *KubeletClientConfig) (http.RoundTripper, error) { ...@@ -77,6 +81,7 @@ func MakeTransport(config *KubeletClientConfig) (http.RoundTripper, error) {
rt = utilnet.SetOldTransportDefaults(&http.Transport{ rt = utilnet.SetOldTransportDefaults(&http.Transport{
DialContext: config.Dial, DialContext: config.Dial,
TLSClientConfig: tlsConfig, TLSClientConfig: tlsConfig,
Proxy: config.Proxy,
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment