Commit eb90f3cf by 李辉02

feat(直接将/app/files/RevVideo /app/files/RevImages挂到主机上): ifs

parent 76dd12db
......@@ -19,20 +19,6 @@ spec:
app: {{ .Chart.Name }}
spec:
{{- include "app.imagePullSecrets" . | nindent 6 }}
initContainers:
- name: init-dirs
image: busybox:latest
command:
- sh
- -c
- |
{{- range $storage.initDirs }}
mkdir -p {{ $storage.mountPath }}/{{ . }}
{{- end }}
chmod -R 777 {{ $storage.mountPath }}
volumeMounts:
- name: app-files
mountPath: {{ $storage.mountPath }}
containers:
- image: {{ .Values.global.app.imageUrl }}{{ .Chart.Name }}:{{ index .Values.global .Chart.Name "imageVersion" }}
name: {{ .Chart.Name }}
......@@ -46,10 +32,14 @@ spec:
resources:
{{- include "app.resources" . | nindent 12 }}
volumeMounts:
- name: app-files
mountPath: {{ $storage.mountPath }}
{{- range $storage.volumes }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
{{- end }}
volumes:
- name: app-files
{{- range $storage.volumes }}
- name: {{ .name }}
hostPath:
path: {{ $storage.hostPath }}
type: DirectoryOrCreate
path: {{ .hostPath }}
type: DirectoryOrCreate
{{- end }}
......@@ -26,11 +26,12 @@ global:
charset: "utf8"
sslmode: "none"
allowUserVariables: "true"
# 存储配置 - 用于 /app/files/RevVideo/ 等目录
# 存储配置 - 直接挂载宿主机目录
storage:
mountPath: "/app/files"
hostPath: "/data/commander-ifs/files" # 宿主机目录
# 需要初始化创建的子目录列表
initDirs:
- RevVideo
- RevImages
volumes:
- name: rev-video
mountPath: "/app/files/RevVideo"
hostPath: "/data/commander-ifs/RevVideo"
- name: rev-images
mountPath: "/app/files/RevImages"
hostPath: "/data/commander-ifs/RevImages"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment