open-im-server/deploy_k8s/demo/deployment.yaml
wqy 05e9eec785 k8s部署描述文件建议调整
1.官网文档创建configmap名字已经从openim-config改为了config,部署文件内建议保持一致
2.创建usualConfig的configmap会报错,建议改成usual-config,官网文档建议改为
kubectl -n openim create configmap usual-config --from-file=config/usualConfig.yaml
3.调整了部分yaml缩紧格式更加正确
2022-11-30 13:38:47 +08:00

56 lines
1.2 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: demo-deployment
spec:
selector:
matchLabels:
app: demo # 选择这个指定标签执行
replicas: 1 # 运行pod数量
template:
metadata:
labels:
app: demo # 标签
spec:
containers:
- name: demo
image: openim/demo:v2.3.4
imagePullPolicy: Always
ports:
- containerPort: 10004
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: config
- name: usualConfig
configMap:
name: usual-config
strategy: #更新策略
type: RollingUpdate # 滚动更新
---
apiVersion: v1
kind: Service
metadata:
name: demo
spec:
ports:
- name: demo
protocol: TCP
port: 10004
targetPort: 10004
selector:
app: demo
type: NodePort