k8s安装grafana监控界面

首先部署grafana pod

 1 apiVersion: extensions/v1beta1
 2 kind: Deployment
 3 metadata:
 4    name: monitoring-grafana
 5    namespace: kube-system
 6 spec:
 7    replicas: 1
 8    template:
 9      metadata:
10        labels:
11          task: monitoring
12          k8s-app: grafana     
13      spec:              
14        containers:
15        - name: grafana
16          image: grafana/grafana:5.0.0
17          ports:
18          - containerPort: 3000
19            protocol: TCP         
20          env:
21          - name: INFLUXDB_HOST
22            value: monitoring-influxdb
23          - name: GF_INSTALL_PLUGINS
24            value: grafana-kubernetes-app

然后部署grafana service

 

 1 apiVersion: v1
 2 kind: Service
 3 metadata:
 4    name: monitoring-grafana
 5    namespace: kube-system
 6    labels:
 7     k8s-app: grafana
 8     component: core
 9 spec:
10   type: NodePort
11   ports:
12     - port: 3000
13       nodePort: 31000
14   selector:
15     k8s-app: grafana

 

posted @ 2019-10-22 08:20  嘿!小伙不错  阅读(1346)  评论(0编辑  收藏  举报