<p>I'm trying to run a curl command by passing a value of an Environment variable as path param. But somehow value of environment variable is not getting passed instead literal string <strong>$CUSTOMER_ID</strong> is getting passed. Below is the definition of cron job which I'm trying to configure. </p>

<pre><code>apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: test-cron-job
spec:
  schedule: "*/15 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: test-cron-job
              image: myImage
              command: [
                "curl",
                "-X",
                "DELETE",
                "http://application:8080/api/customer/"$CUSTOMER_ID""
              ]
              env:        
                - name: CUSTOMER_ID
                  valueFrom:
                    configMapKeyRef:              
                      name: app-config-map              
                      key: customer_id
              volumeMounts:
              - name: app-config-map
                mountPath: /etc/app-config-map
          volumes:
            - name: app-config-map
              configMap:
                name: app-config-map
</code></pre>

<p>I'm not sure what is wrong in this. Any pointers will be helpful.</p>

BobCoder
<p>The issue here is that you need a shell to evaluate environment variables. </p>

<p>Your command should look something like this:</p>

<pre><code>command:
 - /bin/sh
 - -c
 - curl -X DELETE "http://application:8080/api/customer/$CUSTOMER_ID"
</code></pre>
