I'm trying to install kube-prometheus-stack using helm and trying to use persistent volume with hospath even after specifying VolumeClaimTemplate the emptyDir is getting created is storage type.
These are steps i followed:
kind: PersistentVolume
metadata:
name: prometheus-pv
labels:
app: prometheus
spec:
capacity:
storage: 50Gi
hostPath:
path: /data/prometheus/pv4
type: ''
accessModes:
- ReadWriteOnce
resources: {}
# requests:
# memory: 400Mi
## Prometheus StorageSpec for persistent data
## ref: https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/user-guides/storage.md
##
storageSpec:
## Using PersistentVolumeClaim
##
volumeClaimTemplate:
spec:
storageClassName: ""
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 50Gi
selector:
matchLabels:
app: prometheus
helm install --values Prometheus.yaml promethes prometheus-community/kube-prometheus-stack --namespace prometheusstack
spec:
volumes:
- name: config
secret:
secretName: prometheus-promethes-kube-prometheus-prometheus
defaultMode: 420
- name: tls-assets
secret:
secretName: prometheus-promethes-kube-prometheus-prometheus-tls-assets
defaultMode: 420
- name: config-out
emptyDir: {}
- name: prometheus-promethes-kube-prometheus-prometheus-rulefiles-0
configMap:
name: prometheus-promethes-kube-prometheus-prometheus-rulefiles-0
defaultMode: 420
- name: prometheus-promethes-kube-prometheus-prometheus-db
emptyDir: {}
- name: promethes-kube-prometheus-prometheus-token-nwwxv
secret:
secretName: promethes-kube-prometheus-prometheus-token-nwwxv
defaultMode: 420
You missing identation. The correct values should be:
storageSpec:
## Using PersistentVolumeClaim
##
volumeClaimTemplate:
spec:
storageClassName: ""
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 50Gi
selector:
matchLabels:
app: prometheus