Merge "Add `get_namespace` function to OpenstackBaseHelm"
This commit is contained in:
commit
7190f7fb50
|
@ -13,7 +13,7 @@ from k8sapp_openstack.common import constants as app_constants
|
|||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
class GarbdHelm(openstack.BaseHelm):
|
||||
class GarbdHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the galera arbitrator chart"""
|
||||
|
||||
# The service name is used to build the standard docker image location.
|
||||
|
|
|
@ -11,53 +11,16 @@ from k8sapp_openstack.common import constants as app_constants
|
|||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
class IngressHelm(openstack.BaseHelm):
|
||||
class IngressHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the ingress chart"""
|
||||
|
||||
CHART = app_constants.HELM_CHART_INGRESS
|
||||
HELM_RELEASE = app_constants.FLUXCD_HELMRELEASE_INGRESS
|
||||
|
||||
SUPPORTED_NAMESPACES = openstack.BaseHelm.SUPPORTED_NAMESPACES + [
|
||||
common.HELM_NS_KUBE_SYSTEM
|
||||
]
|
||||
SUPPORTED_APP_NAMESPACES = {
|
||||
app_constants.HELM_APP_OPENSTACK:
|
||||
openstack.BaseHelm.SUPPORTED_NAMESPACES + [common.HELM_NS_KUBE_SYSTEM]
|
||||
}
|
||||
|
||||
def get_overrides(self, namespace=None):
|
||||
limit_enabled, limit_cpus, limit_mem_mib = self._get_platform_res_limit()
|
||||
|
||||
overrides = {
|
||||
common.HELM_NS_KUBE_SYSTEM: {
|
||||
'pod': {
|
||||
'replicas': {
|
||||
'error_page': self._num_controllers()
|
||||
},
|
||||
'resources': {
|
||||
'enabled': limit_enabled,
|
||||
'ingress': {
|
||||
'limits': {
|
||||
'cpu': "%d000m" % (limit_cpus),
|
||||
'memory': "%dMi" % (limit_mem_mib)
|
||||
}
|
||||
},
|
||||
'error_pages': {
|
||||
'limits': {
|
||||
'cpu': "%d000m" % (limit_cpus),
|
||||
'memory': "%dMi" % (limit_mem_mib)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'deployment': {
|
||||
'mode': 'cluster',
|
||||
'type': 'DaemonSet'
|
||||
},
|
||||
'network': {
|
||||
'host_namespace': 'true'
|
||||
},
|
||||
},
|
||||
common.HELM_NS_OPENSTACK: {
|
||||
'conf': {
|
||||
'ingress': {
|
||||
|
|
|
@ -11,7 +11,7 @@ from k8sapp_openstack.common import constants as app_constants
|
|||
from k8sapp_openstack.helm import openstack
|
||||
|
||||
|
||||
class MemcachedHelm(openstack.BaseHelm):
|
||||
class MemcachedHelm(openstack.OpenstackBaseHelm):
|
||||
"""Class to encapsulate helm operations for the memcached chart"""
|
||||
|
||||
CHART = app_constants.HELM_CHART_MEMCACHED
|
||||
|
|
|
@ -65,6 +65,9 @@ class OpenstackBaseHelm(FluxCDBaseHelm):
|
|||
app_constants.HELM_CHART_KEYSTONE_API_PROXY,
|
||||
]
|
||||
|
||||
def get_namespaces(self):
|
||||
return self.SUPPORTED_NAMESPACES
|
||||
|
||||
def _get_service_config(self, service):
|
||||
configs = self.context.setdefault('_service_configs', {})
|
||||
if service not in configs:
|
||||
|
|
Loading…
Reference in New Issue