pull/232/head
wangchuxiao 3 years ago
parent e048813c43
commit e8e4af7286

@ -1,92 +1,31 @@
--- ---
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: Deployment
metadata: metadata:
name: admin-cms name: api-deployment
spec: spec:
podManagementPolicy: OrderedReady
replicas: 1
revisionHistoryLimit: 10
selector: selector:
matchLabels: matchLabels:
app: admin-cms app: admin_cms # 选择这个指定标签执行
workload.auth.cattle.io/workloadselector: statefulSet-openim-admin-cms replicas: 2 # 运行pod数量
serviceName: admin-cms
template: template:
metadata: metadata:
labels: labels:
app: admin-cms app: api # 标签
workload.auth.cattle.io/workloadselector: statefulSet-openim-admin-cms
spec: spec:
containers: containers:
- image: "IMAGE_TAG" - name: api
env: image: openim/api:v2.0.10
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: NODE_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.hostIP
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
- name: NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
ports: ports:
- name: p11000 - containerPort: 10002
protocol: TCP
containerPort: 11000
imagePullPolicy: Always
name: admin-cms
stdin: true
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
tty: true
volumeMounts: volumeMounts:
- mountPath: /Open-IM-Server/config.tmp.yaml - name: config
name: vol2 mountPath: /Open-IM-Server/config
readOnly: true readOnly: true
subPath: config.yaml
dnsConfig: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
volumes: volumes:
- configMap: - name: config
defaultMode: 256 configMap:
name: config.yaml name: config
optional: false strategy: #更新策略
name: vol2 type: RollingUpdate # 滚动更新
updateStrategy:
rollingUpdate:
partition: 0
type: RollingUpdate
---
apiVersion: v1
kind: Service
metadata:
name: admin-cms
spec:
ports:
- name: p11000
port: 11000
protocol: TCP
targetPort: 11000
selector:
app: admin-cms
type: ClusterIP

Loading…
Cancel
Save