03-deployment.yaml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: pipeline
  5. namespace: pipeline
  6. labels:
  7. app.kubernetes.io/name: pipeline
  8. spec:
  9. # Keep at 1. The WebUI stores jobs in a local file and renders by spawning the
  10. # CLI child process; there is no shared state or distributed locking, so extra
  11. # replicas would each see a private jobs.json and could double-run jobs.
  12. replicas: 1
  13. strategy:
  14. type: Recreate # RWO PVCs can't move while the old pod owns them
  15. selector:
  16. matchLabels:
  17. app.kubernetes.io/name: pipeline
  18. template:
  19. metadata:
  20. labels:
  21. app.kubernetes.io/name: pipeline
  22. spec:
  23. securityContext:
  24. runAsNonRoot: true
  25. runAsUser: 1000 # `node` user baked into the image
  26. runAsGroup: 1000
  27. fsGroup: 1000 # chowns mounted PVCs so uid 1000 can write them
  28. # Uncomment once you've created the Harbor pull secret (see README).
  29. # imagePullSecrets:
  30. # - name: harbor-creds
  31. containers:
  32. - name: pipeline
  33. # ⚠️ Replace with your Harbor registry + project. See README.
  34. image: harbor.corp.shuidi.tech/library/pipeline:latest
  35. imagePullPolicy: IfNotPresent
  36. ports:
  37. - name: http
  38. containerPort: 3000
  39. envFrom:
  40. - configMapRef:
  41. name: pipeline-env
  42. - secretRef:
  43. name: pipeline-env-secret
  44. # Let in-flight renders finish on rolling update / drain. A long
  45. # render still exceeds this; interrupted jobs are auto-marked failed
  46. # on the next pod start (startup sweep in job-store).
  47. terminationGracePeriodSeconds: 60
  48. startupProbe:
  49. httpGet:
  50. path: /api/health/live
  51. port: http
  52. failureThreshold: 30
  53. periodSeconds: 10
  54. livenessProbe:
  55. httpGet:
  56. path: /api/health/live
  57. port: http
  58. initialDelaySeconds: 10
  59. periodSeconds: 30
  60. timeoutSeconds: 5
  61. failureThreshold: 3
  62. readinessProbe:
  63. httpGet:
  64. path: /api/health/ready
  65. port: http
  66. initialDelaySeconds: 5
  67. periodSeconds: 10
  68. timeoutSeconds: 5
  69. # Video rendering (Remotion/Chrome + ffmpeg) is CPU/memory heavy.
  70. # Tune to your cluster.
  71. resources:
  72. requests:
  73. cpu: "1000m"
  74. memory: 2Gi
  75. limits:
  76. cpu: "4000m"
  77. memory: 6Gi
  78. volumeMounts:
  79. - name: output
  80. mountPath: /app/output
  81. - name: jobs
  82. mountPath: /app/jobs
  83. volumes:
  84. - name: output
  85. persistentVolumeClaim:
  86. claimName: pipeline-output
  87. - name: jobs
  88. persistentVolumeClaim:
  89. claimName: pipeline-jobs