mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 05:57:25 +00:00
Merge pull request #2956 from ddysher/fix-magic-number
Use constant for port number
This commit is contained in:
commit
4760b287f9
@ -38,6 +38,7 @@ import (
|
|||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/handlers"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/auth/handlers"
|
||||||
"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/ports"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/binding"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/binding"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/controller"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/endpoint"
|
||||||
@ -422,8 +423,8 @@ func (m *Master) InstallSwaggerAPI() {
|
|||||||
|
|
||||||
func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server {
|
func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server {
|
||||||
serversToValidate := map[string]apiserver.Server{
|
serversToValidate := map[string]apiserver.Server{
|
||||||
"controller-manager": {Addr: "127.0.0.1", Port: 10252, Path: "/healthz"},
|
"controller-manager": {Addr: "127.0.0.1", Port: ports.ControllerManagerPort, Path: "/healthz"},
|
||||||
"scheduler": {Addr: "127.0.0.1", Port: 10251, Path: "/healthz"},
|
"scheduler": {Addr: "127.0.0.1", Port: ports.SchedulerPort, Path: "/healthz"},
|
||||||
}
|
}
|
||||||
for ix, machine := range c.EtcdHelper.Client.GetCluster() {
|
for ix, machine := range c.EtcdHelper.Client.GetCluster() {
|
||||||
etcdUrl, err := url.Parse(machine)
|
etcdUrl, err := url.Parse(machine)
|
||||||
@ -452,7 +453,7 @@ func (m *Master) getServersToValidate(c *Config) map[string]apiserver.Server {
|
|||||||
glog.Errorf("Failed to list minions: %v", err)
|
glog.Errorf("Failed to list minions: %v", err)
|
||||||
}
|
}
|
||||||
for ix, node := range nodes.Items {
|
for ix, node := range nodes.Items {
|
||||||
serversToValidate[fmt.Sprintf("node-%d", ix)] = apiserver.Server{Addr: node.Name, Port: 10250, Path: "/healthz"}
|
serversToValidate[fmt.Sprintf("node-%d", ix)] = apiserver.Server{Addr: node.Name, Port: ports.KubeletPort, Path: "/healthz"}
|
||||||
}
|
}
|
||||||
return serversToValidate
|
return serversToValidate
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user