From 513f058ca6123e583d0b4e3b30807241defc00b2 Mon Sep 17 00:00:00 2001 From: dengbiao Date: Fri, 19 Sep 2025 16:54:29 +0800 Subject: [PATCH] add k8s yml --- k8s/deployment_prd.yaml | 26 ++++++------ k8s/zyos-camp-task-operator-ingress.yaml | 19 +++++++++ k8s/zyos-camp-task-store.yaml | 53 ++++++++++++++++++++++++ 3 files changed, 85 insertions(+), 13 deletions(-) create mode 100644 k8s/zyos-camp-task-operator-ingress.yaml create mode 100644 k8s/zyos-camp-task-store.yaml diff --git a/k8s/deployment_prd.yaml b/k8s/deployment_prd.yaml index 56a7538..558576b 100644 --- a/k8s/deployment_prd.yaml +++ b/k8s/deployment_prd.yaml @@ -2,44 +2,44 @@ apiVersion: apps/v1 kind: Deployment metadata: namespace: zhios - name: zyos-app-hotel + name: zyos-camp-task labels: - app: zyos-app-hotel + app: zyos-camp-task annotations: kubesphere.io/creator: dengbiao - kubesphere.io/description: o2o酒店 + kubesphere.io/description: 任务项目 spec: replicas: 1 selector: matchLabels: - app: zyos-app-hotel + app: zyos-camp-task template: metadata: - name: zyos-app-hotel + name: zyos-camp-task labels: - app: zyos-app-hotel + app: zyos-camp-task spec: volumes: - name: host-time hostPath: path: /etc/localtime type: '' - - name: zyos-app-hotel-cfg + - name: zyos-camp-task configMap: - name: zyos-app-hotel + name: zyos-camp-task defaultMode: 420 containers: - - name: zyos-app-hotel-container - image: 'registry-vpc.cn-shenzhen.aliyuncs.com/fnuoos-prd/app-hotel:84122ff' + - name: zyos-camp-task-container + image: 'registry-vpc.cn-shenzhen.aliyuncs.com/fnuoos-prd/zyos-camp-task:125a336' ports: - - containerPort: 5020 - name: 5020tcp + - containerPort: 5021 + name: 5021tcp protocol: TCP volumeMounts: - name: host-time readOnly: true mountPath: /etc/localtime - - name: zyos-app-hotel + - name: zyos-camp-task readOnly: true mountPath: /var/zyos imagePullPolicy: Always diff --git a/k8s/zyos-camp-task-operator-ingress.yaml b/k8s/zyos-camp-task-operator-ingress.yaml new file mode 100644 index 0000000..ea26415 --- /dev/null +++ b/k8s/zyos-camp-task-operator-ingress.yaml @@ -0,0 +1,19 @@ +kind: Ingress +apiVersion: networking.k8s.io/v1 +metadata: + name: camp-task-operator # ingress名称 + namespace: zhios + annotations: + kubesphere.io/creator: dengbiao +spec: + rules: + - host: fwsrenwu1.zhiyingos.com # 使用的域名 + http: + paths: + - path: / + pathType: ImplementationSpecific + backend: + service: + name: zyos-camp-task-operator # 流量转发到的服务 + port: + number: 80 \ No newline at end of file diff --git a/k8s/zyos-camp-task-store.yaml b/k8s/zyos-camp-task-store.yaml new file mode 100644 index 0000000..c4e3012 --- /dev/null +++ b/k8s/zyos-camp-task-store.yaml @@ -0,0 +1,53 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: zyos-camp-task-store + namespace: zhios + labels: + app: zyos-camp-task-store + annotations: + kubesphere.io/creator: dengbiao +spec: + replicas: 1 + selector: + matchLabels: + app: zyos-camp-task-store + template: + metadata: + name: zyos-camp-task-store + creationTimestamp: null + labels: + app: zyos-camp-task-store + spec: + volumes: + - name: zyos-camp-task-store-html + persistentVolumeClaim: + claimName: zyos-camp-task-store-pvc + - name: zyos-camp-task-store-nginx + configMap: + name: zyos-camp-task-store-nginx + items: + - key: nginx-conf + path: default.conf + defaultMode: 436 + containers: + - name: zyos-camp-task-store + image: 'registry.cn-shenzhen.aliyuncs.com/fnuoos-prd/nginx:latest' + ports: + - name: tcp80 + containerPort: 80 + protocol: TCP + resources: + limits: + cpu: 200m + requests: + cpu: 200m + memory: 200Mi + volumeMounts: + - name: zyos-camp-task-store-html + mountPath: /usr/share/nginx/html + - name: zyos-camp-task-store-nginx + mountPath: /etc/nginx/conf.d/default.conf + subPath: default.conf + restartPolicy: Always + dnsPolicy: ClusterFirst