---
# Source: kubernetes/templates/kubeadm-job.yaml
apiVersion: batch/v1
kind: Job
metadata:
  name: "kubernetes-kubeadm-tasks"
  labels:
    app: "kubernetes-kubeadm-tasks"
spec:
  template:
    metadata:
      labels:
        app: "kubernetes-kubeadm-tasks"
    spec:
      automountServiceAccountToken: false
      restartPolicy: OnFailure
      containers:
      - name: kubeadm
        image: "ghcr.io/kvaps/kubernetes-tools:v0.13.4"
        imagePullPolicy: IfNotPresent
        command: [ '/scripts/configure-cluster.sh' ]
        env:
        - name: KUBECONFIG
          value: "/etc/kubernetes/admin.conf"
        volumeMounts:
        - mountPath: /etc/kubernetes
          name: kubeconfig
          readOnly: true
        - mountPath: /pki/kubeconfig
          name: pki-admin-client
        - mountPath: /scripts
          name: scripts
        - mountPath: /config
          name: config
      volumes:
      - configMap:
          name: "kubeconfig"
        name: kubeconfig
      - secret:
          secretName: "pki-admin-client"
        name: pki-admin-client
      - name: scripts
        configMap:
          name: "kubernetes-kubeadm-scripts"
          defaultMode: 0777
      - name: config
        configMap:
          name: "kubernetes-kubeadm-config"
