<p>I wrote deployment.yml file in k8s:- </p>

<pre><code>spec:
  containers:
  - name: consul
    image: xyz
    ports:
      - name: http
        containerPort: 8500
      - name: http1
        containerPort: 53
    env:
    - name: SERVICE_8500_IGNORE
      value: "true"
    - name: CONSUL_LOCAL_CONFIG
      value: "{"node_name": "docker","acl_datacenter": "dc1", "acl_default_policy": "deny", "acl_down_policy": "deny", "acl_master_token": "fleeture", "acl_agent_token":"xyz", "enable_script_checks": true}"
</code></pre>

<p>After running I am getting errors </p>

<blockquote>
  <p>Error : Unexpected characters near "node_name": "docker","acl_datacenter": "dc1", "acl_default_policy": "deny", "acl_down_policy": "deny", "acl_master_token": "xyz", "acl_agent_token":"xyz", "enable_script_checks": true}"".
  Line : 14  value: "{"node_name": "docker","acl_datacenter": "dc1", "acl_default_policy": "deny", "acl_down_policy": "deny", "acl_master_token": "fleeture", "acl_agent_token":"xyz", "enable_script_checks": true}"</p>
</blockquote>

<p>Any Idea how to write ENV for line 14?</p>

<p>You need to use <code>\</code> to escape the double-quotes within the value for <code>CONSUL_LOCAL_CONFIG</code> so that entry becomes:</p>

<pre><code>- name: CONSUL_LOCAL_CONFIG
  value: "{\"node_name\": \"docker\",\"acl_datacenter\": \"dc1\", \"acl_default_policy\": \"deny\", \"acl_down_policy\": \"deny\", \"acl_master_token\": \"fleeture\", \"acl_agent_token\":\"xyz\", \"enable_script_checks\": true}"
</code></pre>
