Kube-prometheus grafana安装插件和grafana-image-renderer
原创
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、验证插件
4.2、验证grafana-image-renderer