Commit 18ccba76 by 李辉02

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

parent 6eb30df1
{{- $storage := (index .Values.global .Chart.Name "storage") }}
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
...@@ -7,6 +8,8 @@ metadata: ...@@ -7,6 +8,8 @@ metadata:
app: {{ .Chart.Name }} app: {{ .Chart.Name }}
spec: spec:
replicas: {{ .Values.global.app.replicas }} replicas: {{ .Values.global.app.replicas }}
strategy:
type: Recreate
selector: selector:
matchLabels: matchLabels:
app: {{ .Chart.Name }} app: {{ .Chart.Name }}
...@@ -16,6 +19,20 @@ spec: ...@@ -16,6 +19,20 @@ spec:
app: {{ .Chart.Name }} app: {{ .Chart.Name }}
spec: spec:
{{- include "app.imagePullSecrets" . | nindent 6 }} {{- 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: containers:
- image: {{ .Values.global.app.imageUrl }}{{ .Chart.Name }}:{{ index .Values.global .Chart.Name "imageVersion" }} - image: {{ .Values.global.app.imageUrl }}{{ .Chart.Name }}:{{ index .Values.global .Chart.Name "imageVersion" }}
name: {{ .Chart.Name }} name: {{ .Chart.Name }}
...@@ -27,4 +44,11 @@ spec: ...@@ -27,4 +44,11 @@ spec:
- containerPort: {{ index .Values.global .Chart.Name "port" }} - containerPort: {{ index .Values.global .Chart.Name "port" }}
protocol: TCP protocol: TCP
resources: 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: ...@@ -19,10 +19,18 @@ global:
imageVersion: "2.1.2" imageVersion: "2.1.2"
port: 8090 port: 8090
database: database:
server: "10.100.16.66" server: "mysql-service.storage.svc.cluster.local"
database: "db_commander_2.0.8" database: "db_commander"
uid: "admin" uid: "commander_cpd_rm"
pwd: "superadmin" pwd: "XumBeK40fRIBc4Hw"
charset: "utf8" charset: "utf8"
sslmode: "none" sslmode: "none"
allowUserVariables: "true" 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