千云低代码平台ETMS-k8s实施部署

K8S环境安装

  • 部署守护服务
bash 复制代码
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fingerprint-agent
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: fingerprint-agent
  template:
    metadata:
      labels:
        app: fingerprint-agent
    spec:
      containers:
      - name: agent
        image: alpine:3.18
        command: ["sh", "-c", "cat /host-sys/class/dmi/id/product_uuid > /data/product_uuid && sleep 3600"]
        volumeMounts:
        - name: sysfs
          mountPath: /host-sys
          readOnly: true
        - name: data
          mountPath: /data
      volumes:
      - name: sysfs
        hostPath:
          path: /sys
      - name: data
        hostPath:
          path: /var/lib/fingerprint-agent

拉取部署镜像

生产镜像仓库【etms】

2)版本名称:"项目名称-prod-" 开头

部署配置

  • 创建拉取镜像服务信息的secret
  • 创建提供外部 https 访问的TLS类型的 secret
  • 创建配置字典ConfigMap
    配置参数:.etms.srt 、.etmstest.srt 、Etms-Logback.xml 、application.properties
  • 创建pvc,同时创建pv

发布应用(创建pod)

bash 复制代码
kind: Deployment
apiVersion: apps/v1    
metadata:
  # 指定名称
  name: etms
  # 指定命名空间
  namespace: kuaixiu
  labels:
    app: etms
  annotations:
    deployment.kubernetes.io/revision: '37'
    kubesphere.io/creator: janle
spec:
  replicas: 1
  selector:
    matchLabels:
      app: etms-yunxiao
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: etms
      annotations:
        kubesphere.io/creator: janle
        # 使用名称为 aliyun 的 secret 的镜像服务配置信息
        kubesphere.io/imagepullsecrets: '{"etms":"aliyun"}'
        kubesphere.io/restartedAt: '2025-06-24T10:20:29.470Z'
        logging.kubesphere.io/logsidecar-config: '{}'
    spec:
      volumes:
        - name: config
          configMap:
            name: etms-auth
            defaultMode: 420
        - name: data-yunxiao
          # 指定 pvc
          persistentVolumeClaim:
            claimName: data-yunxiao
        - name: fingerprint-volume
          hostPath:
            path: /var/lib/fingerprint-agent/product_uuid
            type: ''
        - name: etms-srt
          hostPath:
            path: /home/.etms
            type: ''
      containers:
        - name: etms-yunxiao
          # 镜像版本
          image: >-
            registry.cn-zhangjiakou.aliyuncs.com/pro-qy566/etms:shengneng-prod-11-20250710155258
          ports:
            - name: http-18566
              containerPort: 18566
              protocol: TCP
          resources:
            limits:
              cpu: '2'
              memory: 4Gi
          volumeMounts:
            - name: config
              mountPath: /app/etmsServer/conf
            - name: data-yunxiao
              mountPath: /home/pic/
            - name: fingerprint-volume
              readOnly: true
              mountPath: /var/lib/fingerprint-agent/product_uuid
            - name: etms-srt
              mountPath: /root/.etms
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          imagePullPolicy: IfNotPresent
      restartPolicy: Always
      terminationGracePeriodSeconds: 30
      dnsPolicy: ClusterFirst
      serviceAccountName: default
      serviceAccount: default
      securityContext: {}
      # 镜像拉取secret
      imagePullSecrets:
        - name: aliyun
      schedulerName: default-scheduler
  strategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 25%
      maxSurge: 25%
  revisionHistoryLimit: 10
  progressDeadlineSeconds: 600
相关推荐
阿里云云原生21 小时前
不改代码也能监控 AI Agent?揭秘 OBI 如何在内核层精准解析 GenAI 语义流量
云原生·agent
飞翔沫沫情1 天前
K8s Alloy 采集 Pod 控制台日志
云原生·容器·kubernetes
HUIBUR科技1 天前
2026 年上半年,软件开发领域的 7 个观察
低代码·数字化转型
潮起鲸落入海1 天前
Kubernetes Metric Server, Quota and Limits
容器·kubernetes
梦想的颜色1 天前
Docker 容器化本地部署 Claude Code 完整硬核教程|隔离沙盒 + 国产模型直连 + 持久化 Skill
运维·容器·ai 工程化·沙盒隔离·docker 本地部署·claude code硬核实战·国内国产模型接入
摇滚侠1 天前
云原生 Java 架构师的第一课 K8s+Docker+KubeSphere+DevOps 19-25
java·云原生·kubernetes
渣渣盟1 天前
Docker 运维常用命令手册(含扩容与实战)
运维·docker·容器
我叫张小白。1 天前
一个微服务电商+社区项目(瓷韵app)的技术深度复盘
docker·微服务·云原生·架构
咕噜咕噜的猪大侠1 天前
《K8s 核心知识梳理:Deployment 滚动更新、JobCronJob、DaemonSet 和 Service》
云原生·容器·kubernetes
虚心的百褶裙1 天前
远程调用服务架构设计及zookeeper技术详解(下篇)
分布式·zookeeper·云原生