1. 部署grafana,有两种方式部署,一种是以pod方式部署,准备yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: monitoring-grafana
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
k8s-app: grafana
template:
metadata:
labels:
k8s-app: grafana
spec:
containers:
- name: grafana
image: grafana/grafana
# command: ["grafana-cli plugins install grafana-kubernetes-app & service grafana-server restart"]
# ports:
# - containerPort: 3000
# protocol: TCP
volumeMounts:
- mountPath: /etc/ssl/certs
name: ca-certificates
readOnly: true
- mountPath: /var
name: grafana-storage
env:
#- name: INFLUXDB_HOST
# value: monitoring-influxdb
#- name: GF_SERVER_HTTP_PORT
# value: "3000"
# The following env variables are required to make Grafana accessible via