Files
open-im-server/deploy_k8s/api/deployment.yaml
T

44 lines
828 B
YAML
Raw Normal View History

2022-05-19 17:50:04 +08:00
---
apiVersion: apps/v1
2022-05-19 19:12:35 +08:00
kind: Deployment
2022-05-19 17:50:04 +08:00
metadata:
name: api-deployment
spec:
selector:
matchLabels:
app: api # 选择这个指定标签执行
replicas: 2 # 运行pod数量
template:
metadata:
labels:
app: api # 标签
spec:
containers:
2022-05-19 19:58:46 +08:00
- name: api
2022-05-20 10:42:33 +08:00
image: openim/api:v2.0.10
2022-05-19 19:58:46 +08:00
ports:
- containerPort: 10002
volumeMounts:
2022-05-19 19:56:49 +08:00
- name: config
2022-05-20 10:28:07 +08:00
mountPath: /Open-IM-Server/config
readOnly: true
2022-05-19 19:58:46 +08:00
volumes:
- name: config
configMap:
2022-05-19 20:05:37 +08:00
name: config
2022-05-19 19:03:27 +08:00
strategy: #更新策略
2022-05-19 17:50:04 +08:00
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: api
spec:
ports:
2022-05-23 00:55:56 +08:00
- name: api-port
2022-05-20 10:32:51 +08:00
protocol: TCP
2022-05-20 10:28:07 +08:00
port: 10002
targetPort: 10002
2022-05-19 17:50:04 +08:00
selector:
app: api