Use https only for the kubelet port
This commit is contained in:
@@ -37,6 +37,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/cloudprovider"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/master"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/tools"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
forked "github.com/GoogleCloudPlatform/kubernetes/third_party/forked/coreos/go-etcd/etcd"
|
forked "github.com/GoogleCloudPlatform/kubernetes/third_party/forked/coreos/go-etcd/etcd"
|
||||||
@@ -121,7 +122,7 @@ func NewAPIServer() *APIServer {
|
|||||||
|
|
||||||
RuntimeConfig: make(util.ConfigurationMap),
|
RuntimeConfig: make(util.ConfigurationMap),
|
||||||
KubeletConfig: client.KubeletConfig{
|
KubeletConfig: client.KubeletConfig{
|
||||||
Port: 10250,
|
Port: ports.KubeletPort,
|
||||||
EnableHttps: true,
|
EnableHttps: true,
|
||||||
HTTPTimeout: time.Duration(5) * time.Second,
|
HTTPTimeout: time.Duration(5) * time.Second,
|
||||||
},
|
},
|
||||||
|
@@ -29,6 +29,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/fields"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/master/ports"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
@@ -143,22 +144,20 @@ func ResourceLocation(getter ResourceGetter, connection client.ConnectionInfoGet
|
|||||||
node := nodeObj.(*api.Node)
|
node := nodeObj.(*api.Node)
|
||||||
host := node.Name // TODO: use node's IP, don't expect the name to resolve.
|
host := node.Name // TODO: use node's IP, don't expect the name to resolve.
|
||||||
|
|
||||||
scheme, port, transport, err := connection.GetConnectionInfo(host)
|
if portReq == "" || strconv.Itoa(ports.KubeletPort) == portReq {
|
||||||
if err != nil {
|
scheme, port, transport, err := connection.GetConnectionInfo(host)
|
||||||
return nil, nil, err
|
if err != nil {
|
||||||
|
return nil, nil, err
|
||||||
|
}
|
||||||
|
return &url.URL{
|
||||||
|
Scheme: scheme,
|
||||||
|
Host: net.JoinHostPort(
|
||||||
|
host,
|
||||||
|
strconv.FormatUint(uint64(port), 10),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
transport,
|
||||||
|
nil
|
||||||
}
|
}
|
||||||
|
return &url.URL{Host: net.JoinHostPort(host, portReq)}, nil, nil
|
||||||
if portReq != "" {
|
|
||||||
return &url.URL{Scheme: scheme, Host: net.JoinHostPort(host, portReq)}, transport, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
return &url.URL{
|
|
||||||
Scheme: scheme,
|
|
||||||
Host: net.JoinHostPort(
|
|
||||||
host,
|
|
||||||
strconv.FormatUint(uint64(port), 10),
|
|
||||||
),
|
|
||||||
},
|
|
||||||
transport,
|
|
||||||
nil
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user