apiVersion: batch/v1
kind: Job
metadata:
  name: pithos-initialize
  namespace: default
spec:
  backoffLimit: 10
  template:
    metadata:
      name: pithos-initialize
    spec:
      securityContext:
        runAsUser: 0
      restartPolicy: OnFailure
      containers:
        - image: cassandra:latest
          name: pithos-initialize
          command: ["/initialize.sh"]
          volumeMounts:
            - name: cassandra-ssl
              mountPath: /etc/ssl/cassandra
            - name: kubectl
              mountPath: /usr/local/bin/kubectl
      volumes:
        - name: cassandra-ssl
          secret:
            secretName: cassandra-ssl
        - name: kubectl
          hostPath:
            path: /usr/bin/kubectl
