Merge "[k8s] Support configurable health polling interval"

This commit is contained in:
Zuul 2020-05-18 08:09:15 +00:00 committed by Gerrit Code Review
commit a6757e560d
3 changed files with 21 additions and 1 deletions

View File

@ -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.')),
]

View File

@ -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:

View File

@ -0,0 +1,13 @@
---
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.