如何使用头盔将自定义仪表板导入grafana [英] How to import custom dashboards to grafana using helm
问题描述
我试图理解掌舵,我想知道是否有人可以ELI5给我一些东西或帮助我做些事情.
I'm trying to understand helm and I wonder if someone could ELI5 to me something or help me with something.
所以我确实在下面跑了
helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
然后我通过使用以下命令安装了kube-prometheus:
Then I installed kube-prometheus by using below:
helm install coreos/kube-prometheus --name kube-prometheus -f values.yaml --namespace monitoringtest
一切正常,但是我试图从json文件中添加一些自定义仪表板,而我正努力了解如何做到这一点.
Everything works fine but I'm trying to add some custom dashboards from json files and I'm struggling to understand how to do it.
我正在关注:https://blogcodevalue.wordpress.com/2018/09/16/automate-grafana-dashboard-import-process/
在我的values.yaml中,我在下面添加了
In my values.yaml I added below
serverDashboardConfigmaps:
- example-dashboards
我知道,如果我这样做:
I understand that if I do:
helm upgrade --install kube-prometheus -f values.yaml --namespace monitoringtest coreos/kube-prometheus
这将导致grafana获取一个名为example-dashboards
的配置文件,并从custom-dashboards
文件夹中加载* .json文件.
That should cause grafana to pickup a below configmap called example-dashboards
and load *.json files from custom-dashboards
folder.
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添加到此头盔版本中?
How do I add above configmap to this helm release?
此custom-dashboards
文件夹在哪里?是在我的笔记本电脑上,然后将其发送到grafana吗?
Where is this custom-dashboards
folder located? Is it on my laptop and then is send to grafana?
我是否需要将所有https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
复制到笔记本电脑上?
Do I need to copy all of https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/
onto my laptop?
很抱歉为您解释了所有内容,但我只是想了解这一点.
Sorry for explaining everything but I'm just trying to understand this.
推荐答案
我部分理解了这一点.我可以从configmap加载仪表板.还不是来自单独的json文件,但这是一个进步.
I partially figured it out. I can load dashboards from a configmap. Not from separate json files yet but it'a progress.
对于感兴趣的人,我将其放在我的github页面上: https: //github.com/tretos53/notes/blob/master/Grafana/Readme.MD
For anyone interested I put this on my github page: https://github.com/tretos53/notes/blob/master/Grafana/Readme.MD
这篇关于如何使用头盔将自定义仪表板导入grafana的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!