使用helm安装prometheus监控kubernetes

  1. 提前创建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
  1. 安装prometheus
  • 提前修改values.yaml中的alertmanager.persistentVolume.existingClaimserver.persistentVolume.existingClaim为前步所创建的pvc名。
  • 修改values.yaml中的rbac.createtrue
helm install --name prometheus stable/prometheus  -f prometheus/values.yaml 

你可能感兴趣的:(使用helm安装prometheus监控kubernetes)