Browse Source

修改部署文件部署华为云

pull/142/head
chenzhihang 1 year ago
parent
commit
3732c2f022
11 changed files with 439 additions and 0 deletions
  1. +36
    -0
      k8s/template-yaml-aim/k8s-10gen.yaml
  2. +36
    -0
      k8s/template-yaml-aim/k8s-11visual.yaml
  3. +36
    -0
      k8s/template-yaml-aim/k8s-12front.yaml
  4. +71
    -0
      k8s/template-yaml-aim/k8s-3nacos.yaml
  5. +36
    -0
      k8s/template-yaml-aim/k8s-4gateway.yaml
  6. +36
    -0
      k8s/template-yaml-aim/k8s-5auth.yaml
  7. +36
    -0
      k8s/template-yaml-aim/k8s-6system.yaml
  8. +54
    -0
      k8s/template-yaml-aim/k8s-7management.yaml
  9. +36
    -0
      k8s/template-yaml-aim/k8s-8file.yaml
  10. +36
    -0
      k8s/template-yaml-aim/k8s-9job.yaml
  11. +26
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/RedisUtil.java

+ 36
- 0
k8s/template-yaml-aim/k8s-10gen.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-gen-deployment
namespace: ci4s-test
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-gen
template:
metadata:
labels:
app: ci4s-gen
spec:
containers:
- name: ci4s-gen
image: ${k8s-10gen-image}
ports:
- containerPort: 9202

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-gen-service
namespace: ci4s-test
spec:
type: NodePort
ports:
- port: 9202
nodePort: 31211
protocol: TCP
selector:
app: ci4s-gen


+ 36
- 0
k8s/template-yaml-aim/k8s-11visual.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-visual-deployment
namespace: ci4s-test
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-visual
template:
metadata:
labels:
app: ci4s-visual
spec:
containers:
- name: ci4s-visual
image: ${k8s-11visual-image}
ports:
- containerPort: 9100

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-visual-service
namespace: ci4s-test
spec:
type: NodePort
ports:
- port: 9100
nodePort: 31212
protocol: TCP
selector:
app: ci4s-visual


+ 36
- 0
k8s/template-yaml-aim/k8s-12front.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-front-deployment
namespace: argo
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-front
template:
metadata:
labels:
app: ci4s-front
spec:
containers:
- name: ci4s-front
image: ccr.ccs.tencentyun.com/somunslotus/ci4s-front:20241024-arm
ports:
- containerPort: 8000

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-front-service
namespace: argo
spec:
type: NodePort
ports:
- port: 8000
nodePort: 31213
protocol: TCP
selector:
app: ci4s-front


+ 71
- 0
k8s/template-yaml-aim/k8s-3nacos.yaml View File

@@ -0,0 +1,71 @@
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: argo
name: nacos-ci4s
labels:
app: nacos-ci4s
spec:
replicas: 1
selector:
matchLabels:
app: nacos-ci4s
template:
metadata:
labels:
app: nacos-ci4s
spec:
containers:
- name: nacos-ci4s
image: nacos/nacos-server:v2.2.0
env:
- name: SPRING_DATASOURCE_PLATFORM
value: mysql
- name: MODE
value: standalone
- name: MYSQL_SERVICE_HOST
value: mysql.argo.svc
- name: MYSQL_SERVICE_PORT
value: "3306"
- name: MYSQL_SERVICE_DB_NAME
value: nacos-ci4s-config
- name: MYSQL_SERVICE_USER
value: root
- name: MYSQL_SERVICE_PASSWORD
value: qazxc123456.
ports:
- containerPort: 8848
- containerPort: 9848
- containerPort: 9849
initContainers:
- name: init-mydb
image: busybox:1.31
command: [ 'sh', '-c', 'nc -zv mysql.argo.svc 3306' ]
restartPolicy: Always

---

apiVersion: v1
kind: Service
metadata:
namespace: argo
name: nacos-ci4s
labels:
app: nacos-ci4s
spec:
type: NodePort
selector:
app: nacos-ci4s
ports:
- port: 8848
targetPort: 8848
nodePort: 31203
name: web
- port: 9848
targetPort: 9848
nodePort: 32203
name: podsa
- port: 9849
targetPort: 9849
nodePort: 32204
name: tcp-9849

+ 36
- 0
k8s/template-yaml-aim/k8s-4gateway.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-gateway-deployment
namespace: argo
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-gateway
template:
metadata:
labels:
app: ci4s-gateway
spec:
containers:
- name: ci4s-gateway
image: ccr.ccs.tencentyun.com/somunslotus/ci4s-gateway:20241024-arm
ports:
- containerPort: 8082

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-gateway-service
namespace: argo
spec:
type: NodePort
ports:
- port: 8082
nodePort: 31205
protocol: TCP
selector:
app: ci4s-gateway


+ 36
- 0
k8s/template-yaml-aim/k8s-5auth.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-auth-deployment
namespace: argo
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-auth
template:
metadata:
labels:
app: ci4s-auth
spec:
containers:
- name: ci4s-auth
image: ccr.ccs.tencentyun.com/somunslotus/ci4s-auth:20241024-arm
ports:
- containerPort: 9200

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-auth-service
namespace: argo
spec:
type: NodePort
ports:
- port: 9200
nodePort: 31206
protocol: TCP
selector:
app: ci4s-auth


+ 36
- 0
k8s/template-yaml-aim/k8s-6system.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-system-deployment
namespace: argo
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-system
template:
metadata:
labels:
app: ci4s-system
spec:
containers:
- name: ci4s-system
image: ccr.ccs.tencentyun.com/somunslotus/ci4s-system:20241024-arm
ports:
- containerPort: 9201

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-system-service
namespace: argo
spec:
type: NodePort
ports:
- port: 9201
nodePort: 31207
protocol: TCP
selector:
app: ci4s-system


+ 54
- 0
k8s/template-yaml-aim/k8s-7management.yaml View File

@@ -0,0 +1,54 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-management-platform-deployment
namespace: argo
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-management-platform
template:
metadata:
labels:
app: ci4s-management-platform
spec:
containers:
- name: ci4s-management-platform
image: ccr.ccs.tencentyun.com/somunslotus/ci4s-managent:20241024-arm
env:
- name: TZ
value: Asia/Shanghai
- name: JAVA_TOOL_OPTIONS
value: "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:5005"
ports:
- containerPort: 9213
volumeMounts:
- name: resource-volume
mountPath: /home/resource/
subPath: mini-model-platform-data
volumes:
- name: resource-volume
hostPath:
path: /platform-data
---
apiVersion: v1
kind: Service
metadata:
name: ci4s-management-platform-service
namespace: argo
spec:
type: NodePort
ports:
- name: http
port: 9213
nodePort: 31208
protocol: TCP
- name: debug
nodePort: 31219
port: 5005
protocol: TCP
targetPort: 5005
selector:
app: ci4s-management-platform


+ 36
- 0
k8s/template-yaml-aim/k8s-8file.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-file-deployment
namespace: ci4s-test
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-file
template:
metadata:
labels:
app: ci4s-file
spec:
containers:
- name: ci4s-file
image: ${k8s-8file-image}
ports:
- containerPort: 9300

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-file-service
namespace: ci4s-test
spec:
type: NodePort
ports:
- port: 9300
nodePort: 31209
protocol: TCP
selector:
app: ci4s-file


+ 36
- 0
k8s/template-yaml-aim/k8s-9job.yaml View File

@@ -0,0 +1,36 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: ci4s-job-deployment
namespace: ci4s-test
spec:
replicas: 1
selector:
matchLabels:
app: ci4s-job
template:
metadata:
labels:
app: ci4s-job
spec:
containers:
- name: ci4s-job
image: ${k8s-9job-image}
ports:
- containerPort: 9203

---
apiVersion: v1
kind: Service
metadata:
name: ci4s-job-service
namespace: ci4s-test
spec:
type: NodePort
ports:
- port: 9203
nodePort: 31210
protocol: TCP
selector:
app: ci4s-job


+ 26
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/RedisUtil.java View File

@@ -0,0 +1,26 @@
package com.ruoyi.platform.utils;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import redis.clients.jedis.Jedis;

@Component
public class RedisUtil {

@Value("${spring.redis.host}")
private String redisHost;
@Value("${spring.redis.port}")
private Integer redisPort;
@Value("${spring.redis.password}")
private Integer redisPassword;

public Jedis getJedis() {
Jedis jedis = new Jedis(redisHost, redisPort);
String response = jedis.auth(redisPassword);
if ("OK".equals(response)) {
return jedis;
} else {
throw new IllegalStateException("redis密码错误");
}
}
}

Loading…
Cancel
Save