apiVersion: apps/v1
kind: Deployment
metadata:
  name: video-files
spec:
  replicas: 1
  selector:
    matchLabels:
      app: video-files
  template:
    metadata:
      labels:
        app: video-files
      annotations: { prometheus.io/scrape: "false" }
    spec:
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: video-data
      containers:
        - name: files
          image: bang5:5000/video_image
          command:
            - pnpm
            - exec
            - node
            - ./serve-files.js
          ports:
            - containerPort: 8003

          volumeMounts:
            - { name: data, mountPath: /data }

      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
              - matchExpressions:
                  - key: "kubernetes.io/hostname"
                    operator: In
                    values: ["ditto"]
---
apiVersion: v1
kind: Service
metadata:
  name: video-files
spec:
  ports:
    - { port: 8003, targetPort: 8003, name: files }
  selector:
    app: video-files
