Add the SSHTunnel transport to the kubelet client.

This commit is contained in:
Brendan Burns
2015-05-29 15:33:22 -07:00
committed by CJ Cullen
parent de9a5f43bc
commit 7ea533d871
6 changed files with 43 additions and 8 deletions

View File

@@ -506,6 +506,21 @@ func (m *Master) init(c *Config) {
}
m.setupSecureProxy(c.SSHUser, c.SSHKeyfile)
proxyDialer = m.Dial
// This is pretty ugly. A better solution would be to pull this all the way up into the
// server.go file.
httpKubeletClient, ok := c.KubeletClient.(*client.HTTPKubeletClient)
if ok {
httpKubeletClient.Config.Dial = m.Dial
transport, err := client.MakeTransport(httpKubeletClient.Config)
if err != nil {
glog.Errorf("Error setting up transport over SSH: %v", err)
} else {
httpKubeletClient.Client.Transport = transport
}
} else {
glog.Errorf("Failed to cast %v to HTTPKubeletClient, skipping SSH tunnel.")
}
}
apiVersions := []string{}