apiVersion: batch/v1
kind: Job
metadata:
  name: create-ibmcloud-cluster
spec:
  template:
    spec:
      hostNetwork: true
      containers:
      - command: ['sh', '-c', 'clusterctl create cluster --bootstrap-type kind --provider ibmcloud -c /examples/cluster.yaml -m /examples/machines.yaml -p /examples/provider-components.yaml && kubectl create secret generic kubeconfig --from-file kubeconfig']
        image: quay.io/cluster-api-provider-ibmcloud/clusterctl:latest
        imagePullPolicy: IfNotPresent
        name: clusterctl
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /examples
          name: ibmcloud-config
        - mountPath: /var/run/docker.sock
          name: docker
        - mountPath: /root/.ssh
          name: ibmcloud-ssh-key
      dnsPolicy: ClusterFirst
      restartPolicy: OnFailure
      schedulerName: default-scheduler
      securityContext: {}
      serviceAccountName: ibmcloud-service-account
      terminationGracePeriodSeconds: 30
      volumes:
      - hostPath:
          path: /var/run/docker.sock
        name: docker
      - configMap:
          defaultMode: 420
          name: ibmcloud-config
        name: ibmcloud-config
      - name: ibmcloud-ssh-key
        secret:
          secretName: ibmcloud-ssh-key-secret
          defaultMode: 0400
