droboticflow-new/k8s/qwen-node-cache.preflight-dir.template.yaml
2026-08-22 08:47:40 +08:00

68 lines
1.9 KiB
YAML

# Render-only, read-only host directory preflight. It never creates a path and
# is separate from the one-shot mutating prepare Job.
apiVersion: batch/v1
kind: Job
metadata:
name: __QWEN_NODE_CACHE_PREFLIGHT_JOB_NAME__
namespace: __QWEN_NODE_CACHE_NAMESPACE__
labels:
app: droboticflow
component: qwen-node-cache-preflight
spec:
backoffLimit: 0
activeDeadlineSeconds: 120
ttlSecondsAfterFinished: 3600
template:
spec:
nodeName: __QWEN_NODE_CACHE_NODE_NAME__
automountServiceAccountToken: false
hostNetwork: false
hostPID: false
hostIPC: false
restartPolicy: Never
securityContext:
seccompProfile:
type: RuntimeDefault
containers:
- name: preflight
image: __QWEN_NODE_CACHE_PREPARE_IMAGE__
command: ["/bin/sh", "-lc"]
args:
- |
set -eu
stat -Lc 'parent-mode=%a owner=%u:%g inode=%i path=%n' /host-cache-parent
stat -Lc 'candidate-mode=%a owner=%u:%g inode=%i path=%n' /cache-root
realpath /cache-root
find /cache-root -mindepth 1 -maxdepth 1 -printf '%f\n' | wc -l
test ! -w /cache-root
securityContext:
runAsUser: 10001
runAsGroup: 10001
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: host-cache-parent
mountPath: /host-cache-parent
readOnly: true
- name: cache-root
mountPath: /cache-root
readOnly: true
volumes:
- name: host-cache-parent
hostPath:
path: /home/cce
type: Directory
- name: cache-root
hostPath:
path: __QWEN_NODE_CACHE_HOST_PATH__
type: Directory