stx-monitor Application Flexible Config and Upgrade
Add enhancements to the stx-monitor infrastructure and monitoring application to expand flexible configuration and upgrade capabilities. Story: 2005733 Task: 36387 Change-Id: I11cef36f416a1a1b1fd813c0c06f6c7a20a19a2a Signed-off-by: Kevin Smith <kevin.smith@windriver.com>
This commit is contained in:
parent
741869ed8c
commit
e7f8d9e0ae
|
@ -107,6 +107,13 @@ data:
|
||||||
path: /stx-elasticsearch-client(/|$)(.*)
|
path: /stx-elasticsearch-client(/|$)(.*)
|
||||||
hosts:
|
hosts:
|
||||||
- ""
|
- ""
|
||||||
|
master:
|
||||||
|
updateStrategy:
|
||||||
|
type: "RollingUpdate"
|
||||||
|
data:
|
||||||
|
terminationGracePeriodSeconds: 240
|
||||||
|
updateStrategy:
|
||||||
|
type: "RollingUpdate"
|
||||||
source:
|
source:
|
||||||
type: tar
|
type: tar
|
||||||
location: http://172.17.0.1:8080/helm_charts/starlingx/elasticsearch-1.24.0.tgz
|
location: http://172.17.0.1:8080/helm_charts/starlingx/elasticsearch-1.24.0.tgz
|
||||||
|
@ -407,6 +414,8 @@ data:
|
||||||
elastic-controller: "enabled"
|
elastic-controller: "enabled"
|
||||||
elasticsearch:
|
elasticsearch:
|
||||||
host: stx-elasticsearch-client
|
host: stx-elasticsearch-client
|
||||||
|
config:
|
||||||
|
elasticsearch.path: ""
|
||||||
outputs:
|
outputs:
|
||||||
main: |-
|
main: |-
|
||||||
output {
|
output {
|
||||||
|
@ -414,14 +423,14 @@ data:
|
||||||
#stdout { codec => rubydebug }
|
#stdout { codec => rubydebug }
|
||||||
if [type] == "collectd" {
|
if [type] == "collectd" {
|
||||||
elasticsearch {
|
elasticsearch {
|
||||||
hosts => ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}"]
|
hosts => ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}${ELASTICSEARCH_PATH}"]
|
||||||
manage_template => false
|
manage_template => false
|
||||||
index => "collectd"
|
index => "collectd"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if [type] == "beats" {
|
if [type] == "beats" {
|
||||||
elasticsearch {
|
elasticsearch {
|
||||||
hosts => ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}"]
|
hosts => ["${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}${ELASTICSEARCH_PATH}"]
|
||||||
manage_template => false
|
manage_template => false
|
||||||
index => "%{[@metadata][beat]}-%{[@metadata][version]}"
|
index => "%{[@metadata][beat]}-%{[@metadata][version]}"
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,6 +61,7 @@ systemconfig.puppet_plugins =
|
||||||
034_barbican = sysinv.puppet.barbican:BarbicanPuppet
|
034_barbican = sysinv.puppet.barbican:BarbicanPuppet
|
||||||
035_dockerdistribution = sysinv.puppet.dockerdistribution:DockerDistributionPuppet
|
035_dockerdistribution = sysinv.puppet.dockerdistribution:DockerDistributionPuppet
|
||||||
036_pciirqaffinity = sysinv.puppet.pci_irq_affinity:PciIrqAffinityPuppet
|
036_pciirqaffinity = sysinv.puppet.pci_irq_affinity:PciIrqAffinityPuppet
|
||||||
|
037_monitor = sysinv.puppet.monitor:MonitorPuppet
|
||||||
099_service_parameter = sysinv.puppet.service_parameter:ServiceParamPuppet
|
099_service_parameter = sysinv.puppet.service_parameter:ServiceParamPuppet
|
||||||
|
|
||||||
systemconfig.helm_applications =
|
systemconfig.helm_applications =
|
||||||
|
@ -116,6 +117,7 @@ systemconfig.armada.manifest_ops =
|
||||||
generic = sysinv.helm.manifest_generic:GenericArmadaManifestOperator
|
generic = sysinv.helm.manifest_generic:GenericArmadaManifestOperator
|
||||||
stx-openstack = sysinv.helm.manifest_openstack:OpenstackArmadaManifestOperator
|
stx-openstack = sysinv.helm.manifest_openstack:OpenstackArmadaManifestOperator
|
||||||
platform-integ-apps = sysinv.helm.manifest_platform:PlatformArmadaManifestOperator
|
platform-integ-apps = sysinv.helm.manifest_platform:PlatformArmadaManifestOperator
|
||||||
|
stx-monitor = sysinv.helm.manifest_monitor:MonitorArmadaManifestOperator
|
||||||
|
|
||||||
sysinv.agent.lldp.drivers =
|
sysinv.agent.lldp.drivers =
|
||||||
lldpd = sysinv.agent.lldp.drivers.lldpd.driver:SysinvLldpdAgentDriver
|
lldpd = sysinv.agent.lldp.drivers.lldpd.driver:SysinvLldpdAgentDriver
|
||||||
|
|
|
@ -1821,6 +1821,15 @@ def is_openstack_applied(dbapi):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
def is_monitor_applied(dbapi):
|
||||||
|
""" Checks whether the Monitor application is applied successfully. """
|
||||||
|
try:
|
||||||
|
monitor_app = dbapi.kube_app_get(constants.HELM_APP_MONITOR)
|
||||||
|
return monitor_app.active
|
||||||
|
except exception.KubeAppNotFound:
|
||||||
|
return False
|
||||||
|
|
||||||
|
|
||||||
def is_url(url_str):
|
def is_url(url_str):
|
||||||
try:
|
try:
|
||||||
URLValidator()(url_str)
|
URLValidator()(url_str)
|
||||||
|
|
|
@ -99,6 +99,7 @@ from sysinv.openstack.common import uuidutils
|
||||||
from sysinv.openstack.common.gettextutils import _
|
from sysinv.openstack.common.gettextutils import _
|
||||||
from sysinv.puppet import common as puppet_common
|
from sysinv.puppet import common as puppet_common
|
||||||
from sysinv.puppet import puppet
|
from sysinv.puppet import puppet
|
||||||
|
from sysinv.helm import common as helm_common
|
||||||
from sysinv.helm import helm
|
from sysinv.helm import helm
|
||||||
from sysinv.helm import utils as helm_utils
|
from sysinv.helm import utils as helm_utils
|
||||||
|
|
||||||
|
@ -6216,6 +6217,20 @@ class ConductorManager(service.PeriodicService):
|
||||||
LOG.error("PART Unexpected Error.")
|
LOG.error("PART Unexpected Error.")
|
||||||
self.dbapi.partition_update(partition_data['uuid'], part_updates)
|
self.dbapi.partition_update(partition_data['uuid'], part_updates)
|
||||||
|
|
||||||
|
def _update_config_for_stx_monitor(self, context):
|
||||||
|
""" Update config applicable to stx-monitor app. """
|
||||||
|
personalities = [constants.CONTROLLER, constants.WORKER]
|
||||||
|
|
||||||
|
config_uuid = self._config_update_hosts(context, personalities)
|
||||||
|
config_dict = {
|
||||||
|
"personalities": personalities,
|
||||||
|
"classes": ['platform::collectd::restart']
|
||||||
|
}
|
||||||
|
|
||||||
|
self._config_apply_runtime_manifest(context,
|
||||||
|
config_uuid,
|
||||||
|
config_dict)
|
||||||
|
|
||||||
def _update_vim_config(self, context):
|
def _update_vim_config(self, context):
|
||||||
""" Update the VIM's configuration. """
|
""" Update the VIM's configuration. """
|
||||||
personalities = [constants.CONTROLLER]
|
personalities = [constants.CONTROLLER]
|
||||||
|
@ -10228,6 +10243,14 @@ class ConductorManager(service.PeriodicService):
|
||||||
# the prior apply state, update the ceph config
|
# the prior apply state, update the ceph config
|
||||||
self._update_radosgw_config(context)
|
self._update_radosgw_config(context)
|
||||||
|
|
||||||
|
if constants.HELM_APP_MONITOR == appname and app_applied:
|
||||||
|
logstash_active = cutils.is_chart_enabled(self.dbapi, constants.HELM_APP_MONITOR,
|
||||||
|
helm_common.HELM_CHART_LOGSTASH,
|
||||||
|
helm_common.HELM_NS_MONITOR)
|
||||||
|
|
||||||
|
if logstash_active:
|
||||||
|
self._update_config_for_stx_monitor(context)
|
||||||
|
|
||||||
return app_applied
|
return app_applied
|
||||||
|
|
||||||
def perform_app_update(self, context, from_rpc_app, to_rpc_app, tarfile, operation):
|
def perform_app_update(self, context, from_rpc_app, to_rpc_app, tarfile, operation):
|
||||||
|
@ -10266,6 +10289,15 @@ class ConductorManager(service.PeriodicService):
|
||||||
self._update_vim_config(context)
|
self._update_vim_config(context)
|
||||||
self._update_pciirqaffinity_config(context)
|
self._update_pciirqaffinity_config(context)
|
||||||
self._update_radosgw_config(context)
|
self._update_radosgw_config(context)
|
||||||
|
|
||||||
|
if constants.HELM_APP_MONITOR == appname and app_removed:
|
||||||
|
logstash_active = cutils.is_chart_enabled(self.dbapi, constants.HELM_APP_MONITOR,
|
||||||
|
helm_common.HELM_CHART_LOGSTASH,
|
||||||
|
helm_common.HELM_NS_MONITOR)
|
||||||
|
|
||||||
|
if logstash_active:
|
||||||
|
self._update_config_for_stx_monitor(context)
|
||||||
|
|
||||||
return app_removed
|
return app_removed
|
||||||
|
|
||||||
def perform_app_abort(self, context, rpc_app):
|
def perform_app_abort(self, context, rpc_app):
|
||||||
|
|
|
@ -23,3 +23,26 @@ class ElasticBaseHelm(base.BaseHelm):
|
||||||
|
|
||||||
def get_namespaces(self):
|
def get_namespaces(self):
|
||||||
return self.SUPPORTED_NAMESPACES
|
return self.SUPPORTED_NAMESPACES
|
||||||
|
|
||||||
|
def _is_enabled(self, app_name, chart_name, namespace):
|
||||||
|
"""
|
||||||
|
Check if the chart is enable at a system level
|
||||||
|
|
||||||
|
:param app_name: Application name
|
||||||
|
:param chart_name: Chart supplied with the application
|
||||||
|
:param namespace: Namespace where the chart will be executed
|
||||||
|
|
||||||
|
Returns true by default if an exception occurs as most charts are
|
||||||
|
enabled.
|
||||||
|
"""
|
||||||
|
return super(ElasticBaseHelm, self)._is_enabled(
|
||||||
|
app_name, chart_name, namespace)
|
||||||
|
|
||||||
|
def execute_manifest_updates(self, operator):
|
||||||
|
# On application load this chart is enabled. Only disable if specified
|
||||||
|
# by the user
|
||||||
|
if not self._is_enabled(operator.APP, self.CHART,
|
||||||
|
common.HELM_NS_MONITOR):
|
||||||
|
operator.chart_group_chart_delete(
|
||||||
|
operator.CHART_GROUPS_LUT[self.CHART],
|
||||||
|
operator.CHARTS_LUT[self.CHART])
|
||||||
|
|
|
@ -25,6 +25,8 @@ class LogstashHelm(elastic.ElasticBaseHelm):
|
||||||
'persistence': {
|
'persistence': {
|
||||||
'storageClass': 'general',
|
'storageClass': 'general',
|
||||||
'size': "20Gi"},
|
'size': "20Gi"},
|
||||||
|
'config': {
|
||||||
|
'elasticsearch.path': ""},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,61 @@
|
||||||
|
# vim: tabstop=4 shiftwidth=4 softtabstop=4
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
# All Rights Reserved.
|
||||||
|
#
|
||||||
|
|
||||||
|
""" System inventory Armada monitor manifest operator."""
|
||||||
|
|
||||||
|
from sysinv.common import constants
|
||||||
|
from sysinv.helm import manifest_base as base
|
||||||
|
from sysinv.helm.logstash import LogstashHelm
|
||||||
|
from sysinv.helm.kibana import KibanaHelm
|
||||||
|
from sysinv.helm.elasticsearch import ElasticsearchHelm
|
||||||
|
from sysinv.helm.filebeat import FilebeatHelm
|
||||||
|
from sysinv.helm.metricbeat import MetricbeatHelm
|
||||||
|
from sysinv.helm.nginx_ingress import NginxIngressHelm
|
||||||
|
from sysinv.helm.kube_state_metrics import KubeStateMetricsHelm
|
||||||
|
|
||||||
|
|
||||||
|
class MonitorArmadaManifestOperator(base.ArmadaManifestOperator):
|
||||||
|
|
||||||
|
APP = constants.HELM_APP_MONITOR
|
||||||
|
ARMADA_MANIFEST = 'monitor-armada-manifest'
|
||||||
|
|
||||||
|
CHART_GROUP_NGINX = 'nginx-ingress'
|
||||||
|
CHART_GROUP_KIBANA = 'kibana'
|
||||||
|
CHART_GROUP_ELASTICSEARCH = 'elasticsearch'
|
||||||
|
CHART_GROUP_LOGSTASH = 'logstash'
|
||||||
|
CHART_GROUP_FILEBEAT = 'filebeat'
|
||||||
|
CHART_GROUP_METRICBEAT = 'metricbeat'
|
||||||
|
CHART_GROUP_KUBESTATEMETRICS = 'kube-state-metrics'
|
||||||
|
CHART_GROUPS_LUT = {
|
||||||
|
NginxIngressHelm.CHART: CHART_GROUP_NGINX,
|
||||||
|
KibanaHelm.CHART: CHART_GROUP_KIBANA,
|
||||||
|
ElasticsearchHelm.CHART: CHART_GROUP_ELASTICSEARCH,
|
||||||
|
LogstashHelm.CHART: CHART_GROUP_LOGSTASH,
|
||||||
|
FilebeatHelm.CHART: CHART_GROUP_FILEBEAT,
|
||||||
|
MetricbeatHelm.CHART: CHART_GROUP_METRICBEAT,
|
||||||
|
KubeStateMetricsHelm.CHART: CHART_GROUP_KUBESTATEMETRICS
|
||||||
|
}
|
||||||
|
|
||||||
|
CHARTS_LUT = {
|
||||||
|
NginxIngressHelm.CHART: 'nginx-ingress',
|
||||||
|
KibanaHelm.CHART: 'kibana',
|
||||||
|
ElasticsearchHelm.CHART: 'elasticsearch',
|
||||||
|
LogstashHelm.CHART: 'logstash',
|
||||||
|
FilebeatHelm.CHART: 'filebeat',
|
||||||
|
MetricbeatHelm.CHART: 'metricbeat',
|
||||||
|
KubeStateMetricsHelm.CHART: 'kube-state-metrics'
|
||||||
|
}
|
||||||
|
|
||||||
|
def platform_mode_manifest_updates(self, dbapi, mode):
|
||||||
|
""" Update the application manifest based on the platform
|
||||||
|
|
||||||
|
:param dbapi: DB api object
|
||||||
|
:param mode: mode to control how to apply the application manifest
|
||||||
|
"""
|
||||||
|
pass
|
|
@ -0,0 +1,33 @@
|
||||||
|
#
|
||||||
|
# Copyright (c) 2019 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
from sysinv.common import constants
|
||||||
|
from sysinv.common import utils
|
||||||
|
from sysinv.helm import common as helm_common
|
||||||
|
from sysinv.puppet import base
|
||||||
|
|
||||||
|
|
||||||
|
class MonitorPuppet(base.BasePuppet):
|
||||||
|
"""Class to encapsulate elastic monitor configuration"""
|
||||||
|
|
||||||
|
LOGSTASH_COLLECTD_PORT = "31005"
|
||||||
|
|
||||||
|
def get_system_config(self):
|
||||||
|
|
||||||
|
config = {}
|
||||||
|
if utils.is_monitor_applied(self.dbapi):
|
||||||
|
|
||||||
|
logstash_active = utils.is_chart_enabled(
|
||||||
|
self.dbapi, constants.HELM_APP_MONITOR,
|
||||||
|
helm_common.HELM_CHART_LOGSTASH,
|
||||||
|
helm_common.HELM_NS_MONITOR)
|
||||||
|
|
||||||
|
if logstash_active:
|
||||||
|
config = {
|
||||||
|
'platform::collectd::params::server_port':
|
||||||
|
self.LOGSTASH_COLLECTD_PORT,
|
||||||
|
}
|
||||||
|
|
||||||
|
return config
|
Loading…
Reference in New Issue