Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Logging dashboards (Loki, Logs, Fluent-bit) #2745

Merged
merged 9 commits into from
Aug 25, 2020
55 changes: 55 additions & 0 deletions buildchain/buildchain/salt_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import importlib
from pathlib import Path
import sys
import textwrap
from typing import Any, Iterator, Tuple, Union

from buildchain import config
Expand Down Expand Up @@ -179,6 +180,12 @@ def _get_parts(self) -> Iterator[str]:
OPERATOR_ROLEBINDING : Path = OPERATOR_YAML_ROOT/'role_binding.yaml'
OPERATOR_DEPLOYMENT : Path = OPERATOR_YAML_ROOT/'operator.yaml'

LOKI_DASHBOARD : Path = constants.ROOT/'charts/loki-dashboard.json'
LOGS_DASHBOARD : Path = constants.ROOT/'charts/logs-dashboard.json'
FLUENT_BIT_DASHBOARD : Path = constants.ROOT.joinpath(
'charts/fluent-bit-dashboard.json'
)

SCALITY_LOGO : Path = constants.ROOT/'ui/public/brand/assets/login/logo.png'
SCALITY_FAVICON : Path = constants.ROOT.joinpath(
'ui/public/brand/assets/login/favicon.png'
Expand Down Expand Up @@ -270,12 +277,60 @@ def _get_parts(self) -> Iterator[str]:
),

Path('salt/metalk8s/addons/logging/deployed/init.sls'),
targets.TemplateFile(
task_name='logs dashboard.sls',
source=constants.ROOT.joinpath(
'salt/metalk8s/addons/logging/deployed/dashboard.sls.in'
),
destination=constants.ISO_ROOT.joinpath(
'salt/metalk8s/addons/logging/deployed/dashboard.sls'
),
context={
'LogsDashboard': textwrap.indent(
LOGS_DASHBOARD.read_text(encoding='utf-8'),
12 * ' '
)
},
file_dep=[LOGS_DASHBOARD],
),
Path('salt/metalk8s/addons/logging/deployed/namespace.sls'),
Path('salt/metalk8s/addons/logging/fluent-bit/deployed/chart.sls'),
Path('salt/metalk8s/addons/logging/fluent-bit/deployed/configmap.sls'),
targets.TemplateFile(
task_name='fluent-bit dashboard.sls',
source=constants.ROOT.joinpath(
'salt/metalk8s/addons/logging/fluent-bit/deployed/dashboard.sls.in'
),
destination=constants.ISO_ROOT.joinpath(
'salt/metalk8s/addons/logging/fluent-bit/deployed/dashboard.sls'
),
context={
'FluentBitDashboard': textwrap.indent(
FLUENT_BIT_DASHBOARD.read_text(encoding='utf-8'),
12 * ' '
)
},
file_dep=[FLUENT_BIT_DASHBOARD],
),
Path('salt/metalk8s/addons/logging/fluent-bit/deployed/init.sls'),
Path('salt/metalk8s/addons/logging/loki/config/loki.yaml'),
Path('salt/metalk8s/addons/logging/loki/deployed/chart.sls'),
targets.TemplateFile(
task_name='loki dashboard.sls',
source=constants.ROOT.joinpath(
'salt/metalk8s/addons/logging/loki/deployed/dashboard.sls.in'
),
destination=constants.ISO_ROOT.joinpath(
'salt/metalk8s/addons/logging/loki/deployed/dashboard.sls'
),
context={
'LokiDashboard': textwrap.indent(
LOKI_DASHBOARD.read_text(encoding='utf-8'),
12 * ' '
)
},
file_dep=[LOKI_DASHBOARD],
),
Path('salt/metalk8s/addons/logging/loki/deployed/datasource.sls'),
Path('salt/metalk8s/addons/logging/loki/deployed/init.sls'),
Path('salt/metalk8s/addons/logging/loki/deployed/',
Expand Down
Loading