diff --git a/sysinv/sysinv/sysinv/sysinv/common/constants.py b/sysinv/sysinv/sysinv/sysinv/common/constants.py index 91e0c8701a..7cf4e3cce0 100644 --- a/sysinv/sysinv/sysinv/sysinv/common/constants.py +++ b/sysinv/sysinv/sysinv/sysinv/common/constants.py @@ -1351,6 +1351,7 @@ SYSTEM_SECURITY_FEATURE_SPECTRE_MELTDOWN_DEFAULT_OPTS = SYSTEM_SECURITY_FEATURE_ # Helm: Supported charts: # These values match the names in the chart package's Chart.yaml +HELM_CHART_AODH = 'aodh' HELM_CHART_BARBICAN = 'barbican' HELM_CHART_CEILOMETER = 'ceilometer' HELM_CHART_CINDER = 'cinder' @@ -1375,6 +1376,7 @@ HELM_CHART_RABBITMQ = 'rabbitmq' HELM_CHART_RBD_PROVISIONER = 'rbd-provisioner' SUPPORTED_HELM_CHARTS = [ + HELM_CHART_AODH, HELM_CHART_BARBICAN, HELM_CHART_CEILOMETER, HELM_CHART_CINDER, @@ -1434,6 +1436,7 @@ SUPPORTED_HELM_APP_CHARTS = { HELM_CHART_GNOCCHI, HELM_CHART_CEILOMETER, HELM_CHART_PANKO, + HELM_CHART_AODH ], HELM_APP_OSHELM_DEVELOPER: [ HELM_CHART_INGRESS, diff --git a/sysinv/sysinv/sysinv/sysinv/helm/aodh.py b/sysinv/sysinv/sysinv/sysinv/helm/aodh.py new file mode 100644 index 0000000000..2b87c96656 --- /dev/null +++ b/sysinv/sysinv/sysinv/sysinv/helm/aodh.py @@ -0,0 +1,100 @@ +# +# Copyright (c) 2018 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# + +from sysinv.common import constants +from sysinv.common import exception +from sysinv.openstack.common import log as logging +from . import common +from . import openstack + +LOG = logging.getLogger(__name__) + + +class AodhHelm(openstack.OpenstackBaseHelm): + """Class to encapsulate helm operations for the aodh chart""" + + CHART = constants.HELM_CHART_AODH + SUPPORTED_NAMESPACES = [ + common.HELM_NS_OPENSTACK + ] + + SERVICE_NAME = 'aodh' + AUTH_USERS = ['aodh'] + + @property + def docker_repo_source(self): + return common.DOCKER_SRC_STX + + def get_namespaces(self): + return self.SUPPORTED_NAMESPACES + + def get_overrides(self, namespace=None): + overrides = { + common.HELM_NS_OPENSTACK: { + 'images': self._get_images_overrides(), + 'conf': self._get_conf_overrides(), + 'endpoints': self._get_endpoints_overrides() + } + } + + if namespace in self.SUPPORTED_NAMESPACES: + return overrides[namespace] + elif namespace: + raise exception.InvalidHelmNamespace(chart=self.CHART, + namespace=namespace) + else: + return overrides + + def _get_images_overrides(self): + heat_image = self._operator.chart_operators[ + constants.HELM_CHART_HEAT].docker_image + return { + 'tags': { + 'bootstrap': heat_image, + 'db_drop': heat_image, + 'db_init': self.docker_image, + 'aodh_api': self.docker_image, + 'aodh_alarms_cleaner': self.docker_image, + 'aodh_db_sync': self.docker_image, + 'aodh_evaluator': self.docker_image, + 'aodh_listener': self.docker_image, + 'aodh_notifier': self.docker_image, + 'ks_endpoints': heat_image, + 'ks_service': heat_image, + 'ks_user': heat_image, + } + } + + def _get_conf_overrides(self): + return { + 'aodh': { + 'service_credentials': { + 'region_name': self._region_name() + } + } + } + + def _get_endpoints_overrides(self): + return { + 'identity': { + 'auth': self._get_endpoints_identity_overrides( + self.SERVICE_NAME, self.AUTH_USERS), + }, + 'oslo_cache': { + 'auth': { + 'memcached_secret_key': + self._get_common_password('auth_memcache_key') + } + }, + 'oslo_db': { + 'auth': self._get_endpoints_oslo_db_overrides( + self.SERVICE_NAME, self.AUTH_USERS) + }, + 'oslo_messaging': { + 'auth': self._get_endpoints_oslo_messaging_overrides( + self.SERVICE_NAME, self.AUTH_USERS) + }, + } diff --git a/sysinv/sysinv/sysinv/sysinv/helm/helm.py b/sysinv/sysinv/sysinv/sysinv/helm/helm.py index 32a30d931b..4bb030d926 100644 --- a/sysinv/sysinv/sysinv/sysinv/helm/helm.py +++ b/sysinv/sysinv/sysinv/sysinv/helm/helm.py @@ -23,6 +23,7 @@ from . import common # Import Chart Override Helpers: # Chart source: https://github.com/openstack/openstack-helm.git +from . import aodh from . import barbican from . import ceilometer from . import cinder @@ -90,6 +91,7 @@ class HelmOperator(object): # register chart operators for lookup self.chart_operators = { + constants.HELM_CHART_AODH: aodh.AodhHelm(self), constants.HELM_CHART_BARBICAN: barbican.BarbicanHelm(self), constants.HELM_CHART_CEILOMETER: ceilometer.CeilometerHelm(self), constants.HELM_CHART_CINDER: cinder.CinderHelm(self),