Skip to content

Commit 30fafc8

Browse files
Merge pull request #15 from hammady/feature/helm3
Add support for hostPath volumes
2 parents 3570ff7 + 83465a2 commit 30fafc8

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

charts/code-server/templates/deployment.yaml

+20-12
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ spec:
7474
{{- end }}
7575
volumeMounts:
7676
- name: data
77-
mountPath: /home/coder/project
78-
subPath: project
79-
- name: data
80-
mountPath: /home/coder/.local/share/code-server
81-
subPath: code-server
77+
mountPath: /home/coder
8278
{{- range .Values.extraConfigmapMounts }}
8379
- name: {{ .name }}
8480
mountPath: {{ .mountPath }}
@@ -126,19 +122,31 @@ spec:
126122
volumes:
127123
- name: data
128124
{{- if .Values.persistence.enabled }}
125+
{{- if not .Values.persistence.hostPath }}
129126
persistentVolumeClaim:
130127
claimName: {{ .Values.persistence.existingClaim | default (include "code-server.fullname" .) }}
128+
{{- else }}
129+
hostPath:
130+
path: {{ .Values.persistence.hostPath }}
131+
type: Directory
132+
{{- end -}}
131133
{{- else }}
132134
emptyDir: {}
133135
{{- end -}}
134136
{{- range .Values.extraSecretMounts }}
135-
- name: {{ .name }}
136-
secret:
137-
secretName: {{ .secretName }}
138-
defaultMode: {{ .defaultMode }}
137+
- name: {{ .name }}
138+
secret:
139+
secretName: {{ .secretName }}
140+
defaultMode: {{ .defaultMode }}
139141
{{- end }}
140142
{{- range .Values.extraVolumeMounts }}
141-
- name: {{ .name }}
142-
persistentVolumeClaim:
143-
claimName: {{ .existingClaim }}
143+
- name: {{ .name }}
144+
{{- if .existingClaim }}
145+
persistentVolumeClaim:
146+
claimName: {{ .existingClaim }}
147+
{{- else }}
148+
hostPath:
149+
path: {{ .hostPath }}
150+
type: Directory
151+
{{- end }}
144152
{{- end }}

charts/code-server/templates/pvc.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
1+
{{- if and (and .Values.persistence.enabled (not .Values.persistence.existingClaim)) (not .Values.persistence.hostPath) }}
22
kind: PersistentVolumeClaim
33
apiVersion: v1
44
metadata:

charts/code-server/values.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ persistence:
115115
size: 1Gi
116116
annotations: {}
117117
# existingClaim: ""
118+
# hostPath: /data
118119

119120
serviceAccount:
120121
create: true
@@ -152,6 +153,7 @@ extraVolumeMounts: []
152153
# mountPath: /mnt/volume
153154
# readOnly: true
154155
# existingClaim: volume-claim
156+
# hostPath: ""
155157

156158
extraConfigmapMounts: []
157159
# - name: certs-configmap

0 commit comments

Comments
 (0)