<p>I am blocked with k8s cron job yaml syntax errros</p>
<p>I try to do</p>
<p>kubectl apply -f cronjob.yaml</p>
<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: update-test
spec:
  schedule: &quot;0 /5 * * *&quot;
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: update-test
            image: test:test
            imagePullPolicy: IfNotPresent
            command: ['echo test']
            envFrom:
              - configMapRef:
                name: test-config
              - configMapRef:
                name: test-config-globe
            resources:
                requests:
                  memory: &quot;512Mi&quot;
                  cpu: &quot;0.5&quot;
                limits:
                  memory: &quot;1024Mi&quot;
                  cpu: &quot;2&quot;
          restartPolicy: OnFailure
</code></pre>
<p>But i am getting this error:</p>
<pre><code>error: error validating &quot;deplyment.yaml&quot;: error validating data: [ValidationError(CronJob.spec.jobTemplate.spec.template.spec.containers[0].envFrom[0]): unknown field &quot;name&quot; in io.k8s.api.core.v1.EnvFromSource, ValidationError(CronJob.spec.jobTemplate.spec.template.spec.containers[0].envFrom[1]): unknown field &quot;name&quot; in io.k8s.api.core.v1.EnvFromSource];
</code></pre>

karlos
<p>Indentation of <code>configMapRef</code> name is incorrect, change this:</p>
<pre><code>envFrom:
- configMapRef:
  name: test-config
</code></pre>
<p>to:</p>
<pre><code>envFrom:
- configMapRef:
    name: test-config
</code></pre>
<p>Note: Also, your <code>cron</code> schedule is incorrect, you may need to fix <code>0 /5 * * *</code> to a valid value. perhaps you need to set it to <code>0 */5 * * *</code></p>
