apiVersion: batch/v1
kind: Job
metadata:
  name: fleet-prepare-db
spec:
  template:
    metadata:
      name: fleet-prepare-db
    spec:
      containers:
      - name: fleet
        image: kolide/fleet:1.0.5
        command: ["fleet",  "prepare", "db"]
        env:
          - name: KOLIDE_MYSQL_ADDRESS
            value: fleet-database-mysql:3306
          - name: KOLIDE_MYSQL_PASSWORD
            valueFrom:
              secretKeyRef:
                name: fleet-database-mysql
                key: mysql-password
      restartPolicy: Never
  backoffLimit: 4
