<p>I am trying to deploy the statsd exporter (<a href="https://github.com/prometheus/statsd_exporter" rel="noreferrer">https://github.com/prometheus/statsd_exporter</a>) software as a docker container in a K8s cluster. However, I want some parameters to be configurable. In order to do that, I am passing some arguments to the container via K8s deployment in a yaml format. When these arguments do not contain the double quotes character ("), everything works fine. However, if the desired value of the introduced variables contains double quotes, K8s interprets them in a wrong way (something similar is described in <a href="https://stackoverflow.com/questions/57389810/pass-json-string-to-environment-variable-in-a-k8s-deployment-for-envoy">Pass json string to environment variable in a k8s deployment for Envoy</a>). What I want to set is the <code>--statsd.listen-tcp=":&lt;port&gt;"</code> argument, and I am using <code>command</code> and <code>args</code> in K8s deployment:</p>

<pre><code>- name: statsd-exporter
  image: prom/statsd-exporter:v0.12.2
    ...
  command: ["/bin/statsd_exporter"]
  args: ['--log.level="debug"', '--statsd.listen-tcp=":9999"']
</code></pre>

<p>When I deploy it in K8s and check the content of the "running" deployment, everything seems to be right: </p>

<pre><code>command:
- /bin/statsd_exporter
args:
- --log.level="debug"
- --statsd.listen-tcp=":9999"
</code></pre>

<p>However, the container never starts, giving the following error:</p>

<p><code>time="..." level=fatal msg="Unable to resolve \": lookup \": no such host" source="main.go:64"</code></p>

<p>I think that K8s is trying to "scape" the double quotes and it is passing them adding the backslash to the container, so the latter cannot understand them. I have also tried to write the <code>args</code> as </p>

<pre><code>args: ["--log.level=\"debug\"", "--statsd.listen-tcp=\":9999\""]
</code></pre>

<p>and the same happens. I have also tried to pass them as env variables, and all the times the same problem is happening: the double quotes are not parsed in the right way. </p>

<p>Any idea regarding some possible solution?</p>

<p>Thanks!</p>

Salvador Foradada
<p>According to the <a href="https://github.com/prometheus/statsd_exporter/blob/master/main.go#L30" rel="nofollow noreferrer">source code</a>, statsd-exporter uses <a href="https://github.com/alecthomas/kingpin" rel="nofollow noreferrer">kingpin</a> for command line and flag parser. If I am not mistaken, kingpin doesn't require values to be surrounded by double quotes.</p>

<p>I would suggest to try:</p>

<pre><code>- name: statsd-exporter
  image: prom/statsd-exporter:v0.12.2
    ...
  command: ["/bin/statsd_exporter"]
  args:
  - --log.level=debug
  - --statsd.listen-tcp=:9999
</code></pre>

<p>Reason being is that according to the source code <a href="https://github.com/prometheus/statsd_exporter/blob/master/main.go#L54-L61" rel="nofollow noreferrer">here</a>, the input value for <code>statsd.listen-tcp</code> is split into host and port and it seems the the host per the error message gets the value of a double quote character <code>"</code>.</p>
