- 提前创建pv和pvc(或者设置persistentVolume.enabled为false略过此步)
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv001
spec:
capacity:
storage: 2Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: small
nfs:
path: /app/data/alertprometheus/
server: 172.25.16.168
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pv002
spec:
capacity:
storage: 8Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: big
nfs:
path: /app/data/prometheus/
server: 172.25.16.168
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: alert01
spec:
accessModes:
- ReadWriteOnce
storageClassName: small
resources:
requests:
storage: 2Gi
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: prometheus01
spec:
accessModes:
- ReadWriteOnce
storageClassName: big
resources:
requests:
storage: 8Gi
- 安装prometheus
- 提前修改values.yaml中的
alertmanager.persistentVolume.existingClaim
和server.persistentVolume.existingClaim
为前步所创建的pvc名。
- 修改values.yaml中的
rbac.create
为true
helm install --name prometheus stable/prometheus -f prometheus/values.yaml
网友评论