apiVersion: batch/v1
kind: Job
metadata:
  name: hive-initschema
spec:
  template:
    spec:
      containers:
        - name: hivemeta
          image: joshuarobinson/hivemetastore
          command: ["/opt/hive-metastore/bin/schematool"]
          args: ["--verbose", "-initSchema", "-dbType", "mysql", "-userName", "root",
                 "-passWord", "password", "-url", "jdbc:mysql://mysql:3306/metastore_db?createDatabaseIfNotExist=true"]
      restartPolicy: Never
  backoffLimit: 4
