view deploy_files.yaml @ 30:1fa90a903621

upgrade many deps
author drewp@bigasterisk.com
date Mon, 26 Aug 2024 22:33:02 -0700
parents 1e058bea3ac2
children
line wrap: on
line source

apiVersion: apps/v1
kind: Deployment
metadata:
  name: video-files
spec:
  replicas: 2
  selector:
    matchLabels:
      app: video-files
  template:
    metadata:
      labels:
        app: video-files
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "8004"
    spec:
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: video-data
      containers:
        - 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: data, mountPath: /data }

        - name: api
          image: reg:5000/video_image
          command:
            - pdm
            - run
            - python
            - video.py
          ports:
            - containerPort: 8004
          volumeMounts:
            - { name: data, mountPath: /data }
          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