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