apiVersion: batch/v1
kind: Job
metadata:
  name: cockroachdb-init
spec:
  template:
    spec:
      containers:
      - name: cockroachdb-init
        image: cockroachdb/cockroach
        imagePullPolicy: IfNotPresent
        command:
        - "/bin/bash"
        - "-ecx"
        - "exec /cockroach/cockroach init --insecure --host=cockroachdb-0.cockroachdb"
      restartPolicy: OnFailure