apiVersion: apps/v1 kind: Deployment metadata: name: openmotion-worker-render namespace: openmotion labels: app.kubernetes.io/name: openmotion-worker-render app.kubernetes.io/component: worker-render app.kubernetes.io/part-of: openmotion spec: # Replicas are intentionally omitted so `kubectl apply -k` does not clobber # KEDA ScaledObject-managed replica counts (see worker-render-keda.yaml). revisionHistoryLimit: 5 selector: matchLabels: app.kubernetes.io/name: openmotion-worker-render app.kubernetes.io/component: worker-render template: metadata: labels: app.kubernetes.io/name: openmotion-worker-render app.kubernetes.io/component: worker-render app.kubernetes.io/part-of: openmotion spec: serviceAccountName: openmotion-worker-render automountServiceAccountToken: false # Allow in-flight long-running video exports to finish and upload cleanly during scale-down/rollout. terminationGracePeriodSeconds: 1800 securityContext: runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 seccompProfile: type: RuntimeDefault containers: - name: worker-render image: ghcr.io/nexu-io/openmotion-worker-render:latest imagePullPolicy: IfNotPresent securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true capabilities: drop: ["ALL"] # CRITICAL SECURITY BOUNDARY: # NEVER inject OPENDESIGN_*, OIDC_*, SESSION_SECRET, or DEV_PAT into worker-render. # Only minimal DB/Redis/S3 connectivity is provided to the parent worker process, # and src/workers/render-env.ts strips ALL of these before spawning Chromium/FFmpeg. env: - name: WORKER_ROLE value: "render" - name: NODE_ENV valueFrom: configMapKeyRef: name: openmotion-config key: NODE_ENV - name: LOG_LEVEL valueFrom: configMapKeyRef: name: openmotion-config key: LOG_LEVEL - name: DATABASE_URL valueFrom: secretKeyRef: name: openmotion-secrets key: DATABASE_URL - name: PG_POOL_MAX value: "5" - name: REDIS_URL valueFrom: secretKeyRef: name: openmotion-secrets key: REDIS_URL - name: S3_ENDPOINT valueFrom: configMapKeyRef: name: openmotion-config key: S3_ENDPOINT optional: true - name: S3_REGION valueFrom: configMapKeyRef: name: openmotion-config key: S3_REGION - name: S3_BUCKET valueFrom: configMapKeyRef: name: openmotion-config key: S3_BUCKET - name: S3_FORCE_PATH_STYLE valueFrom: configMapKeyRef: name: openmotion-config key: S3_FORCE_PATH_STYLE - name: S3_ACCESS_KEY_ID valueFrom: secretKeyRef: name: openmotion-secrets key: S3_ACCESS_KEY_ID optional: true - name: S3_SECRET_ACCESS_KEY valueFrom: secretKeyRef: name: openmotion-secrets key: S3_SECRET_ACCESS_KEY optional: true - name: RENDER_CONCURRENCY valueFrom: configMapKeyRef: name: openmotion-config key: RENDER_CONCURRENCY - name: RENDER_CAPTURE_WORKERS valueFrom: configMapKeyRef: name: openmotion-config key: RENDER_CAPTURE_WORKERS optional: true - name: APP_PUBLIC_ORIGIN valueFrom: configMapKeyRef: name: openmotion-config key: APP_PUBLIC_ORIGIN optional: true - name: OPENMOTION_TRACKING_ENABLED valueFrom: configMapKeyRef: name: openmotion-config key: OPENMOTION_TRACKING_ENABLED optional: true - name: OPENMOTION_POSTHOG_TOKEN valueFrom: configMapKeyRef: name: openmotion-config key: OPENMOTION_POSTHOG_TOKEN optional: true - name: OPENMOTION_POSTHOG_HOST valueFrom: configMapKeyRef: name: openmotion-config key: OPENMOTION_POSTHOG_HOST optional: true - name: OPENMOTION_TRACKING_INSTALLATION_ID valueFrom: configMapKeyRef: name: openmotion-config key: OPENMOTION_TRACKING_INSTALLATION_ID optional: true - name: OPENMOTION_TRACERT_SPM_A valueFrom: configMapKeyRef: name: openmotion-config key: OPENMOTION_TRACERT_SPM_A optional: true - name: OPENMOTION_TRACERT_ENDPOINT valueFrom: configMapKeyRef: name: openmotion-config key: OPENMOTION_TRACERT_ENDPOINT optional: true resources: requests: cpu: "2000m" memory: "4Gi" limits: cpu: "4000m" memory: "8Gi" volumeMounts: - name: tmp mountPath: /tmp - name: dshm mountPath: /dev/shm volumes: - name: tmp emptyDir: sizeLimit: 10Gi - name: dshm emptyDir: medium: Memory sizeLimit: 2Gi