千云低代码平台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
相关推荐
UXbot18 小时前
如何选择适合公司项目的UI设计工具?企业选型指南
前端·低代码·ui·团队开发·原型模式·设计规范·web app
Hadoop_Liang19 小时前
使用Kubernetes Gateway API实现域名访问应用
容器·kubernetes·gateway
java_cj1 天前
深入kubectl create源码:从YAML到Pod的完整链路拆解
运维·云原生·容器·kubernetes
UXbot1 天前
原型设计工具如何帮助新人快速进入产品行业?
前端·低代码·ui·交互·团队开发·原型模式·web app
步步为营DotNet1 天前
基于.NET Aspire 实现云原生应用的高效监控与可观测性
云原生·.net·wpf
源图客1 天前
【AI向量数据库】Weaviate介绍与部署
运维·docker·容器
牛奶咖啡131 天前
KVM虚拟化与企业应用实践——给远端主机创建虚拟机
云原生·qemu·kvm·给远端主机创建虚拟机·创建uefi模式的虚拟机·安装openeulersp2·vnc与虚拟机环境搭建
码云骑士1 天前
28-Docker部署Django(下)-docker-compose编排与静态文件处理
docker·容器·django
java_cj1 天前
从kubectl学Visitor模式:如何优雅处理多态数据结构的遍历
云原生·golang·k8s·访问者模式
木雷坞1 天前
Firecrawl Docker Compose 自托管排查:镜像、Redis、队列和 Playwright
redis·docker·容器·firecrawl