diff --git a/puppet-manifests/centos/build_srpm.data b/puppet-manifests/centos/build_srpm.data index 0fe7d7a4e4..9eec371b56 100644 --- a/puppet-manifests/centos/build_srpm.data +++ b/puppet-manifests/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="src" -TIS_PATCH_VER=90 +TIS_PATCH_VER=91 diff --git a/puppet-manifests/src/manifests/ansible_bootstrap.pp b/puppet-manifests/src/manifests/ansible_bootstrap.pp index e3799b3e3c..fc282b5585 100644 --- a/puppet-manifests/src/manifests/ansible_bootstrap.pp +++ b/puppet-manifests/src/manifests/ansible_bootstrap.pp @@ -27,5 +27,6 @@ include ::platform::etcd::bootstrap # Puppet classes to enable initial controller unlock include ::platform::drbd::dockerdistribution::bootstrap include ::platform::filesystem::backup +include ::platform::filesystem::kubelet include ::platform::mtce::bootstrap include ::platform::fm::bootstrap diff --git a/puppet-manifests/src/modules/platform/manifests/filesystem.pp b/puppet-manifests/src/modules/platform/manifests/filesystem.pp index a324ae8244..f03abedd06 100644 --- a/puppet-manifests/src/modules/platform/manifests/filesystem.pp +++ b/puppet-manifests/src/modules/platform/manifests/filesystem.pp @@ -144,6 +144,26 @@ class platform::filesystem::scratch } } +class platform::filesystem::kubelet::params ( + $lv_size = '10', + $lv_name = 'kubelet-lv', + $mountpoint = '/var/lib/kubelet', + $devmapper = '/dev/mapper/cgts--vg-kubelet--lv', + $fs_type = 'ext4', + $fs_options = ' ' +) { } + +class platform::filesystem::kubelet + inherits ::platform::filesystem::kubelet::params { + + platform::filesystem { $lv_name: + lv_name => $lv_name, + lv_size => $lv_size, + mountpoint => $mountpoint, + fs_type => $fs_type, + fs_options => $fs_options + } +} class platform::filesystem::docker::params ( $lv_size = '1', @@ -169,8 +189,8 @@ class platform::filesystem::docker } } - class platform::filesystem::storage { + include ::platform::filesystem::kubelet class {'platform::filesystem::docker::params' : lv_size => 30 @@ -178,25 +198,26 @@ class platform::filesystem::storage { -> class {'platform::filesystem::docker' : } - Class['::platform::lvm::vg::cgts_vg'] -> Class['::platform::filesystem::docker'] + Class['::platform::lvm::vg::cgts_vg'] -> Class[$name] } class platform::filesystem::compute { - + include ::platform::filesystem::kubelet class {'platform::filesystem::docker::params' : lv_size => 30 } -> class {'platform::filesystem::docker' : } - Class['::platform::lvm::vg::cgts_vg'] -> Class['::platform::filesystem::docker'] + Class['::platform::lvm::vg::cgts_vg'] -> Class[$name] } class platform::filesystem::controller { include ::platform::filesystem::backup include ::platform::filesystem::scratch include ::platform::filesystem::docker + include ::platform::filesystem::kubelet } @@ -229,6 +250,20 @@ class platform::filesystem::scratch::runtime { } } +class platform::filesystem::kubelet::runtime { + + include ::platform::filesystem::kubelet::params + $lv_name = $::platform::filesystem::kubelet::params::lv_name + $lv_size = $::platform::filesystem::kubelet::params::lv_size + $devmapper = $::platform::filesystem::kubelet::params::devmapper + + platform::filesystem::resize { $lv_name: + lv_name => $lv_name, + lv_size => $lv_size, + devmapper => $devmapper, + } +} + class platform::filesystem::docker::runtime { diff --git a/sysinv/sysinv/centos/build_srpm.data b/sysinv/sysinv/centos/build_srpm.data index 7a7e856847..58cf8cfec2 100644 --- a/sysinv/sysinv/centos/build_srpm.data +++ b/sysinv/sysinv/centos/build_srpm.data @@ -1,2 +1,2 @@ SRC_DIR="sysinv" -TIS_PATCH_VER=327 +TIS_PATCH_VER=328 diff --git a/sysinv/sysinv/sysinv/sysinv/agent/manager.py b/sysinv/sysinv/sysinv/sysinv/agent/manager.py index 2249f182b8..47ee23ad31 100644 --- a/sysinv/sysinv/sysinv/sysinv/agent/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/agent/manager.py @@ -1298,6 +1298,17 @@ class AgentManager(service.PeriodicService): } filesystems.append(data) + # check if the kubelet fs is supported for current host + if utils.is_filesystem_supported(constants.FILESYSTEM_NAME_KUBELET, + self._ihost_personality): + data = { + 'name': constants.FILESYSTEM_NAME_KUBELET, + 'size': constants.KUBELET_STOR_SIZE, + 'logical_volume': constants.FILESYSTEM_LV_DICT[ + constants.FILESYSTEM_NAME_KUBELET] + } + filesystems.append(data) + if filesystems: # Create the filesystems if they do not already exist. # This audit does not check if the fs size has changed. diff --git a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/host_fs.py b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/host_fs.py index 41e281f81e..29eb698492 100644 --- a/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/host_fs.py +++ b/sysinv/sysinv/sysinv/sysinv/api/controllers/v1/host_fs.py @@ -274,6 +274,10 @@ class HostFsController(rest.RestController): modified_fs += [fs_name] + if not modified_fs: + msg = _("HostFs update failed: no filesystems to update") + raise wsme.exc.ClientSideError(msg) + host_fs_list_new = [] for fs in current_host_fs_list: replaced = False @@ -298,28 +302,30 @@ class HostFsController(rest.RestController): LOG.info("Requested growth in GiB: %s" % requested_growth_gib) - if utils.is_host_state_valid_for_fs_resize(host): - cgtsvg_free_space_gib = utils.get_node_cgtsvg_limit(host) + cgtsvg_free_space_gib = utils.get_node_cgtsvg_limit(host) - if requested_growth_gib > cgtsvg_free_space_gib: - msg = _("HostFs update failed: Not enough free space on %s. " - "Current free space %s GiB, " - "requested total increase %s GiB" % - (constants.LVG_CGTS_VG, cgtsvg_free_space_gib, requested_growth_gib)) - LOG.warning(msg) - raise wsme.exc.ClientSideError(msg) + if requested_growth_gib > cgtsvg_free_space_gib: + msg = _("HostFs update failed: Not enough free space on %s. " + "Current free space %s GiB, " + "requested total increase %s GiB" % + (constants.LVG_CGTS_VG, cgtsvg_free_space_gib, requested_growth_gib)) + LOG.warning(msg) + raise wsme.exc.ClientSideError(msg) - for fs in host_fs_list_new: - if fs.name in modified_fs: - value = {'size': fs.size} - pecan.request.dbapi.host_fs_update(fs.uuid, value) + for fs in host_fs_list_new: + if fs.name in modified_fs: + value = {'size': fs.size} + pecan.request.dbapi.host_fs_update(fs.uuid, value) try: - # perform rpc to conductor to perform config apply - pecan.request.rpcapi.update_host_filesystem_config( - pecan.request.context, - host=host, - filesystem_list=modified_fs,) + if (host.invprovision in [constants.PROVISIONED, + constants.PROVISIONING]): + + # perform rpc to conductor to perform config apply + pecan.request.rpcapi.update_host_filesystem_config( + pecan.request.context, + host=host, + filesystem_list=modified_fs,) except Exception as e: msg = _("Failed to update filesystem size for %s" % host.name) diff --git a/sysinv/sysinv/sysinv/sysinv/common/constants.py b/sysinv/sysinv/sysinv/sysinv/common/constants.py index bc23793e31..c907f8b405 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/constants.py +++ b/sysinv/sysinv/sysinv/sysinv/common/constants.py @@ -319,10 +319,10 @@ DEFAULT_SMALL_DISK_SIZE = 240 # 186 MINIMUM_DISK_SIZE = 186 -# Docker lv size when Kubernetes is configured KUBERNETES_DOCKER_STOR_SIZE = 30 DOCKER_DISTRIBUTION_STOR_SIZE = 16 ETCD_STOR_SIZE = 5 +KUBELET_STOR_SIZE = 10 # Openstack Interface names OS_INTERFACE_PUBLIC = 'public' @@ -506,6 +506,7 @@ FILESYSTEM_NAME_DOCKER_DISTRIBUTION = 'docker-distribution' FILESYSTEM_NAME_EXTENSION = 'extension' FILESYSTEM_NAME_ETCD = 'etcd' FILESYSTEM_NAME_PATCH_VAULT = 'patch-vault' +FILESYSTEM_NAME_KUBELET = 'kubelet' FILESYSTEM_LV_DICT = { FILESYSTEM_NAME_CGCS: 'cgcs-lv', @@ -517,20 +518,26 @@ FILESYSTEM_LV_DICT = { FILESYSTEM_NAME_EXTENSION: 'extension-lv', FILESYSTEM_NAME_ETCD: 'etcd-lv', FILESYSTEM_NAME_PATCH_VAULT: 'patch-vault-lv', + FILESYSTEM_NAME_KUBELET: 'kubelet-lv', } FILESYSTEM_CONTROLLER_SUPPORTED_LIST = [ FILESYSTEM_NAME_SCRATCH, FILESYSTEM_NAME_BACKUP, FILESYSTEM_NAME_DOCKER, + FILESYSTEM_NAME_KUBELET, ] FILESYSTEM_WORKER_SUPPORTED_LIST = [ FILESYSTEM_NAME_DOCKER, + FILESYSTEM_NAME_KUBELET, + FILESYSTEM_NAME_SCRATCH, ] FILESYSTEM_STORAGE_SUPPORTED_LIST = [ FILESYSTEM_NAME_DOCKER, + FILESYSTEM_NAME_KUBELET, + FILESYSTEM_NAME_SCRATCH, ] FILESYSTEM_HOSTS_SUPPORTED_LIST_DICT = { diff --git a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py index 3b4d9191a1..21f36510e9 100644 --- a/sysinv/sysinv/sysinv/sysinv/conductor/manager.py +++ b/sysinv/sysinv/sysinv/sysinv/conductor/manager.py @@ -5504,10 +5504,6 @@ class ConductorManager(service.PeriodicService): LOG.info("update_host_filesystem_config config_uuid=%s" % config_uuid) if filesystem_list: - # apply the manifest at runtime, otherwise a reboot is required - if os.path.isfile(CONFIG_CONTROLLER_FINI_FLAG): - os.remove(CONFIG_CONTROLLER_FINI_FLAG) - # map the updated file system to the runtime puppet class classmap = { constants.FILESYSTEM_NAME_BACKUP: @@ -5516,11 +5512,11 @@ class ConductorManager(service.PeriodicService): 'platform::filesystem::scratch::runtime', constants.FILESYSTEM_NAME_DOCKER: 'platform::filesystem::docker::runtime', + constants.FILESYSTEM_NAME_KUBELET: + 'platform::filesystem::kubelet::runtime', } - puppet_class = None - if filesystem_list: - puppet_class = [classmap.get(fs) for fs in filesystem_list] + puppet_class = [classmap.get(fs) for fs in filesystem_list] config_dict = { "personalities": host.personality, "classes": puppet_class, diff --git a/sysinv/sysinv/sysinv/sysinv/puppet/storage.py b/sysinv/sysinv/sysinv/sysinv/puppet/storage.py index 97ce017534..6d45cda9cc 100644 --- a/sysinv/sysinv/sysinv/sysinv/puppet/storage.py +++ b/sysinv/sysinv/sysinv/sysinv/puppet/storage.py @@ -248,5 +248,8 @@ class StoragePuppet(base.BasePuppet): config.update({ 'platform::filesystem::docker::params::lv_size': fs.size }) - + elif fs.name == constants.FILESYSTEM_NAME_KUBELET: + config.update({ + 'platform::filesystem::kubelet::params::lv_size': fs.size + }) return config