title: Can I add initContainers to a kubernetes-cronjob?
body: <p>I want to have an initContainer that runs prior to the container my kubernetes cronjob is running. It's used to install kubectl. Is there a way of doing this? </p>
  
  <p>I tried to add the initContainer-parameter to the cronjob.yaml file but it threw an error.</p>
  
  <p>The code of my containerInit is the following:</p>
  
  <pre><code>initContainers:
  - name: install-kubectl
    image: allanlei/kubectl
    volumeMounts:
    - name: kubectl
      mountPath: /data
    command: ["cp", "/usr/local/bin/kubectl", "/data/kubectl"]
  </code></pre>
  
  <p>My cronjob needs to be able to access kubectl. That is the reason I'm trying to do this. I'm grateful for any suggestions how I could solve this problem.</p>