lundi 18 février 2019

Helm persistent volume type selection between EBS and NFS?

I need help with "if" statements in my Prometheus Helm chart. What I am trying to achieve is Prometheus chart with persistent volumes in EBS or NFS. It works fine for EBS, but it doesn't work for NFS. I think the problem is with my if statement logic.

When I set storageClass: "nfs" values.yaml, then I am gettting error:

Error: release prometheus failed: PersistentVolume "prometheus-alertmanager" is invalid: spec: Required value: must specify a volume type

In my values.yaml file I have:

  persistentVolume:
    enabled: true
    accessModes:
      - ReadWriteOnce
    annotations: {}
    existingClaim: ""
    mountPath: /data
    subPath: "alertmanager/"
    size: 4Gi
    ReclaimPolicy: "Recycle"
    storageClass: "aws"
    volumeID: "vol-xxx"
    fs_mounts:
      path: /data/alertmanager
      server: 127.0.0.1

The difference for Prometheus server is in subPath and in path under fs_mounts.

In my alertmanager-pv I have:



apiVersion: v1
kind: PersistentVolume
metadata:
  name: prometheus-alertmanager
spec:
  capacity:
    storage: 
  accessModes:

  persistentVolumeReclaimPolicy: ""

  storageClassName: "gp2"
  awsElasticBlockStore:
    fsType: "ext4"
    volumeID: 

  StorageClassName: "nfs"
    mountOptions:
      - hard
      - nfsvers=4.1
      - timeo=600
      - retrans=2
    nfs:
      server: 
      path: 





and in alertmanager-pvc:




apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  labels:
  name: prometheus-alertmanager
spec:
  accessModes:


  storageClassName: "gp2"
  resources:
    requests:
      storage: 

  storageClassName: "nfs"
  resources:
    requests:
      storage: 






Aucun commentaire:

Enregistrer un commentaire