mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-13 21:25:09 +00:00
make minion registry not intolerably slow
This commit is contained in:
@@ -125,6 +125,7 @@ type Master struct {
|
||||
admissionControl admission.Interface
|
||||
masterCount int
|
||||
v1beta3 bool
|
||||
nodeIPCache IPGetter
|
||||
|
||||
readOnlyServer string
|
||||
readWriteServer string
|
||||
@@ -256,6 +257,7 @@ func New(c *Config) *Master {
|
||||
authorizer: c.Authorizer,
|
||||
admissionControl: c.AdmissionControl,
|
||||
v1beta3: c.EnableV1Beta3,
|
||||
nodeIPCache: NewIPCache(c.Cloud, util.RealClock{}, 30*time.Second),
|
||||
|
||||
masterCount: c.MasterCount,
|
||||
readOnlyServer: net.JoinHostPort(c.PublicAddress, strconv.Itoa(int(c.ReadOnlyPort))),
|
||||
@@ -319,8 +321,9 @@ func logStackOnRecover(panicReason interface{}, httpWriter http.ResponseWriter)
|
||||
|
||||
func makeMinionRegistry(c *Config) minion.Registry {
|
||||
var minionRegistry minion.Registry = etcd.NewRegistry(c.EtcdHelper, nil)
|
||||
// TODO: plumb in nodeIPCache here
|
||||
if c.HealthCheckMinions {
|
||||
minionRegistry = minion.NewHealthyRegistry(minionRegistry, c.KubeletClient)
|
||||
minionRegistry = minion.NewHealthyRegistry(minionRegistry, c.KubeletClient, util.RealClock{}, 20*time.Second)
|
||||
}
|
||||
return minionRegistry
|
||||
}
|
||||
@@ -331,9 +334,8 @@ func (m *Master) init(c *Config) {
|
||||
var authenticator = c.Authenticator
|
||||
|
||||
nodeRESTStorage := minion.NewREST(m.minionRegistry)
|
||||
ipCache := NewIPCache(c.Cloud, util.RealClock{}, 30*time.Second)
|
||||
podCache := NewPodCache(
|
||||
ipCache,
|
||||
m.nodeIPCache,
|
||||
c.KubeletClient,
|
||||
RESTStorageToNodes(nodeRESTStorage).Nodes(),
|
||||
m.podRegistry,
|
||||
|
Reference in New Issue
Block a user