71 lines
2.1 KiB
Python
71 lines
2.1 KiB
Python
#
|
|
# Copyright (c) 2019-2020 Wind River Systems, Inc.
|
|
#
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
#
|
|
|
|
from k8sapp_openstack.common import constants as app_constants
|
|
from k8sapp_openstack.helm import openstack
|
|
|
|
from sysinv.common import exception
|
|
from sysinv.helm import common
|
|
|
|
|
|
class PankoHelm(openstack.OpenstackBaseHelm):
|
|
"""Class to encapsulate helm operations for the panko chart"""
|
|
|
|
CHART = app_constants.HELM_CHART_PANKO
|
|
|
|
SERVICE_NAME = app_constants.HELM_CHART_PANKO
|
|
AUTH_USERS = ['panko']
|
|
|
|
def get_overrides(self, namespace=None):
|
|
overrides = {
|
|
common.HELM_NS_OPENSTACK: {
|
|
'pod': self._get_pod_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_pod_overrides(self):
|
|
overrides = {
|
|
'replicas': {
|
|
'api': self._num_controllers()
|
|
}
|
|
}
|
|
return overrides
|
|
|
|
def _get_endpoints_overrides(self):
|
|
return {
|
|
'identity': {
|
|
'auth':
|
|
self._get_endpoints_identity_overrides(
|
|
self.SERVICE_NAME, self.AUTH_USERS),
|
|
},
|
|
'event': {
|
|
'host_fqdn_override':
|
|
self._get_endpoints_host_fqdn_overrides(
|
|
self.SERVICE_NAME),
|
|
'port': self._get_endpoints_port_api_public_overrides(),
|
|
'scheme': self._get_endpoints_scheme_public_overrides(),
|
|
},
|
|
'oslo_db': {
|
|
'auth': self._get_endpoints_oslo_db_overrides(
|
|
self.SERVICE_NAME, self.AUTH_USERS)
|
|
},
|
|
'oslo_cache': {
|
|
'auth': {
|
|
'memcache_secret_key':
|
|
self._get_common_password('auth_memcache_key')
|
|
}
|
|
},
|
|
}
|