apiVersion: apps/v1
kind: Deployment
metadata:
  name: spiceai-deployment
  labels:
    app: spiceai
spec:
  replicas: 1
  selector:
    matchLabels:
      app: spiceai
  template:
    metadata:
      labels:
        app: spiceai
    spec:
      containers:
      - name: spiceai
        image: ghcr.io/spiceai/spiceai:latest
        ports:
        - containerPort: 8000
        volumeMounts:
        - name: userapp
          mountPath: /userapp
      initContainers:
      - name: spiceai-init
        image: busybox
        command: ['/bin/sh', '-c', 'mkdir -p /userapp/spicepods && cp /trader/trader.yaml /userapp/spicepods/trader.yaml && cp /trader/btcusd.csv /userapp/btcusd.csv']
        volumeMounts:
        - name: userapp
          mountPath: /userapp
        - name: trader-volume
          mountPath: /trader
      volumes:
        - name: trader-volume
          configMap:
            name: trader
        - name: userapp
          emptyDir: {}
