From e8e4af72868e31fefdfa8be6da1a6e82f790b9a7 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 20 May 2022 19:43:28 +0800 Subject: [PATCH] k8s_deploy --- deploy_k8s/admin_cms/deployment.yaml | 93 +++++----------------------- 1 file changed, 16 insertions(+), 77 deletions(-) diff --git a/deploy_k8s/admin_cms/deployment.yaml b/deploy_k8s/admin_cms/deployment.yaml index b1ef1b3b2..c37061e64 100644 --- a/deploy_k8s/admin_cms/deployment.yaml +++ b/deploy_k8s/admin_cms/deployment.yaml @@ -1,92 +1,31 @@ --- apiVersion: apps/v1 -kind: StatefulSet +kind: Deployment metadata: - name: admin-cms + name: api-deployment spec: - podManagementPolicy: OrderedReady - replicas: 1 - revisionHistoryLimit: 10 selector: matchLabels: - app: admin-cms - workload.auth.cattle.io/workloadselector: statefulSet-openim-admin-cms - serviceName: admin-cms + app: admin_cms # 选择这个指定标签执行 + replicas: 2 # 运行pod数量 template: metadata: labels: - app: admin-cms - workload.auth.cattle.io/workloadselector: statefulSet-openim-admin-cms + app: api # 标签 spec: containers: - - image: "IMAGE_TAG" - env: - - 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 + - name: api + image: openim/api:v2.0.10 ports: - - name: p11000 - protocol: TCP - containerPort: 11000 - imagePullPolicy: Always - name: admin-cms - stdin: true - terminationMessagePath: /dev/termination-log - terminationMessagePolicy: File - tty: true + - containerPort: 10002 volumeMounts: - - mountPath: /Open-IM-Server/config.tmp.yaml - name: vol2 + - name: config + mountPath: /Open-IM-Server/config readOnly: true - subPath: config.yaml - dnsConfig: {} - dnsPolicy: ClusterFirst - restartPolicy: Always - schedulerName: default-scheduler - securityContext: {} - terminationGracePeriodSeconds: 30 volumes: - - configMap: - defaultMode: 256 - name: config.yaml - optional: false - name: vol2 - 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 \ No newline at end of file + - name: config + configMap: + name: config + strategy: #更新策略 + type: RollingUpdate # 滚动更新 +