mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Add node sync period flag
This commit is contained in:
parent
6db42eda4e
commit
c263a79d3e
@ -49,6 +49,9 @@ var (
|
|||||||
cloudProvider = flag.String("cloud_provider", "", "The provider for cloud services. Empty string for no provider.")
|
cloudProvider = flag.String("cloud_provider", "", "The provider for cloud services. Empty string for no provider.")
|
||||||
cloudConfigFile = flag.String("cloud_config", "", "The path to the cloud provider configuration file. Empty string for no configuration file.")
|
cloudConfigFile = flag.String("cloud_config", "", "The path to the cloud provider configuration file. Empty string for no configuration file.")
|
||||||
minionRegexp = flag.String("minion_regexp", "", "If non empty, and -cloud_provider is specified, a regular expression for matching minion VMs.")
|
minionRegexp = flag.String("minion_regexp", "", "If non empty, and -cloud_provider is specified, a regular expression for matching minion VMs.")
|
||||||
|
nodeSyncPeriod = flag.Duration("node_sync_period", 10*time.Second, ""+
|
||||||
|
"The period for syncing nodes from cloudprovider. Longer periods will result in "+
|
||||||
|
"fewer calls to cloud provider, but may delay addition of new nodes to cluster.")
|
||||||
machineList util.StringList
|
machineList util.StringList
|
||||||
// TODO: Discover these by pinging the host machines, and rip out these flags.
|
// TODO: Discover these by pinging the host machines, and rip out these flags.
|
||||||
// TODO: in the meantime, use resource.QuantityFlag() instead of these
|
// TODO: in the meantime, use resource.QuantityFlag() instead of these
|
||||||
@ -107,7 +110,7 @@ func main() {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
nodeController := nodeControllerPkg.NewNodeController(cloud, *minionRegexp, machineList, nodeResources, kubeClient)
|
nodeController := nodeControllerPkg.NewNodeController(cloud, *minionRegexp, machineList, nodeResources, kubeClient)
|
||||||
nodeController.Run(10 * time.Second)
|
nodeController.Run(*nodeSyncPeriod)
|
||||||
|
|
||||||
select {}
|
select {}
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,9 @@ The kube-controller-manager has several options.
|
|||||||
**--master**=""
|
**--master**=""
|
||||||
The address of the Kubernetes API server.
|
The address of the Kubernetes API server.
|
||||||
|
|
||||||
|
**--node_sync_peroid**=10s
|
||||||
|
The period for syncing nodes from cloudprovider.
|
||||||
|
|
||||||
**--port**=10252
|
**--port**=10252
|
||||||
The port that the controller-manager's http service runs on.
|
The port that the controller-manager's http service runs on.
|
||||||
|
|
||||||
|
@ -58,7 +58,8 @@ objects. It performs two major functions: cluster-wide node synchronization
|
|||||||
and single node life-cycle management.
|
and single node life-cycle management.
|
||||||
|
|
||||||
Node controller has a sync loop that creates/deletes `Node`s from Kubernetes
|
Node controller has a sync loop that creates/deletes `Node`s from Kubernetes
|
||||||
based on all matching VM instances listed from cloud provider. If a new instance
|
based on all matching VM instances listed from cloud provider. The sync period
|
||||||
|
can be controlled via flag "--node_sync_period". If a new instance
|
||||||
gets created, Node Controller creates a representation for it. If an existing
|
gets created, Node Controller creates a representation for it. If an existing
|
||||||
instance gets deleted, Node Controller deletes the representation. Note however,
|
instance gets deleted, Node Controller deletes the representation. Note however,
|
||||||
Node Controller is unable to provision the node for you, i.e. it won't install
|
Node Controller is unable to provision the node for you, i.e. it won't install
|
||||||
|
Loading…
Reference in New Issue
Block a user