apiVersion: apps/v1
kind: Deployment
metadata:
  name: turbinia-server
  labels:
    app: turbinia-server
spec:
  replicas: 1
  selector:
    matchLabels:
      app: turbinia-server
  template:
    metadata:
      annotations:
        prometheus.io/port: "9200"
        prometheus.io/scrape: "true"
      labels:
        app: turbinia-server
    spec:
      initContainers:
        - name: init-filestore
          image: busybox:1.28
          command: ['sh', '-c', 'chmod go+w /mnt/output']
          volumeMounts:
            - mountPath: "/mnt/output"
              name: output
      containers:
        - name: server
          image: us-docker.pkg.dev/osdfir-registry/turbinia/release/turbinia-server:latest
          env:
            - name: TURBINIA_CONF
              valueFrom:
                configMapKeyRef:
                  name: turbinia-config
                  key: TURBINIA_CONF
            - name: TURBINIA_EXTRA_ARGS
              value: "-d"
          volumeMounts:
            - mountPath: /mnt/output
              name: output
          ports:
            - containerPort: 9200
      volumes:
        - name: output
          persistentVolumeClaim:
            claimName: output-claim
            readOnly: false