千云低代码平台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
相关推荐
架构师老Y8 小时前
008、容器化部署:Docker与Python应用打包
python·容器·架构
handsomestWei12 小时前
Docker引擎API接入配置
运维·http·docker·容器·api
键盘鼓手苏苏14 小时前
Kubernetes与GitOps高级实践
云原生·kubernetes·k8
不是书本的小明15 小时前
K8S应用优化方向
网络·容器·kubernetes
andeyeluguo17 小时前
docker总结
运维·docker·容器
SuAluvfy17 小时前
从 0 到 1:在 Windows + Docker 环境下搭建 NextChat 并接入多模型 API(踩坑实录)
docker·容器
九英里路17 小时前
cpp容器——string模拟实现
java·前端·数据结构·c++·算法·容器·字符串
Aray123418 小时前
论Serverless架构模式及其应用实践
云原生·架构·serverless
AI攻城狮18 小时前
OpenClaw 本地内存检索与 node-llama-cpp 的依赖关系深度解析
人工智能·云原生·aigc
尘世壹俗人18 小时前
知识点8---虚拟化编排工具Kubernetes
容器·kubernetes