<p>I am trying to create a Kubernetes cronjob. During the deployment, I get this error:</p>

<blockquote>
  <p>Error: UPGRADE FAILED: YAML parse error on
  lemming-metrics/templates/lemming-metrics-cronjob.yaml: error
  converting YAML to JSON: yaml: line 16: mapping values are not allowed
  in this context</p>
</blockquote>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: {{ .Values.name }}
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          serviceAccountName: {{ .Values.lemming_metrics.kubeServiceAccount }}
          containers:
          - name: {{ .Values.name }}
            image: {{ .Values.image.repository }}
            tag: latest
            imagePullPolicy: Always
            resources: {{ toYaml .Values.resources }}
            args:
            - /usr/bin/python
            - /opt/lemming_metrics.py
            env:
            - name: REGIONS
              value: {{ .Values.lemming_metrics.regions}}
            - name: ECS_CLUSTER
              value: {{ .Values.lemming_metrics.ecs_cluster}}
          restartPolicy: OnFailure
    backoffLimit: 2
    activeDeadlineSeconds: 90
</code></pre>

<p>Thanks for any help in advance</p>

Suresh Ravi
<p>Looks like you might need to fix the spacing for the indents (use 2 spaces). Otherwise, I've found that if you are incorrectly defining a service/pod/deployment, you can receive this error message (where specific line it points to in reality doesn't matter)</p>
