diff --git a/kubernetes/helm-charts/rbd-provisioner/templates/pre-install-check-ceph.yaml b/kubernetes/helm-charts/rbd-provisioner/templates/pre-install-check-ceph.yaml index 2b56dd4096..ec986b7006 100644 --- a/kubernetes/helm-charts/rbd-provisioner/templates/pre-install-check-ceph.yaml +++ b/kubernetes/helm-charts/rbd-provisioner/templates/pre-install-check-ceph.yaml @@ -190,6 +190,10 @@ spec: - name: config-volume-{{- $root.Values.global.name }} mountPath: {{ $mount }} {{- end }} + {{- if .Values.global.nodeSelector }} + nodeSelector: + {{ .Values.global.nodeSelector | toYaml | trim | indent 8 }} + {{- end }} --- # This ConfigMap is needed because we're not using ceph's helm chart diff --git a/kubernetes/platform/stx-platform/stx-platform-helm/centos/build_srpm.data b/kubernetes/platform/stx-platform/stx-platform-helm/centos/build_srpm.data index 4d187b79d7..19144e2dbf 100644 --- a/kubernetes/platform/stx-platform/stx-platform-helm/centos/build_srpm.data +++ b/kubernetes/platform/stx-platform/stx-platform-helm/centos/build_srpm.data @@ -5,4 +5,4 @@ $PKG_BASE/../../../helm-charts/node-feature-discovery \ $PKG_BASE/../../../helm-charts/rbd-provisioner \ $PKG_BASE/../../../helm-charts/ceph-pools-audit" -TIS_PATCH_VER=5 +TIS_PATCH_VER=6 diff --git a/sysinv/sysinv/centos/build_srpm.data b/sysinv/sysinv/centos/build_srpm.data index 16ac3ca174..87b367a3a8 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=319 +TIS_PATCH_VER=320 diff --git a/sysinv/sysinv/sysinv/sysinv/db/api.py b/sysinv/sysinv/sysinv/sysinv/db/api.py index fedbc67819..f6cbd1cfc4 100644 --- a/sysinv/sysinv/sysinv/sysinv/db/api.py +++ b/sysinv/sysinv/sysinv/sysinv/db/api.py @@ -192,6 +192,16 @@ class Connection(object): returns: A server """ + @abc.abstractmethod + def count_hosts_by_personality(self, personality): + """Return the number of hosts for a provided personality. + + :param personality: The personality of the server + e.g. controller or worker + returns: The number of hosts matching the personality + parameter. + """ + @abc.abstractmethod def ihost_update(self, server, values): """Update properties of a server. diff --git a/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/api.py b/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/api.py index 662946e11b..932afc32fd 100644 --- a/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/api.py +++ b/sysinv/sysinv/sysinv/sysinv/db/sqlalchemy/api.py @@ -1279,6 +1279,12 @@ class Connection(api.Connection): return _paginate_query(models.ihost, limit, marker, sort_key, sort_dir, query) + def count_hosts_by_personality(self, personality): + query = model_query(models.ihost) + query = add_host_options(query) + query = query.filter_by(personality=personality, recordtype="standard") + return query.count() + @objects.objectify(objects.host) def ihost_get_by_function(self, function, limit=None, marker=None, diff --git a/sysinv/sysinv/sysinv/sysinv/helm/base.py b/sysinv/sysinv/sysinv/sysinv/helm/base.py index 2d24200017..1d69d50f5c 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/base.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/base.py @@ -137,6 +137,10 @@ class BaseHelm(object): def _num_computes(self): return self._count_hosts_by_label(common.LABEL_COMPUTE) + def _num_controllers_by_personality(self): + return int(self.dbapi.count_hosts_by_personality( + constants.CONTROLLER)) + def _get_address_by_name(self, name, networktype): """ Retrieve an address entry by name and scoped by network type diff --git a/sysinv/sysinv/sysinv/sysinv/helm/rbd_provisioner.py b/sysinv/sysinv/sysinv/sysinv/helm/rbd_provisioner.py index a396b34bd1..3a8b014241 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/rbd_provisioner.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/rbd_provisioner.py @@ -71,7 +71,7 @@ class RbdProvisionerHelm(base.BaseHelm): classes.append(cls) global_settings = { - "replicas": self._num_controllers(), + "replicas": self._num_controllers_by_personality(), "defaultStorageClass": constants.K8S_RBD_PROV_STOR_CLASS_NAME }