From a6363635b42ce7fb1608c548ce3cae2711b8aaf4 Mon Sep 17 00:00:00 2001 From: huangjiajun <582604932@qq.com> Date: Wed, 11 Sep 2024 09:45:39 +0800 Subject: [PATCH] 1 --- k8s/mall-task-prd.yaml | 56 +++++++++++++++++++++++++++++++ k8s/mall-task.yaml | 56 +++++++++++++++++++++++++++++++ k8s/zyos-mall-deployment_prd.yaml | 49 +++++++++++++++++++++++++++ 3 files changed, 161 insertions(+) create mode 100644 k8s/mall-task-prd.yaml create mode 100644 k8s/mall-task.yaml create mode 100644 k8s/zyos-mall-deployment_prd.yaml diff --git a/k8s/mall-task-prd.yaml b/k8s/mall-task-prd.yaml new file mode 100644 index 0000000..1e592eb --- /dev/null +++ b/k8s/mall-task-prd.yaml @@ -0,0 +1,56 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: mall-task + namespace: zhios + labels: + app: mall-task + annotations: + kubesphere.io/creator: wuhanqin + kubesphere.io/description: 自营商城go定时任务 +spec: + replicas: 1 + selector: + matchLabels: + app: mall-task + template: + metadata: + labels: + app: mall-task + spec: + volumes: + - name: host-time + hostPath: + path: /etc/localtime + type: '' + - name: mall-task-cfg1 + configMap: + name: zhios-mall-task + items: + - key: task.yml + path: task.yml + defaultMode: 420 + containers: + - name: container-mall-task + image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-mall-task:0.3' + resources: + limits: + cpu: '1' + memory: 1000Mi + requests: + cpu: 200m + memory: 1000Mi + volumeMounts: + - name: host-time + readOnly: true + mountPath: /etc/localtime + - name: mall-task-cfg1 + readOnly: true + mountPath: /var/zyos/task.yml + subPath: task.yml + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst diff --git a/k8s/mall-task.yaml b/k8s/mall-task.yaml new file mode 100644 index 0000000..534392a --- /dev/null +++ b/k8s/mall-task.yaml @@ -0,0 +1,56 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: mall-task + namespace: dev + labels: + app: mall-task + annotations: + kubesphere.io/creator: wuhanqin + kubesphere.io/description: 自营商城go定时任务 +spec: + replicas: 1 + selector: + matchLabels: + app: mall-task + template: + metadata: + labels: + app: mall-task + spec: + volumes: + - name: host-time + hostPath: + path: /etc/localtime + type: '' + - name: mall-task-cfg1 + configMap: + name: mall-task-cfg + items: + - key: task.yml + path: task.yml + defaultMode: 420 + containers: + - name: container-mall-task + image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-mall-task:0.1' + resources: + limits: + cpu: '1' + memory: 1000Mi + requests: + cpu: 200m + memory: 1000Mi + volumeMounts: + - name: host-time + readOnly: true + mountPath: /etc/localtime + - name: mall-task-cfg1 + readOnly: true + mountPath: /var/zyos/task.yml + subPath: task.yml + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst diff --git a/k8s/zyos-mall-deployment_prd.yaml b/k8s/zyos-mall-deployment_prd.yaml new file mode 100644 index 0000000..e2dc9da --- /dev/null +++ b/k8s/zyos-mall-deployment_prd.yaml @@ -0,0 +1,49 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: zhios + name: zhios-mall + labels: + app: zhios-mall +spec: + replicas: 1 + template: + metadata: + name: zhios-mall + labels: + app: zhios-mall + spec: + containers: + - name: zhios-mall-container + image: registry-vpc.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-mall:0.1 + ports: + - containerPort: 5002 + name: 5002tcp + protocol: TCP + resources: + limits: + cpu: "1" + memory: 256Mi + requests: + cpu: 200m + memory: 128Mi + imagePullPolicy: IfNotPresent + restartPolicy: Always + volumes: + - name: host-time + hostPath: + path: /etc/localtime + type: '' + - name: mall-cfg + configMap: + name: zhios-mall-cfg + defaultMode: 420 + selector: + matchLabels: + app: zhios-mall + + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25%