kubernetes - 如何使用 helm 将自定义仪表板导入 grafana
问题描述
我正在尝试理解 helm,我想知道是否有人可以 ELI5 给我一些东西或帮助我做一些事情。
所以我确实在下面运行:
helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
然后我使用以下方法安装了 kube-prometheus:
helm install coreos/kube-prometheus --name kube-prometheus -f values.yaml --namespace monitoringtest
一切正常,但我正在尝试从 json 文件中添加一些自定义仪表板,但我很难理解如何去做。
我在关注这个:https://blogcodevalue.wordpress.com/2018/09/16/automate-grafana-dashboard-import-process/
在我的 values.yaml 我在下面添加
serverDashboardConfigmaps:
- example-dashboards
我明白,如果我这样做:
helm upgrade --install kube-prometheus -f values.yaml --namespace monitoringtest coreos/kube-prometheus
这应该会导致 grafana 拾取下面的名为 configmapexample-dashboards
并从文件夹加载 * .jsoncustom-dashboards
文件。
apiVersion: v1
kind: ConfigMap
metadata:
name: example-dashboards
data:
{{ (.Files.Glob "custom-dashboards/*.json").AsConfig | indent 2 }}
# Or
#
# data:
# custom-dashboard.json: |-
# {{ (.Files.Get "custom.json") | indent 4 }}
#
# The filename (and consequently the key under data) must be in the format `xxx-dashboard.json` or `xxx-datasource.json`
# for them to be picked up.
现在有两个问题:
如何将上面的 configmap 添加到这个 helm 版本?
这个文件夹在哪里custom-dashboards
?它在我的笔记本电脑上然后发送到grafana吗?
我需要将所有内容复制https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
到我的笔记本电脑上吗?
很抱歉解释了一切,但我只是想理解这一点。
解决方案
我部分想通了。我可以从 configmap 加载仪表板。还不是来自单独的 json 文件,但它是一个进步。
对于任何感兴趣的人,我将其放在我的 github 页面上:https ://github.com/tretos53/notes/blob/master/Grafana/Readme.MD
推荐阅读
- ios - Swift - 只允许在 UITableViewCell 中选择一个复选框
- reactjs - 抓取 Chrome 扩展程序呈现的内容的最佳方法是什么?
- wpf - 每当我单击该项目时,我都试图使我的 ListViewItems 不会以虚线边框突出显示。代码在 WPF XAML 中
- sql-server - Varchar 和 nvarchar 不同的隐式转换为 int
- python-2.7 - 有没有更快的方法使用列表从 NDB 查询?
- c++ - sizeof 总是一样吗?
- android - ZXingScannerView.java me.dm7.barcodescanner.zxing.ZXingScannerView.onPreviewFrame 中的 NoSuchMethod
- c# - 如何创建具有一定数量数字的随机字符串?
- javascript - AWS:使用“sam invoke local”时未找到层代码
- iis - IIS - 使用掩码重定向到子文件夹