Commit 8e9df14d authored by Feilong Wang's avatar Feilong Wang
Browse files

[k8s] Support configurable health polling interval

The default 10 seconds health polling interval is too frequent for most of
the cases. Now it has been changed to 60s. A new config
`health_polling_interval` is added to make the interval configurable.
Cloud admin can totally disable the health polling by set a negative value
for the config.

Task: 39795
Story: 2007683

Change-Id: Iad30487b8c119e94ee21d75f53fb86eb23dff365
parent fdb21e09
......@@ -28,6 +28,11 @@ kubernetes_opts = [
'the Kubernetes cluster created. For exmaple, this '
'could be a file including the vendor specific '
'storage class.'),
cfg.IntOpt('health_polling_interval',
default=60,
help=('The default polling interval for Kubernetes cluster '
'health. If this number is negative the periodic task '
'will be disabled.')),
]
......
......@@ -152,7 +152,9 @@ class MagnumPeriodicTasks(periodic_task.PeriodicTasks):
super(MagnumPeriodicTasks, self).__init__(conf)
self.notifier = rpc.get_notifier()
@periodic_task.periodic_task(spacing=10, run_immediately=True)
@periodic_task.periodic_task(
spacing=CONF.kubernetes.health_polling_interval,
run_immediately=True)
@set_context
def sync_cluster_status(self, ctx):
try:
......
---
features:
- |
The default 10 seconds health polling interval is too frequent for most of
the cases. Now it has been changed to 60s. A new config
`health_polling_interval` is supported to make the interval configurable.
Cloud admin can totally disable the health polling by set a negative value
for the config.
upgrade:
- |
If it's still preferred to have 10s health polling interval for Kubernetes
cluster. It can be set by config `health_polling_interval` under
`kubernetes` section.
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment