8

Kube-prometheus grafana安装插件和grafana-image-renderer

 2 years ago
source link: https://blog.51cto.com/liqingbiao/5396956
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Kube-prometheus grafana安装插件和grafana-image-renderer

原创

清风明月li 2022-06-20 18:30:56 博主文章分类:监控系统 ©著作权

文章标签 字段 5e 配置文件 文章分类 Linux 系统/运维 阅读数156

1、修改grafana-config文件

Go
[root@k8s-master manifests]# cat grafana-config.yaml
apiVersion: v1
kind: Secret
metadata:
labels:
app.kubernetes.io/component: grafana
app.kubernetes.io/name: grafana
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 8.8.8
name: grafana-config
namespace: monitoring
stringData:
grafana.ini: |
[rendering]
server_url = http://127.0.0.1:8081/render
callback_url = http://127.0.0.1:3000/
[plugin.grafana-image-renderer]
rendering_language = zh
[paths]
plugins = /var/lib/grafana/plugins
[auth.anonymous]
enabled = true
# [date_formats]
# default_timezone = UTC
type: Opaque

2、修改插件的配置,并在所在的物理机添加/var/lib/grafana/plugins/文件夹并把相关的插件放到改目录里

Go
在vim grafana-deployment.yaml文件里修改。
#1、给容器里的volumeMounts添加grafana-plugins配置文件
volumeMounts:
- mountPath: /var/lib/grafana/plugins
name: grafana-plugins
readOnly: false

#2、添加grafana-plugins这个配置在volume字段里
volumes:
- hostPath:
path: /var/lib/grafana/plugins
type: DirectoryOrCreate
name: grafana-plugins

3、在物理机的计算节点上创建/var/lib/grafana/plugins目录,并把插件拷贝到该节点里。
mkdir /var/lib/grafana/plugins -p
cd /var/lib/grafana/plugins/
931 zip -r plugins plugins/
或者通过容器直接拷贝
docker cp a5e38f88e606:/var/lib/grafana/plugins/ /var/lib/grafana/plugins/

3、应用相关的配置

Go
kubectl create -f grafana-config.yaml
kubectl create -f grafana-deployment.yaml

4、验证

4.1、验证插件

Kube-prometheus grafana安装插件和grafana-image-renderer_5e
Kube-prometheus grafana安装插件和grafana-image-renderer_字段_02
Kube-prometheus grafana安装插件和grafana-image-renderer_配置文件_03

4.2、验证grafana-image-renderer

Kube-prometheus grafana安装插件和grafana-image-renderer_5e_04
Kube-prometheus grafana安装插件和grafana-image-renderer_5e_05
Kube-prometheus grafana安装插件和grafana-image-renderer_5e_06
  • 打赏
  • 1
  • 收藏
  • 评论
  • 分享
  • 举报

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK