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