d9e590bdc6
Added configuration parameter, temp_cache_dir, to magnum.conf with default value of "/var/lib/magnum/certificate-cache". This local directory will hold cached cluster TLS credentials that are generated during periodic tasks, to reduce load as the number of clusters increases. If the temp_cache_dir does not exist, the certificates will be created as tempfiles. Closes-Bug: #1659545 Change-Id: I8808c4098a7c8d22dbfc841142c9f9c8b976dde1
57 lines
2.3 KiB
Python
57 lines
2.3 KiB
Python
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
|
# use this file except in compliance with the License. You may obtain a copy
|
|
# of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
from oslo_config import cfg
|
|
|
|
from magnum.i18n import _
|
|
|
|
cluster_group = cfg.OptGroup(name='cluster',
|
|
title='Options for Cluster configuration')
|
|
|
|
cluster_def_opts = [
|
|
cfg.StrOpt('etcd_discovery_service_endpoint_format',
|
|
default='https://discovery.etcd.io/new?size=%(size)d',
|
|
help=_('Url for etcd public discovery endpoint.'),
|
|
deprecated_group='bay'),
|
|
cfg.ListOpt('enabled_definitions',
|
|
deprecated_for_removal=True,
|
|
deprecated_reason=_('This configuration option is no longer '
|
|
'used. Installing a new driver enables '
|
|
'it for use automatically.'),
|
|
default=['magnum_vm_atomic_k8s', 'magnum_bm_fedora_k8s',
|
|
'magnum_vm_coreos_k8s', 'magnum_vm_atomic_swarm',
|
|
'magnum_vm_ubuntu_mesos'],
|
|
help=_('Enabled cluster definition entry points.'),
|
|
deprecated_group='bay'),
|
|
cfg.StrOpt('nodes_affinity_policy',
|
|
default='soft-anti-affinity',
|
|
help=_('Affinity policy for server group of cluster nodes.'
|
|
'Possible values include "affinity", "anti-affinity",'
|
|
'"soft-affinity" and "soft-anti-affinity".')
|
|
),
|
|
cfg.StrOpt('temp_cache_dir',
|
|
default="/var/lib/magnum/certificate-cache",
|
|
help='Explicitly specify the temporary directory to hold '
|
|
'cached TLS certs.'),
|
|
]
|
|
|
|
|
|
def register_opts(conf):
|
|
conf.register_group(cluster_group)
|
|
conf.register_opts(cluster_def_opts, group=cluster_group)
|
|
|
|
|
|
def list_opts():
|
|
return {
|
|
cluster_group: cluster_def_opts
|
|
}
|