{{- if .Values.persistence.nameNode.enabled -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: {{ template "hadoop.fullname" . }}-hdfs-nn
  labels:
    app: {{ template "hadoop.name" . }}
    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
    release: {{ .Release.Name }}
    heritage: {{ .Release.Service }}
    component: hdfs-nn
spec:
  accessModes:
  - {{ .Values.persistence.nameNode.accessMode | quote }}
  resources:
    requests:
      storage: {{ .Values.persistence.nameNode.size | quote }}
{{- if .Values.persistence.nameNode.storageClass }}
{{- if (eq "-" .Values.persistence.nameNode.storageClass) }}
  storageClassName: ""
{{- else }}
  storageClassName: "{{ .Values.persistence.nameNode.storageClass }}"
{{- end }}
{{- end }}
{{- end -}}
