<p>I'm tryin to deploy an nginx prometheus exporter (<a href="https://github.com/nginxinc/nginx-prometheus-exporter" rel="nofollow noreferrer">https://github.com/nginxinc/nginx-prometheus-exporter</a>) in a kubernetes cluster but if I use param &quot;-nginx.scrape-uri&quot; in the args tag it fails. If I remove it then it works but use default values &quot;127.0.0.1:8080&quot;</p>
<p>How should I pass this parameter?</p>
<p>Here my deployment.yaml</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx-prometheus-exporter
  namespace: monitoring
  labels:
    k8s-app: nginx-prometheus-exporter
spec:
  selector:
    matchLabels:
      k8s-app: nginx-prometheus-exporter
  template:
    metadata:
      labels:
        k8s-app: nginx-prometheus-exporter
      annotations:
        prometheus.io/path: &quot;/metrics&quot;
        prometheus.io/port: &quot;9113&quot;
        prometheus.io/scrape: &quot;true&quot;
    spec:
      containers:
      - name: nginx-prometheus-exporter
        image: infra-harbor-paas.attmx-ne.local/matrixx_lab01/nginx/nginx-prometheus-exporter:0.8.0
        args: [&quot;-nginx.scrape-uri http://10.150.152.206:8080/stub_status&quot;]
        ports:
        - containerPort: 9113
          name: http
      imagePullSecrets:
        - name: regcred
</code></pre>
<p>And here the error that it throws</p>
<pre><code>oscar@dlmx:~$ kubectl logs nginx-prometheus-exporter-84f6f6bfd5-9rv6h -n monitoring
flag provided but not defined: -nginx.scrape-uri http://10.150.152.206:8080/stub_status
Usage of /usr/bin/exporter:
  -nginx.plus
        Start the exporter for NGINX Plus. By default, the exporter is started for NGINX. The default value can be overwritten by NGINX_PLUS environment variable.
  -nginx.retries uint
        A number of retries the exporter will make on start to connect to the NGINX stub_status page/NGINX Plus API before exiting with an error. The default value can be overwritten by NGINX_RETRIES environment variable.
  -nginx.retry-interval value
        An interval between retries to connect to the NGINX stub_status page/NGINX Plus API on start. The default value can be overwritten by NGINX_RETRY_INTERVAL environment variable. (default 5s)
  -nginx.scrape-uri string
        A URI or unix domain socket path for scraping NGINX or NGINX Plus metrics.
        For NGINX, the stub_status page must be available through the URI. For NGINX Plus -- the API. The default value can be overwritten by SCRAPE_URI environment variable. (default &quot;http://127.0.0.1:8080/stub_status&quot;)
  -nginx.ssl-ca-cert string
        Path to the PEM encoded CA certificate file used to validate the servers SSL certificate. The default value can be overwritten by SSL_CA_CERT environment variable.
  -nginx.ssl-client-cert string
        Path to the PEM encoded client certificate file to use when connecting to the server. The default value can be overwritten by SSL_CLIENT_CERT environment variable.
  -nginx.ssl-client-key string
        Path to the PEM encoded client certificate key file to use when connecting to the server. The default value can be overwritten by SSL_CLIENT_KEY environment variable.
  -nginx.ssl-verify
        Perform SSL certificate verification. The default value can be overwritten by SSL_VERIFY environment variable. (default true)
  -nginx.timeout value
        A timeout for scraping metrics from NGINX or NGINX Plus. The default value can be overwritten by TIMEOUT environment variable. (default 5s)
  -prometheus.const-labels value
        A comma separated list of constant labels that will be used in every metric. Format is label1=value1,label2=value2... The default value can be overwritten by CONST_LABELS environment variable.
  -web.listen-address string
        An address or unix domain socket path to listen on for web interface and telemetry. The default value can be overwritten by LISTEN_ADDRESS environment variable. (default &quot;:9113&quot;)
  -web.telemetry-path string
        A path under which to expose metrics. The default value can be overwritten by TELEMETRY_PATH environment variable. (default &quot;/metrics&quot;)

</code></pre>

<p>Try this:</p>
<pre><code>    spec:
      containers:
      - name: nginx-prometheus-exporter
        image: infra-harbor-paas.attmx-ne.local/matrixx_lab01/nginx/nginx-prometheus-exporter:0.8.0
        args: 
        - &quot;-nginx.scrape-uri=http://10.150.152.206:8080/stub_status&quot;
</code></pre>
