[fedora atomic k8s] Add boot from volume support
Support boot from volume for Kubernetes all nodes (master and worker) so that user can create a big size root volume, which could be more flexible than using docker_volume_size. And user can specify the volume type so that user can leverage high performance storage, e.g. NVMe etc. And a new label etcd_volme_type is added as well so that user can set volume type for etcd volume. If the boot_volume_type or etcd_volume_type are not passed by labels, Magnum will try to read them from config option default_boot_volume_type and default_etcd_volume_type. A random volume type from Cinder will be used if those options are not set. Task: 30374 Story: 2005386 Co-Authorized-By: Feilong Wang<flwang@catalyst.net.nz> Change-Id: I39dd456bfa285bf06dd948d11c86867fc03d5afbchanges/34/621734/23
parent
41768e0ae1
commit
cfe2753fd3
@ -0,0 +1,46 @@
|
||||
# Copyright 2019 Catalyst Cloud Ltd.
|
||||
#
|
||||
# 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 oslo_log import log as logging
|
||||
|
||||
from magnum.common import clients
|
||||
from magnum.common import exception
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
CONF = cfg.CONF
|
||||
|
||||
|
||||
def get_default_docker_volume_type(context):
|
||||
return (CONF.cinder.default_docker_volume_type or
|
||||
_get_random_volume_type(context))
|
||||
|
||||
|
||||
def get_default_boot_volume_type(context):
|
||||
return (CONF.cinder.default_boot_volume_type or
|
||||
_get_random_volume_type(context))
|
||||
|
||||
|
||||
def get_default_etcd_volume_type(context):
|
||||
return (CONF.cinder.default_etcd_volume_type or
|
||||
_get_random_volume_type(context))
|
||||
|
||||
|
||||
def _get_random_volume_type(context):
|
||||
c_client = clients.OpenStackClients(context).cinder()
|
||||
volume_types = c_client.volume_types.list()
|
||||
if volume_types:
|
||||
return volume_types[0].name
|
||||
else:
|
||||
raise exception.VolumeTypeNotFound()
|
@ -0,0 +1,13 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
Support boot from volume for Kubernetes all nodes (master and worker)
|
||||
so that user can create a big size root volume, which could be more
|
||||
flexible than using docker_volume_size. And user can specify the
|
||||
volume type so that user can leverage high performance storage, e.g.
|
||||
NVMe etc. And a new label etcd_volme_type is added as well so that
|
||||
user can set volume type for etcd volume. If the boot_volume_type
|
||||
or etcd_volume_type are not passed by labels, Magnum will try to
|
||||
read them from config option default_boot_volume_type and
|
||||
default_etcd_volume_type. A random volume type from Cinder will
|
||||
be used if those options are not set.
|
Loading…
Reference in New Issue