<p>I have a CronJob defined in a yam file, deployed to istio as</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
spec:
  schedule: "*/12 * * * *"
</code></pre>

<p>I want to have different schedules in different environments, so tried to set the schedule from a config map:</p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
spec:
  schedule: 
    - valueFrom:
        configMapKeyRef:
          name: config-name
          key: service-schedule
</code></pre>

<p>It fails to sync with the error</p>

<blockquote>
  <p>invalid type for io.k8s.api.batch.v1beta1.CronJobSpec.schedule: got "array", expected "string"</p>
</blockquote>

<p>Is it possible to use config map in this way?</p>

Aidan
<p>ConfigMap is used to set environment variables inside container or is mounted as <code>volume</code>.
I don't think you can use <code>configmap</code> to set schedule in <code>cronjob</code>.</p>
