【K8S运维知识汇总】第7天5:部署Grafana

网友投稿 886 2022-11-27

【K8S运维知识汇总】第7天5:部署Grafana

【K8S运维知识汇总】第7天5:部署Grafana

文章目录

​​准备基础镜像​​​​准备资源配置清单​​​​DNS解析​​​​应用资源配置清单​​​​浏览器验证​​​​安装插件​​

​​k8s-app插件​​​​时钟插件 Clock Pannel​​​​饼图插件 Pie Chart​​​​D3 Gauge​​​​Discrete插件​​

​​检查插件​​​​接入普罗米修斯​​​​部分展示​​

准备基础镜像

​​/opt/src]# docker image tag 6f18ddf9e552 harbor.od.com/infra/grafana:v5.4.2[root@k8s7-200.host.com /opt/src]# docker push harbor.od.com/infra/grafana:v5.4.2

准备资源配置清单

[root@k8s7-200.host.com /data/k8s-yaml/grafana]# cat rbac.yaml apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRolemetadata: labels: addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/cluster-service: "true" name: grafanarules:- apiGroups: - "*" resources: - namespaces - deployments - pods verbs: - get - list - watch---apiVersion: rbac.authorization.k8s.io/v1kind: ClusterRoleBindingmetadata: labels: addonmanager.kubernetes.io/mode: Reconcile kubernetes.io/cluster-service: "true" name: grafanaroleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: grafanasubjects:- kind: User name: k8s-node[root@k8s7-200.host.com /data/k8s-yaml/grafana]# cat deployment.yaml apiVersion: apps/v1kind: Deploymentmetadata: labels: app: grafana name: grafana name: grafana namespace: infraspec: replicas: 1 selector: matchLabels: name: grafana template: metadata: labels: app: grafana name: grafana spec: containers: - name: grafana image: harbor.od.com/infra/grafana:v5.4.2 ports: - containerPort: 3000 protocol: TCP volumeMounts: - mountPath: /var/lib/grafana name: data imagePullSecrets: - name: harbor securityContext: runAsUser: 0 volumes: - nfs: server: k8s7-200 path: /data/nfs-volume/grafana name: data[root@k8s7-200.host.com /data/k8s-yaml/grafana]# cat service.yaml apiVersion: v1kind: Servicemetadata: name: grafana namespace: infraspec: ports: - port: 3000 protocol: TCP selector: app: grafana type: ClusterIP[root@k8s7-200.host.com /data/k8s-yaml/grafana]# cat ingress.yaml

[root@k8s7-200.host.com /data/k8s-yaml/grafana]# mkdir -p /data/nfs-volume/grafana

DNS解析

grafana A 10.4.7.10

应用资源配置清单

[root@k8s7-22.host.com ~]# kubectl apply -f createdclusterrolebinding.rbac.authorization.k8s.io/grafana created[root@k8s7-22.host.com ~]# kubectl apply -f created[root@k8s7-22.host.com ~]# kubectl apply -f created[root@k8s7-22.host.com ~]# kubectl apply -f plugins install grafana-kubernetes-app

安装方法二:

​​ plugins]# wget -O grafana-kubernetes-app.zip[root@hdss7-200 plugins]# unzip grafana-kubernetes-app.zip

时钟插件 Clock Pannel

grafana-cli plugins install

饼图插件 Pie Chart

grafana-cli plugins install

D3 Gauge

grafana-cli plugins install

Discrete插件

grafana-cli plugins install

重启Pod

检查插件

接入普罗米修斯

部分展示

版权声明:本文内容由网络用户投稿,版权归原作者所有,本站不拥有其著作权,亦不承担相应法律责任。如果您发现本站中有涉嫌抄袭或描述失实的内容,请联系我们jiasou666@gmail.com 处理,核实后本网站将在24小时内删除侵权内容。

上一篇:【搞定Go语言】第2天17:反射
下一篇:【搞定Go语言】第2天21:Go语言基础之单元测试
相关文章

 发表评论

暂时没有评论,来抢沙发吧~