添加qiming-rcoder模块
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: rcoder-credentials
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
POSTGRES_USER: {{ .Values.credentials.postgresql.user | quote }}
|
||||
POSTGRES_PASSWORD: {{ .Values.credentials.postgresql.password | quote }}
|
||||
MINIO_ROOT_USER: {{ .Values.credentials.minio.rootUser | quote }}
|
||||
MINIO_ROOT_PASSWORD: {{ .Values.credentials.minio.rootPassword | quote }}
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: rcoder-workspace
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: rcoder
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
# JuiceFS 原生支持 RWX, 多节点 rcoder pod 共享工作空间
|
||||
accessModes: ["ReadWriteMany"]
|
||||
storageClassName: {{ include "rcoder.storageClassName" . | quote }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.workspace.size | quote }}
|
||||
@@ -0,0 +1,26 @@
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: juicefs-secret
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
type: Opaque
|
||||
stringData:
|
||||
# JuiceFS CE 必需字段 (小写键名)
|
||||
name: "rcoder-juicefs"
|
||||
metaurl: {{ include "rcoder.juicefsMetaurl" . | quote }}
|
||||
storage: "minio"
|
||||
bucket: {{ include "rcoder.juicefsBucketUrl" . | quote }}
|
||||
access-key: {{ .Values.credentials.minio.rootUser | quote }}
|
||||
secret-key: {{ .Values.credentials.minio.rootPassword | quote }}
|
||||
|
||||
# 兼容字段 (保留给脚本/日志使用)
|
||||
METAURL: {{ include "rcoder.juicefsMetaurl" . | quote }}
|
||||
MINIO_ACCESS_KEY: {{ .Values.credentials.minio.rootUser | quote }}
|
||||
MINIO_SECRET_KEY: {{ .Values.credentials.minio.rootPassword | quote }}
|
||||
MINIO_ADDRESS: {{ printf "minio-service.%s:%d" .Release.Namespace (int .Values.minio.service.apiPort) | quote }}
|
||||
|
||||
# 其他配置
|
||||
APPEND_FSYNC: {{ .Values.juicefs.meta.appendFsync | quote }}
|
||||
CACHE_SIZE: {{ .Values.juicefs.meta.cacheSize | quote }}
|
||||
@@ -0,0 +1,25 @@
|
||||
{{- if .Values.juicefs.storageClass.create }}
|
||||
# JuiceFS StorageClass —— 集群级资源, 每个 release 独立命名
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: {{ include "rcoder.storageClassName" . }}
|
||||
labels:
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
storageclass.kubernetes.io/is-default-class: "false"
|
||||
provisioner: csi.juicefs.com
|
||||
parameters:
|
||||
csi.storage.k8s.io/provisioner-secret-name: juicefs-secret
|
||||
csi.storage.k8s.io/provisioner-secret-namespace: {{ .Release.Namespace }}
|
||||
csi.storage.k8s.io/controller-expand-secret-name: juicefs-secret
|
||||
csi.storage.k8s.io/controller-expand-secret-namespace: {{ .Release.Namespace }}
|
||||
csi.storage.k8s.io/node-publish-secret-name: juicefs-secret
|
||||
csi.storage.k8s.io/node-publish-secret-namespace: {{ .Release.Namespace }}
|
||||
juicefs/controllerQuotaSet: "false"
|
||||
juicefs/mountImage: {{ include "rcoder.thirdPartyImage" (dict "repository" .Values.juicefs.mountImage.repository "tag" .Values.juicefs.mountImage.tag "ctx" .) | quote }}
|
||||
juicefs/mountOptions: {{ .Values.juicefs.storageClass.mountOptions | quote }}
|
||||
reclaimPolicy: {{ .Values.juicefs.storageClass.reclaimPolicy }}
|
||||
allowVolumeExpansion: true
|
||||
volumeBindingMode: Immediate
|
||||
{{- end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
apiVersion: batch/v1
|
||||
kind: Job
|
||||
metadata:
|
||||
name: minio-init
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
annotations:
|
||||
# 每次 helm upgrade 强制重新运行 (确保 bucket 一定存在, 即使 Job 已清理)
|
||||
helm.sh/hook: post-install,post-upgrade
|
||||
helm.sh/hook-weight: "5"
|
||||
helm.sh/hook-delete-policy: before-hook-creation
|
||||
spec:
|
||||
ttlSecondsAfterFinished: 300
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
{{- include "rcoder.imagePullSecrets" . | nindent 6 }}
|
||||
containers:
|
||||
- name: mc
|
||||
image: {{ include "rcoder.thirdPartyImage" (dict "repository" .Values.minio.initImage.repository "tag" .Values.minio.initImage.tag "ctx" .) }}
|
||||
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
echo "Waiting for MinIO to be ready..."
|
||||
until mc alias set myminio http://minio:{{ .Values.minio.service.apiPort }} ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD}; do
|
||||
echo "MinIO not ready, retrying..."
|
||||
sleep 2
|
||||
done
|
||||
|
||||
echo "MinIO is ready, creating bucket..."
|
||||
mc mb myminio/{{ .Values.minio.bucket }} --ignore-existing
|
||||
mc ls myminio/
|
||||
echo "MinIO initialization completed!"
|
||||
env:
|
||||
- name: MINIO_ROOT_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rcoder-credentials
|
||||
key: MINIO_ROOT_USER
|
||||
- name: MINIO_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rcoder-credentials
|
||||
key: MINIO_ROOT_PASSWORD
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
# Headless Service for StatefulSet
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: minio
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: minio
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
clusterIP: None
|
||||
selector:
|
||||
app: minio
|
||||
ports:
|
||||
- name: api
|
||||
port: {{ .Values.minio.service.apiPort }}
|
||||
targetPort: {{ .Values.minio.service.apiPort }}
|
||||
- name: console
|
||||
port: {{ .Values.minio.service.consolePort }}
|
||||
targetPort: {{ .Values.minio.service.consolePort }}
|
||||
---
|
||||
# ClusterIP Service for internal access
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: minio-service
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: minio
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
app: minio
|
||||
ports:
|
||||
- name: api
|
||||
port: {{ .Values.minio.service.apiPort }}
|
||||
targetPort: {{ .Values.minio.service.apiPort }}
|
||||
- name: console
|
||||
port: {{ .Values.minio.service.consolePort }}
|
||||
targetPort: {{ .Values.minio.service.consolePort }}
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: minio-pvc
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: minio
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
{{- if .Values.minio.storage.storageClass }}
|
||||
storageClassName: {{ .Values.minio.storage.storageClass | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.minio.storage.size | quote }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: minio
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: minio
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
serviceName: minio
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: minio
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: minio
|
||||
{{- include "rcoder.labels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- include "rcoder.imagePullSecrets" . | nindent 6 }}
|
||||
containers:
|
||||
- name: minio
|
||||
image: {{ include "rcoder.thirdPartyImage" (dict "repository" .Values.minio.image.repository "tag" .Values.minio.image.tag "ctx" .) }}
|
||||
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.minio.service.apiPort }}
|
||||
name: api
|
||||
- containerPort: {{ .Values.minio.service.consolePort }}
|
||||
name: console
|
||||
env:
|
||||
- name: MINIO_ROOT_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rcoder-credentials
|
||||
key: MINIO_ROOT_USER
|
||||
- name: MINIO_ROOT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rcoder-credentials
|
||||
key: MINIO_ROOT_PASSWORD
|
||||
args:
|
||||
- server
|
||||
- /data
|
||||
- --console-address
|
||||
- ":{{ .Values.minio.service.consolePort }}"
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /minio/health/live
|
||||
port: {{ .Values.minio.service.apiPort }}
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /minio/health/ready
|
||||
port: {{ .Values.minio.service.apiPort }}
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
volumeMounts:
|
||||
- name: minio-data
|
||||
mountPath: /data
|
||||
volumes:
|
||||
- name: minio-data
|
||||
persistentVolumeClaim:
|
||||
claimName: minio-pvc
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgresql
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: postgresql
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
app: postgresql
|
||||
ports:
|
||||
- name: postgres
|
||||
port: {{ .Values.postgresql.service.port }}
|
||||
targetPort: {{ .Values.postgresql.service.port }}
|
||||
@@ -0,0 +1,84 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgresql-pvc
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: postgresql
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
accessModes: ["ReadWriteOnce"]
|
||||
{{- if .Values.postgresql.storage.storageClass }}
|
||||
storageClassName: {{ .Values.postgresql.storage.storageClass | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.postgresql.storage.size | quote }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: postgresql
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
app: postgresql
|
||||
{{- include "rcoder.labels" . | nindent 4 }}
|
||||
spec:
|
||||
serviceName: postgresql
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgresql
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgresql
|
||||
{{- include "rcoder.labels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- include "rcoder.imagePullSecrets" . | nindent 6 }}
|
||||
initContainers:
|
||||
- name: cleanup
|
||||
image: {{ include "rcoder.thirdPartyImage" (dict "repository" .Values.postgresql.image.repository "tag" .Values.postgresql.image.tag "ctx" .) }}
|
||||
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
||||
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
containers:
|
||||
- name: postgresql
|
||||
image: {{ include "rcoder.thirdPartyImage" (dict "repository" .Values.postgresql.image.repository "tag" .Values.postgresql.image.tag "ctx" .) }}
|
||||
imagePullPolicy: {{ .Values.global.imagePullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.postgresql.service.port }}
|
||||
name: postgres
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: "juicefs"
|
||||
- name: POSTGRES_USER
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rcoder-credentials
|
||||
key: POSTGRES_USER
|
||||
- name: POSTGRES_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: rcoder-credentials
|
||||
key: POSTGRES_PASSWORD
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ["pg_isready", "-U", {{ .Values.credentials.postgresql.user | quote }}]
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ["pg_isready", "-U", {{ .Values.credentials.postgresql.user | quote }}]
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 5
|
||||
volumeMounts:
|
||||
- name: postgres-data
|
||||
mountPath: /var/lib/postgresql/data
|
||||
volumes:
|
||||
- name: postgres-data
|
||||
persistentVolumeClaim:
|
||||
claimName: postgresql-pvc
|
||||
Reference in New Issue
Block a user