Commit 18ccba76 by 李辉02

feat(使用pvc挂载目录): ifs

parent 6eb30df1
{{- $storage := (index .Values.global .Chart.Name "storage") }}
apiVersion: apps/v1
kind: Deployment
metadata:
......@@ -7,6 +8,8 @@ metadata:
app: {{ .Chart.Name }}
spec:
replicas: {{ .Values.global.app.replicas }}
strategy:
type: Recreate
selector:
matchLabels:
app: {{ .Chart.Name }}
......@@ -16,6 +19,20 @@ 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 }}
......@@ -27,4 +44,11 @@ spec:
- containerPort: {{ index .Values.global .Chart.Name "port" }}
protocol: TCP
resources:
{{- include "app.resources" . | nindent 12 }}
{{- include "app.resources" . | nindent 12 }}
volumeMounts:
- name: app-files
mountPath: {{ $storage.mountPath }}
volumes:
- name: app-files
persistentVolumeClaim:
claimName: {{ .Chart.Name }}-pvc
{{- $storage := (index .Values.global .Chart.Name "storage") }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Chart.Name }}-pvc
namespace: {{ .Values.global.app.namespace }}
labels:
app: {{ .Chart.Name }}
spec:
accessModes:
- {{ $storage.accessMode | default "ReadWriteOnce" }}
resources:
requests:
storage: {{ $storage.size | quote }}
storageClassName: {{ $storage.storageClassName | quote }}
......@@ -19,10 +19,18 @@ global:
imageVersion: "2.1.2"
port: 8090
database:
server: "10.100.16.66"
database: "db_commander_2.0.8"
uid: "admin"
pwd: "superadmin"
server: "mysql-service.storage.svc.cluster.local"
database: "db_commander"
uid: "commander_cpd_rm"
pwd: "XumBeK40fRIBc4Hw"
charset: "utf8"
sslmode: "none"
allowUserVariables: "true"
# 存储配置 - 用于 /app/files/RevVideo/ 等目录
storage:
size: "20Gi"
mountPath: "/app/files"
# 需要初始化创建的子目录列表
initDirs:
- RevVideo
- 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