apiVersion: apps/v1
kind: Deployment
metadata:
  name: sco-bot
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sco-bot
  template:
    metadata:
      labels:
        app: sco-bot
    spec:
      volumes:
        - name: sco-bot-data
          persistentVolumeClaim:
            claimName: sco-bot-data
      containers:
        - name: vite
          image: reg:5000/sco_bot_web
          workingDir: /opt
          command:
            - pnpm
            - exec
            - vite
          ports:
            - containerPort: 8002
        - name: search
          image: reg:5000/sco_bot_search
          workingDir: /opt
          command:
            - pdm
            - run
            - fastapi
            - dev
            - --host
            - "0.0.0.0"
            - --port
            - "8001"
            - search/query.py
          ports:
            - containerPort: 8001
          volumeMounts:
          - name: sco-bot-data
            mountPath: /opt/data
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: "kubernetes.io/hostname"
                operator: In
                values: ["ditto", "dash"] # need /my/serv