Skip to content

Commit

Permalink
build,salt: Deploy Fluent-bit dashboard with Salt
Browse files Browse the repository at this point in the history
Create an SLS to deploy the Fluent-bit dashboard from charts

Refs: #2721
  • Loading branch information
TeddyAndrieux committed Aug 25, 2020
1 parent 2fa7993 commit 3eacee2
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
19 changes: 19 additions & 0 deletions buildchain/buildchain/salt_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ def _get_parts(self) -> Iterator[str]:

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(
Expand Down Expand Up @@ -293,6 +296,22 @@ def _get_parts(self) -> Iterator[str]:
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'),
Expand Down
21 changes: 21 additions & 0 deletions salt/metalk8s/addons/logging/fluent-bit/deployed/dashboard.sls.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include:
- metalk8s.addons.prometheus-operator.deployed.namespace

Deploy ConfigMap for Fluent-bit dashboard:
metalk8s_kubernetes.object_present:
- manifest:
apiVersion: v1
kind: ConfigMap
metadata:
name: fluent-bit-grafana-dashboard
namespace: metalk8s-monitoring
labels:
grafana_dashboard: "1"
app.kubernetes.io/managed-by: metalk8s
app.kubernetes.io/part-of: metalk8s
heritage: metalk8s
data:
fluent-bit-dashboard.json: |-
{%- raw %}
@@FluentBitDashboard
{%- endraw %}
1 change: 1 addition & 0 deletions salt/metalk8s/addons/logging/fluent-bit/deployed/init.sls
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include:
- .configmap
- .chart
- .dashboard

0 comments on commit 3eacee2

Please sign in to comment.