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

141 lines
4.1 KiB
YAML

# Render-only, one-shot directory preparation Job. It is never applied by the
# platform deployment. Its only mutation is chown/chmod of the exact already
# preflighted cache directory; it never mounts the /home/cce parent directory.
apiVersion: batch/v1
kind: Job
metadata:
name: __QWEN_NODE_CACHE_PREPARE_JOB_NAME__
namespace: __QWEN_NODE_CACHE_NAMESPACE__
labels:
app: droboticflow
component: qwen-node-cache-prepare
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
initContainers:
- name: chown-cache-root
image: __QWEN_NODE_CACHE_PREPARE_IMAGE__
command: ["/usr/bin/chown", "10001:10001", "/cache-root"]
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
add: ["CHOWN", "DAC_OVERRIDE", "FOWNER"]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: cache-root
mountPath: /cache-root
- name: chmod-cache-root
image: __QWEN_NODE_CACHE_PREPARE_IMAGE__
command: ["/usr/bin/chmod", "0750", "/cache-root"]
securityContext:
runAsUser: 0
runAsGroup: 0
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
add: ["CHOWN", "DAC_OVERRIDE", "FOWNER"]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: cache-root
mountPath: /cache-root
- name: rw-touch-as-10001
image: __QWEN_NODE_CACHE_PREPARE_IMAGE__
command: ["/usr/bin/touch", "/cache-root/.qwen-cache-rw-probe"]
securityContext:
runAsUser: 10001
runAsGroup: 10001
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: cache-root
mountPath: /cache-root
- name: rw-remove-as-10001
image: __QWEN_NODE_CACHE_PREPARE_IMAGE__
command: ["/usr/bin/rm", "/cache-root/.qwen-cache-rw-probe"]
securityContext:
runAsUser: 10001
runAsGroup: 10001
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: cache-root
mountPath: /cache-root
containers:
- name: verify-as-10001
image: __QWEN_NODE_CACHE_PREPARE_IMAGE__
command: ["/usr/bin/stat", "-c", "mode=%a owner=%u:%g path=%n", "/cache-root"]
securityContext:
runAsUser: 10001
runAsGroup: 10001
privileged: false
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 100m
memory: 128Mi
volumeMounts:
- name: cache-root
mountPath: /cache-root
volumes:
- name: cache-root
hostPath:
path: __QWEN_NODE_CACHE_HOST_PATH__
type: DirectoryOrCreate