Add support for hostPath volumes

This commit is contained in:
Hossam Hammady 2020-10-12 11:59:53 +00:00
parent 3570ff796d
commit b4fd47b5af
3 changed files with 22 additions and 8 deletions

View File

@ -126,8 +126,14 @@ spec:
volumes:
- name: data
{{- if .Values.persistence.enabled }}
{{- if not .Values.persistence.hostPath }}
persistentVolumeClaim:
claimName: {{ .Values.persistence.existingClaim | default (include "code-server.fullname" .) }}
{{- else }}
hostPath:
path: {{ .Values.persistence.hostPath }}
type: Directory
{{- end -}}
{{- else }}
emptyDir: {}
{{- end -}}
@ -139,6 +145,12 @@ spec:
{{- end }}
{{- range .Values.extraVolumeMounts }}
- name: {{ .name }}
{{- if .existingClaim }}
persistentVolumeClaim:
claimName: {{ .existingClaim }}
{{- else }}
hostPath:
path: {{ .hostPath }}
type: Directory
{{- end }}
{{- end }}

View File

@ -1,4 +1,4 @@
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
{{- if and (and .Values.persistence.enabled (not .Values.persistence.existingClaim)) (not .Values.persistence.hostPath) }}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:

View File

@ -115,6 +115,7 @@ persistence:
size: 1Gi
annotations: {}
# existingClaim: ""
# hostPath: /data
serviceAccount:
create: true
@ -152,6 +153,7 @@ extraVolumeMounts: []
# mountPath: /mnt/volume
# readOnly: true
# existingClaim: volume-claim
# hostPath: ""
extraConfigmapMounts: []
# - name: certs-configmap