8243f7d6ab
Mirror the current infrastructure that we use for puppet based provisioning of openstack services to enable system specific helm overrides. This commit comprises the backend to the sysinv API helm commands that allow a customer to update the system provided overrides or introduce new overrides for specific charts. Four conductor RPC functions are provided to the API to gather system overrides and namespaces for supported charts and chart bundles (i.e. an application): - get_helm_chart_namespaces() - get_helm_chart_overrides() - get_helm_application_overrides() - get_helm_application_namespaces() An application in this context is a set of supported charts that we would deploy to support some specific functionality (i.e. a customized openstack solution) As with the puppet infrastructure, a CLI is provided to get the latest system-only overrides for a given chart or bundle of charts that make up an application. This is provided for development purposes and removes user-provided overrides from the picture. The following is the chart command syntax, a command to generate override files for all supported namespaces of the ingress chart, and a command to generate overrides for just the openstack namespace of the ingress chart: - sysinv-helm create-chart-overrides <path> <chart> <specific namespace> - sysinv-helm create-chart-overrides /root/overrides ingress - sysinv-helm create-chart-overrides /root/overrides ingress openstack The following is the application command syntax, a command to generate override files for all supported namespaces of the all chart in the chart bundle, and a command to generate overrides for all charts in the chart bundle that support the kube-system namespace: - sysinv-helm create-app-overrides <path> <app> <specific namespace> - sysinv-helm create-app-overrides /root/overrides wr-openstack - sysinv-helm create-app-overrides /root/overrides wr-openstack kube-system Story: 2002876 Task: 22831 Depends-On: https://review.openstack.org/587390 Change-Id: Idbe0938ef196fb68f716a95d1e9202f6f77cb6a8 Signed-off-by: Jack Ding <jack.ding@windriver.com>
40 lines
1.0 KiB
Python
40 lines
1.0 KiB
Python
#
|
|
# 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 OpenvswitchHelm(openstack.OpenstackBaseHelm):
|
|
"""Class to encapsulate helm operations for the openvswitch chart"""
|
|
|
|
CHART = constants.HELM_CHART_OPENVSWITCH
|
|
SUPPORTED_NAMESPACES = [
|
|
common.HELM_NS_OPENSTACK
|
|
]
|
|
|
|
def get_namespaces(self):
|
|
return self.SUPPORTED_NAMESPACES
|
|
|
|
def get_overrides(self, namespace=None):
|
|
overrides = {
|
|
common.HELM_NS_OPENSTACK: {
|
|
}
|
|
}
|
|
|
|
if namespace in self.SUPPORTED_NAMESPACES:
|
|
return overrides[namespace]
|
|
elif namespace:
|
|
raise exception.InvalidHelmNamespace(chart=self.CHART,
|
|
namespace=namespace)
|
|
else:
|
|
return overrides
|