add gra link
This commit is contained in:
parent
292b0ef8d4
commit
1197b1d73f
|
|
@ -0,0 +1,17 @@
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: grafana-datasource
|
||||||
|
namespace: default
|
||||||
|
data:
|
||||||
|
datasource.yml: |
|
||||||
|
apiVersion: 1
|
||||||
|
datasources:
|
||||||
|
- name: Prometheus
|
||||||
|
type: prometheus
|
||||||
|
access: proxy
|
||||||
|
url: http://prometheus-service:9090
|
||||||
|
isDefault: true
|
||||||
|
editable: false
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -35,11 +35,17 @@ spec:
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: grafana-storage
|
- name: grafana-storage
|
||||||
mountPath: /var/lib/grafana
|
mountPath: /var/lib/grafana
|
||||||
|
- name: grafana-provisioning
|
||||||
|
mountPath: /etc/grafana/provisioning/datasources
|
||||||
|
readOnly: true
|
||||||
volumes:
|
volumes:
|
||||||
- name: grafana-storage
|
- name: grafana-storage
|
||||||
hostPath:
|
hostPath:
|
||||||
path: /opt/grafana/data
|
path: /opt/grafana/data
|
||||||
type: DirectoryOrCreate
|
type: DirectoryOrCreate
|
||||||
|
- name: grafana-provisioning
|
||||||
|
configMap:
|
||||||
|
name: grafana-datasource
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ set -euo pipefail
|
||||||
|
|
||||||
echo "开始安装 Grafana..."
|
echo "开始安装 Grafana..."
|
||||||
sudo chown -R 65534:65534 /opt/prometheus/data
|
sudo chown -R 65534:65534 /opt/prometheus/data
|
||||||
|
kubectl apply -f grafana-datasource.yaml
|
||||||
kubectl apply -f grafana-deployment.yaml
|
kubectl apply -f grafana-deployment.yaml
|
||||||
kubectl apply -f grafana-service.yaml
|
kubectl apply -f grafana-service.yaml
|
||||||
kubectl apply -f grafana-ingress.yaml
|
kubectl apply -f grafana-ingress.yaml
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue