view deploy.yaml @ 42:1d2c65d260d1

factor out breadcrumbs
author drewp@bigasterisk.com
date Thu, 05 Dec 2024 21:34:00 -0800
parents ed16fdbb3996
children 1bd17c2e5517
line wrap: on
line source

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: "true"
        prometheus.io/port: "8004"
    spec:
      volumes:
        - { name: video-data-download, persistentVolumeClaim: { claimName: video-data-download } }
        - { name: video-data-src, persistentVolumeClaim: { claimName: video-data-src } }
      containers:
        - name: ingest
          image: reg:5000/video_image
          command:
            - pdm
            - run
            - python
            - ingest.py
          volumeMounts:
            - { name: video-data-download, mountPath: /data/video-download }
            - { name: video-data-src, mountPath: /data/video-src }

        - name: files
          image: reg:5000/video_image
          # alternate: [ "webfsd", "-Fp", "9054", "-r", "/vids/" ]
          command:
            - pnpm
            - exec
            - node
            - ./serve-files.js
          ports:
            - containerPort: 8003
          volumeMounts:
            - { name: video-data-download, mountPath: /data/video-download }
            - { name: video-data-src, mountPath: /data/video-src }

        - name: api
          image: reg:5000/video_image
          command:
            - pdm
            - run
            - python
            - video.py
          ports:
            - containerPort: 8004
          resources:
            requests:
              cpu: "2"

      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 }
    - { port: 8004, targetPort: 8004, name: api }
  selector:
    app: video-files