parent
9abff13008
commit
01ccb6f404
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_api $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,56 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: api-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: api # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: api # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: api
|
||||
image: openim/api:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10002
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: api
|
||||
spec:
|
||||
ports:
|
||||
- name: api-port
|
||||
protocol: TCP
|
||||
port: 10002
|
||||
targetPort: 10002
|
||||
selector:
|
||||
app: api
|
||||
type: NodePort
|
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_auth $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,42 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: auth-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: auth # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: auth # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: auth
|
||||
image: openim/auth:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10160
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
@ -1,30 +0,0 @@
|
||||
#/bin/sh
|
||||
source ./path_info.cfg
|
||||
|
||||
# images version
|
||||
version=v2.3.4
|
||||
git pull
|
||||
cd ../script/; ./build_all_service.sh
|
||||
cd ../deploy_k8s/
|
||||
|
||||
for i in ${service[*]}
|
||||
do
|
||||
mv ../bin/open_im_${i} ./${i}/
|
||||
done
|
||||
|
||||
echo "move success"
|
||||
|
||||
echo "start to build images"
|
||||
|
||||
for i in ${service[*]}
|
||||
do
|
||||
echo "start to build images" $i
|
||||
cd $i
|
||||
image="openim/${i}:$version"
|
||||
docker build -t $image . -f ./${i}.Dockerfile
|
||||
echo "build ${dockerfile} success"
|
||||
docker push $image
|
||||
echo "push ${image} success "
|
||||
cd ..
|
||||
done
|
||||
|
@ -1,18 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_conversation $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,44 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: conversation-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: conversation # 选择这个指定标签执行
|
||||
replicas: 2 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: conversation # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: conversation
|
||||
image: openim/conversation:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10230
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
||||
|
@ -1,43 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: friend-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: friend # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: friend # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: friend
|
||||
image: openim/friend:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10120
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
||||
|
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_friend $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,42 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: group-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: group # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: group # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: group
|
||||
image: openim/group:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10150
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_group $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,47 +0,0 @@
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
nginx.ingress.kubernetes.io/proxy-http-version: "1.1"
|
||||
nginx.ingress.kubernetes.io/proxy-read-timeout: "3600"
|
||||
nginx.ingress.kubernetes.io/proxy-send-timeout: "3600"
|
||||
name: msg-gateway-ingress
|
||||
spec:
|
||||
rules:
|
||||
- host: msg-gateway.openim.xxx.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: msg-gateway
|
||||
port:
|
||||
number: 10001
|
||||
path: /
|
||||
pathType: Prefix
|
||||
---
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: "nginx"
|
||||
nginx.ingress.kubernetes.io/Access-Control-Allow-Origin: '*'
|
||||
nginx.ingress.kubernetes.io/cors-allow-headers: DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization,x-auth-token,Pagination
|
||||
nginx.ingress.kubernetes.io/cors-allow-methods: 'PUT, GET, POST, OPTIONS'
|
||||
nginx.ingress.kubernetes.io/cors-allow-origin: '*'
|
||||
nginx.ingress.kubernetes.io/enable-cors: 'true'
|
||||
nginx.ingress.kubernetes.io/service-weight: ''
|
||||
name: api-ingress
|
||||
spec:
|
||||
rules:
|
||||
- host: api.openim.xxx.com
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: api
|
||||
port:
|
||||
number: 10002
|
||||
path: /
|
||||
pathType: Prefix
|
@ -1,11 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
source ./path_info.cfg
|
||||
|
||||
#mkdir -p /db/sdk #path for jssdk sqlite
|
||||
|
||||
for i in ${service[*]}
|
||||
do
|
||||
kubectl -n openim apply -f ./${i}/deployment.yaml
|
||||
done
|
||||
|
@ -1,26 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
service=(
|
||||
#api service file
|
||||
api
|
||||
#rpc service file
|
||||
user
|
||||
friend
|
||||
group
|
||||
auth
|
||||
conversation
|
||||
msg-gateway
|
||||
msg-transfer
|
||||
msg
|
||||
push
|
||||
)
|
||||
|
||||
for i in ${service[*]}
|
||||
do
|
||||
kubectl -n openim delete deployment "${i}-deployment"
|
||||
done
|
||||
|
||||
kubectl -n openim delete service api
|
||||
kubectl -n openim delete service msg-gateway
|
||||
|
||||
echo done
|
@ -1,42 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: msg-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: msg # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: msg # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: msg
|
||||
image: openim/msg:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10130
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
@ -1,20 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_msg $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: msg-gateway-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: msg-gateway # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: msg-gateway # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: msg-gateway
|
||||
image: openim/msg_gateway:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- name: rpc-port
|
||||
containerPort: 10140
|
||||
- name: ws-port
|
||||
containerPort: 10001
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: msg-gateway
|
||||
spec:
|
||||
ports:
|
||||
- name: msg-gateway-port
|
||||
protocol: TCP
|
||||
port: 10001
|
||||
targetPort: ws-port
|
||||
selector:
|
||||
app: msg-gateway
|
||||
type: NodePort
|
||||
|
||||
|
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_msg_gateway $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,40 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: msg-transfer-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: msg-transfer # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: msg-transfer # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: msg-transfer
|
||||
image: openim/msg_transfer:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_msg_transfer $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,15 +0,0 @@
|
||||
#/bin/sh
|
||||
service=(
|
||||
#api service file
|
||||
api
|
||||
#rpc service file
|
||||
user
|
||||
friend
|
||||
group
|
||||
auth
|
||||
conversation
|
||||
msg_gateway
|
||||
msg_transfer
|
||||
msg
|
||||
push
|
||||
)
|
@ -1,42 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: push-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: push # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: push # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: push
|
||||
image: openim/push:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
ports:
|
||||
- containerPort: 10170
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
@ -1,20 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_push $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,40 +0,0 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: user-deployment
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: user # 选择这个指定标签执行
|
||||
replicas: 1 # 运行pod数量
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: user # 标签
|
||||
spec:
|
||||
containers:
|
||||
- name: user
|
||||
image: openim/user:v2.3.4
|
||||
# imagePullPolicy: Always
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
- name: usualConfig
|
||||
mountPath: /Open-IM-Server/config
|
||||
readOnly: true
|
||||
env:
|
||||
- name: CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
- name: USUAL_CONFIG_NAME
|
||||
value: "/Open-IM-Server"
|
||||
volumes:
|
||||
- name: config
|
||||
configMap:
|
||||
name: openim-config
|
||||
- name: usualConfig
|
||||
configMap:
|
||||
name: openim-usualConfig
|
||||
strategy: #更新策略
|
||||
type: RollingUpdate # 滚动更新
|
@ -1,19 +0,0 @@
|
||||
FROM ubuntu
|
||||
|
||||
# 设置固定的项目路径
|
||||
ENV WORKDIR /Open-IM-Server
|
||||
ENV CMDDIR $WORKDIR/cmd
|
||||
ENV CONFIG_NAME $WORKDIR/config/config.yaml
|
||||
|
||||
# 将可执行文件复制到目标目录
|
||||
ADD ./open_im_user $WORKDIR/cmd/main
|
||||
|
||||
# 创建用于挂载的几个目录,添加可执行权限
|
||||
RUN mkdir $WORKDIR/logs $WORKDIR/config $WORKDIR/script && \
|
||||
chmod +x $WORKDIR/cmd/main
|
||||
|
||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script"]
|
||||
|
||||
|
||||
WORKDIR $CMDDIR
|
||||
CMD ./main
|
@ -1,119 +0,0 @@
|
||||
package group
|
||||
|
||||
import (
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||
pbGroup "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
|
||||
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
||||
"time"
|
||||
)
|
||||
|
||||
func DbToPbGroupInfo(m *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
||||
return &sdkws.GroupInfo{
|
||||
GroupID: m.GroupID,
|
||||
GroupName: m.GroupName,
|
||||
Notification: m.Notification,
|
||||
Introduction: m.Introduction,
|
||||
FaceURL: m.FaceURL,
|
||||
OwnerUserID: ownerUserID,
|
||||
CreateTime: m.CreateTime.UnixMilli(),
|
||||
MemberCount: memberCount,
|
||||
Ex: m.Ex,
|
||||
Status: m.Status,
|
||||
CreatorUserID: m.CreatorUserID,
|
||||
GroupType: m.GroupType,
|
||||
NeedVerification: m.NeedVerification,
|
||||
LookMemberInfo: m.LookMemberInfo,
|
||||
ApplyMemberFriend: m.ApplyMemberFriend,
|
||||
NotificationUpdateTime: m.NotificationUpdateTime.UnixMilli(),
|
||||
NotificationUserID: m.NotificationUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func PbToDbGroupRequest(req *pbGroup.GroupApplicationResponseReq, handleUserID string) *relation.GroupRequestModel {
|
||||
return &relation.GroupRequestModel{
|
||||
UserID: req.FromUserID,
|
||||
GroupID: req.GroupID,
|
||||
HandleResult: req.HandleResult,
|
||||
HandledMsg: req.HandledMsg,
|
||||
HandleUserID: handleUserID,
|
||||
HandledTime: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
func DbToPbCMSGroup(m *relation.GroupModel, ownerUserID string, ownerUserName string, memberCount uint32) *pbGroup.CMSGroup {
|
||||
return &pbGroup.CMSGroup{
|
||||
GroupInfo: DbToPbGroupInfo(m, ownerUserID, memberCount),
|
||||
GroupOwnerUserID: ownerUserID,
|
||||
GroupOwnerUserName: ownerUserName,
|
||||
}
|
||||
}
|
||||
|
||||
func DbToPbGroupMembersCMSResp(m *relation.GroupMemberModel) *sdkws.GroupMemberFullInfo {
|
||||
return &sdkws.GroupMemberFullInfo{
|
||||
GroupID: m.GroupID,
|
||||
UserID: m.UserID,
|
||||
RoleLevel: m.RoleLevel,
|
||||
JoinTime: m.JoinTime.UnixMilli(),
|
||||
Nickname: m.Nickname,
|
||||
FaceURL: m.FaceURL,
|
||||
//AppMangerLevel: m.AppMangerLevel,
|
||||
JoinSource: m.JoinSource,
|
||||
OperatorUserID: m.OperatorUserID,
|
||||
Ex: m.Ex,
|
||||
MuteEndTime: m.MuteEndTime.UnixMilli(),
|
||||
InviterUserID: m.InviterUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func DbToPbGroupRequest(m *relation.GroupRequestModel, user *sdkws.PublicUserInfo, group *sdkws.GroupInfo) *sdkws.GroupRequest {
|
||||
return &sdkws.GroupRequest{
|
||||
UserInfo: user,
|
||||
GroupInfo: group,
|
||||
HandleResult: m.HandleResult,
|
||||
ReqMsg: m.ReqMsg,
|
||||
HandleMsg: m.HandledMsg,
|
||||
ReqTime: m.ReqTime.UnixMilli(),
|
||||
HandleUserID: m.HandleUserID,
|
||||
HandleTime: m.HandledTime.UnixMilli(),
|
||||
Ex: m.Ex,
|
||||
JoinSource: m.JoinSource,
|
||||
InviterUserID: m.InviterUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func DbToPbGroupAbstractInfo(groupID string, groupMemberNumber uint32, groupMemberListHash uint64) *pbGroup.GroupAbstractInfo {
|
||||
return &pbGroup.GroupAbstractInfo{
|
||||
GroupID: groupID,
|
||||
GroupMemberNumber: groupMemberNumber,
|
||||
GroupMemberListHash: groupMemberListHash,
|
||||
}
|
||||
}
|
||||
|
||||
func PbToDBGroupInfo(m *sdkws.GroupInfo) *relation.GroupModel {
|
||||
return &relation.GroupModel{
|
||||
GroupID: m.GroupID,
|
||||
GroupName: m.GroupName,
|
||||
Notification: m.Notification,
|
||||
Introduction: m.Introduction,
|
||||
FaceURL: m.FaceURL,
|
||||
CreateTime: time.Now(),
|
||||
Ex: m.Ex,
|
||||
Status: m.Status,
|
||||
CreatorUserID: m.CreatorUserID,
|
||||
GroupType: m.GroupType,
|
||||
NeedVerification: m.NeedVerification,
|
||||
LookMemberInfo: m.LookMemberInfo,
|
||||
ApplyMemberFriend: m.ApplyMemberFriend,
|
||||
NotificationUpdateTime: time.UnixMilli(m.NotificationUpdateTime),
|
||||
NotificationUserID: m.NotificationUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func PbToDbGroupMember(m *sdkws.UserInfo) *relation.GroupMemberModel {
|
||||
return &relation.GroupMemberModel{
|
||||
UserID: m.UserID,
|
||||
Nickname: m.Nickname,
|
||||
FaceURL: m.FaceURL,
|
||||
Ex: m.Ex,
|
||||
}
|
||||
}
|
@ -1 +1,120 @@
|
||||
package convert
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/OpenIMSDK/Open-IM-Server/pkg/common/db/table/relation"
|
||||
pbGroup "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
|
||||
sdkws "github.com/OpenIMSDK/Open-IM-Server/pkg/proto/sdkws"
|
||||
)
|
||||
|
||||
func Db2PbGroupInfo(m *relation.GroupModel, ownerUserID string, memberCount uint32) *sdkws.GroupInfo {
|
||||
return &sdkws.GroupInfo{
|
||||
GroupID: m.GroupID,
|
||||
GroupName: m.GroupName,
|
||||
Notification: m.Notification,
|
||||
Introduction: m.Introduction,
|
||||
FaceURL: m.FaceURL,
|
||||
OwnerUserID: ownerUserID,
|
||||
CreateTime: m.CreateTime.UnixMilli(),
|
||||
MemberCount: memberCount,
|
||||
Ex: m.Ex,
|
||||
Status: m.Status,
|
||||
CreatorUserID: m.CreatorUserID,
|
||||
GroupType: m.GroupType,
|
||||
NeedVerification: m.NeedVerification,
|
||||
LookMemberInfo: m.LookMemberInfo,
|
||||
ApplyMemberFriend: m.ApplyMemberFriend,
|
||||
NotificationUpdateTime: m.NotificationUpdateTime.UnixMilli(),
|
||||
NotificationUserID: m.NotificationUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func Pb2DbGroupRequest(req *pbGroup.GroupApplicationResponseReq, handleUserID string) *relation.GroupRequestModel {
|
||||
return &relation.GroupRequestModel{
|
||||
UserID: req.FromUserID,
|
||||
GroupID: req.GroupID,
|
||||
HandleResult: req.HandleResult,
|
||||
HandledMsg: req.HandledMsg,
|
||||
HandleUserID: handleUserID,
|
||||
HandledTime: time.Now(),
|
||||
}
|
||||
}
|
||||
|
||||
func Db2PbCMSGroup(m *relation.GroupModel, ownerUserID string, ownerUserName string, memberCount uint32) *pbGroup.CMSGroup {
|
||||
return &pbGroup.CMSGroup{
|
||||
GroupInfo: Db2PbGroupInfo(m, ownerUserID, memberCount),
|
||||
GroupOwnerUserID: ownerUserID,
|
||||
GroupOwnerUserName: ownerUserName,
|
||||
}
|
||||
}
|
||||
|
||||
func Db2PbGroupMembersCMSResp(m *relation.GroupMemberModel) *sdkws.GroupMemberFullInfo {
|
||||
return &sdkws.GroupMemberFullInfo{
|
||||
GroupID: m.GroupID,
|
||||
UserID: m.UserID,
|
||||
RoleLevel: m.RoleLevel,
|
||||
JoinTime: m.JoinTime.UnixMilli(),
|
||||
Nickname: m.Nickname,
|
||||
FaceURL: m.FaceURL,
|
||||
//AppMangerLevel: m.AppMangerLevel,
|
||||
JoinSource: m.JoinSource,
|
||||
OperatorUserID: m.OperatorUserID,
|
||||
Ex: m.Ex,
|
||||
MuteEndTime: m.MuteEndTime.UnixMilli(),
|
||||
InviterUserID: m.InviterUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func Db2PbGroupRequest(m *relation.GroupRequestModel, user *sdkws.PublicUserInfo, group *sdkws.GroupInfo) *sdkws.GroupRequest {
|
||||
return &sdkws.GroupRequest{
|
||||
UserInfo: user,
|
||||
GroupInfo: group,
|
||||
HandleResult: m.HandleResult,
|
||||
ReqMsg: m.ReqMsg,
|
||||
HandleMsg: m.HandledMsg,
|
||||
ReqTime: m.ReqTime.UnixMilli(),
|
||||
HandleUserID: m.HandleUserID,
|
||||
HandleTime: m.HandledTime.UnixMilli(),
|
||||
Ex: m.Ex,
|
||||
JoinSource: m.JoinSource,
|
||||
InviterUserID: m.InviterUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func Db2PbGroupAbstractInfo(groupID string, groupMemberNumber uint32, groupMemberListHash uint64) *pbGroup.GroupAbstractInfo {
|
||||
return &pbGroup.GroupAbstractInfo{
|
||||
GroupID: groupID,
|
||||
GroupMemberNumber: groupMemberNumber,
|
||||
GroupMemberListHash: groupMemberListHash,
|
||||
}
|
||||
}
|
||||
|
||||
func Pb2DBGroupInfo(m *sdkws.GroupInfo) *relation.GroupModel {
|
||||
return &relation.GroupModel{
|
||||
GroupID: m.GroupID,
|
||||
GroupName: m.GroupName,
|
||||
Notification: m.Notification,
|
||||
Introduction: m.Introduction,
|
||||
FaceURL: m.FaceURL,
|
||||
CreateTime: time.Now(),
|
||||
Ex: m.Ex,
|
||||
Status: m.Status,
|
||||
CreatorUserID: m.CreatorUserID,
|
||||
GroupType: m.GroupType,
|
||||
NeedVerification: m.NeedVerification,
|
||||
LookMemberInfo: m.LookMemberInfo,
|
||||
ApplyMemberFriend: m.ApplyMemberFriend,
|
||||
NotificationUpdateTime: time.UnixMilli(m.NotificationUpdateTime),
|
||||
NotificationUserID: m.NotificationUserID,
|
||||
}
|
||||
}
|
||||
|
||||
func Pb2DbGroupMember(m *sdkws.UserInfo) *relation.GroupMemberModel {
|
||||
return &relation.GroupMemberModel{
|
||||
UserID: m.UserID,
|
||||
Nickname: m.Nickname,
|
||||
FaceURL: m.FaceURL,
|
||||
Ex: m.Ex,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue