更新k8s deployment

This commit is contained in:
JACKYMYPERSON
2025-09-15 22:08:11 +08:00
parent 8ccf028ae4
commit cee789f31d
6 changed files with 76 additions and 2 deletions

View File

@@ -7,7 +7,7 @@ database:
params: "charset=utf8mb4&parseTime=True&loc=Local" params: "charset=utf8mb4&parseTime=True&loc=Local"
redis: redis:
host: "localhost" host: "localhost"
port: 6379 port: 30079
username: "default" username: "default"
password: "" password: ""
jwtsecret: "clka1af83af15vhyt8s652avre" jwtsecret: "clka1af83af15vhyt8s652avre"

View File

@@ -50,7 +50,7 @@ func Userkill(c *gin.Context) {
return return
} }
// 2. 发送MQ消息关键发送失败需回滚Redis // 2. 发送MQ消息
msgSent := false msgSent := false
defer func() { defer func() {
// 若消息未发送成功回滚Redis库存 // 若消息未发送成功回滚Redis库存

View File

@@ -0,0 +1,47 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
spec:
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
containers:
- name: minio
image: minio/minio:latest
args:
- server
- /storage
env:
- name: MINIO_ROOT_USER
value: "admin"
- name: MINIO_ROOT_PASSWORD
value: "password123"
ports:
- containerPort: 9000
- containerPort: 9001
volumeMounts:
- name: storage
mountPath: "/storage"
volumes:
- name: storage
persistentVolumeClaim:
claimName: minio-pvc
---
apiVersion: v1
kind: Service
metadata:
name: minio-service
spec:
selector:
app: minio
ports:
- protocol: TCP
port: 9000
targetPort: 9000
type: NodePort

View File

@@ -0,0 +1,10 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: minio-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: Service
metadata:
name: minio-service
spec:
selector:
app: minio # 确保与 MinIO Pod 标签一致
ports:
- name: minio-api # 服务端口(用于 API 访问)
port: 9000
targetPort: 9000
nodePort: 32690 # 已有的 NodePort
- name: minio-console # 新增控制台端口
port: 9001
targetPort: 9001
nodePort: 32691 # 新增 NodePort30000-32767 范围内选一个未占用的)
type: NodePort