Skip to content

Commit e8e033b

Browse files
authored
Merge pull request #10 from HomeDevopsLab/9-common-shared-storage-path
9 common shared storage path
2 parents dbca49c + cb4f0d7 commit e8e033b

5 files changed

Lines changed: 17 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## [2.5.0] - 2024-09-01
4+
5+
### Added
6+
7+
- common rootdir on shared storage
8+
39
## [2.4.0] - 2024-08-24
410

511
### Added

chart/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 2.4.0
18+
version: 2.5.0
1919
# This is the version number of the application being deployed. This version number should be
2020
# incremented each time you make changes to the application. Versions are not expected to
2121
# follow Semantic Versioning. They should reflect the version the application is using.

chart/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,11 @@ spec:
107107
{{- if .Values.volumes.type.nfs }}
108108
nfs:
109109
server: {{ .Values.volumes.type.nfs.server }}
110+
{{- if .Values.volumes.rootDir }}
111+
path: {{ .Values.volumes.type.nfs.path }}/{{ .Values.volumes.rootDir }}
112+
{{- else }}
110113
path: {{ .Values.volumes.type.nfs.path }}/{{ .Release.Name }}
114+
{{- end }}
111115
readOnly: false
112116
{{- else }}
113117
persistentVolumeClaim:

chart/templates/initWebsiteDir.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,12 @@ spec:
3232
{{- range .Values.volumes.mountPath }}
3333
{{- $dirmap := regexSplit ":" . -1 -}}
3434
{{- $dir := slice $dirmap 0 1 | first -}}
35+
{{- if $.Values.volumes.rootDir -}}
36+
{{- $dirs_to_create = printf "%s %s/%s/%s" $dirs_to_create "/storage" $.Values.volumes.rootDir $dir }}
37+
{{- else }}
3538
{{- $dirs_to_create = printf "%s %s/%s/%s" $dirs_to_create "/storage" $.Release.Name $dir }}
3639
{{- end }}
40+
{{- end }}
3741
value: {{ $dirs_to_create }}
3842
- name: OWNERSHIP
3943
value: {{ .Values.volumes.ownership | default "root:root" }}
@@ -44,7 +48,7 @@ spec:
4448
args:
4549
- -c
4650
- >-
47-
mkdir -p $(WEBSITE_DIRS);
51+
mkdir -p $(WEBSITE_DIRS); chown -R $(OWNERSHIP) $(WEBSITE_DIRS);
4852
nodeSelector:
4953
{{- with .Values.nodeSelector }}
5054
{{- toYaml . | nindent 8 }}

chart/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ ingress:
2525
tls: {}
2626
volumes:
2727
enabled: false
28+
rootDir: ""
2829
mountPath: []
2930
ownership: ""
3031
type:

0 commit comments

Comments
 (0)