Configure the master to connect to the kubelet using HTTPS.

This commit is contained in:
Robert Bailey
2015-03-31 14:25:45 -07:00
parent d0f48b68d8
commit 58bc792e68
7 changed files with 84 additions and 67 deletions

View File

@@ -75,9 +75,14 @@ type HTTPKubeletClient struct {
func NewKubeletClient(config *KubeletConfig) (KubeletClient, error) {
transport := http.DefaultTransport
tlsConfig, err := TLSConfigFor(&Config{
TLSClientConfig: config.TLSClientConfig,
})
cfg := &Config{TLSClientConfig: config.TLSClientConfig}
if config.EnableHttps {
hasCA := len(config.CAFile) > 0 || len(config.CAData) > 0
if !hasCA {
cfg.Insecure = true
}
}
tlsConfig, err := TLSConfigFor(cfg)
if err != nil {
return nil, err
}