From 43734d67414c5ca438175be597b10e3dadf3bf0c Mon Sep 17 00:00:00 2001 From: dengbiao Date: Fri, 6 Dec 2024 19:32:59 +0800 Subject: [PATCH] update --- k8s/container-task.yaml | 55 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 k8s/container-task.yaml diff --git a/k8s/container-task.yaml b/k8s/container-task.yaml new file mode 100644 index 0000000..70502b0 --- /dev/null +++ b/k8s/container-task.yaml @@ -0,0 +1,55 @@ +kind: Deployment +apiVersion: apps/v1 +# 元数据 +metadata: + name: egg-admin-task + namespace: egg + labels: + app: egg-admin-task + annotations: + kubesphere.io/creator: admin + kubesphere.io/description: egg-admin-task +# deployment主要部分 +spec: + replicas: 1 + selector: + matchLabels: + # 名称与上面的labels对应 + app: egg-admin-task + template: + metadata: + labels: + # 名称与上面的matchLabels对应 + app: egg-admin-task + spec: + # 声明挂载卷(将外部已存在的pvc、config等挂载进来) + volumes: + # 用于时区校正 + - name: host-time + hostPath: + path: /etc/localtime + type: '' + # 将前面创建的configMap也挂载进来 + - name: egg-admin-task-cfg + configMap: + # 这里的名字就是前面创建的configMap的名字 + name: egg-admin-task-cfg + defaultMode: 420 + containers: + # 主容器 + - name: egg-admin-task-container + # 镜像地址(提前打包好并推送的镜像仓库) + image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/egg-admin-task:0.0.1' + # 将前面volume声明的需要用到的pvc、config挂载上来 + volumeMounts: + - name: host-time + readOnly: true + mountPath: /etc/localtime + - name: egg-admin-task-cfg # 该名字对应前面volumes声明的名字 + readOnly: true + # 挂载到容器的哪个路径 + mountPath: /var/egg + imagePullPolicy: Always + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst \ No newline at end of file