<p>I am attempting to run a Flask app via uWSGI in a Kubernetes deployment. When I run the Docker container locally, everything appears to be working fine. However, when I create the Kubernetes deployment on Google Kubernetes Engine, the deployment goes into Crashloop Backoff because uWSGI complains: </p>

<p><code>uwsgi: unrecognized option '--http 127.0.0.1:8080'</code>.</p>

<p>The image definitely has the http option because:
<code>
    a. uWSGI was installed via pip3 which includes the http plugin.
    b. When I run the deployment with --list-plugins, the http plugin is listed.
    c. The http option is recognized correctly when run locally.
</code></p>

<p>I am running the Docker image locally with:</p>

<p><code>$: docker run &lt;image_name&gt; uwsgi --http 127.0.0.1:8080</code> </p>

<p>The container Kubernetes YAML config is:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: launch-service-example
  name: launch-service-example
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: launch-service-example
    spec:
      containers:
        - name: launch-service-example
          image: &lt;image_name&gt;
          command: ["uwsgi"]
          args:
            - "--http 127.0.0.1:8080"
            - "--module code.experimental.launch_service_example.__main__"
            - "--callable APP"
            - "--master"
            - "--processes=2"
            - "--enable-threads"
            - "--pyargv --test1=3--test2=abc--test3=true"
          ports:
            - containerPort: 8080
---
kind: Service
apiVersion: v1
metadata:
  name: launch-service-example-service
spec:
  selector:
    app: launch-service-example
  ports:
  - protocol: TCP
    port: 8080
    targetPort: 8080
</code></pre>

<p>The container is exactly the same which leads me to believe that the way the container is invoked by Kubernetes may be causing the issue. As a side note, I have tried passing all the args via a list of commands with no args which leads to the same result. Any help would be greatly appreciated.</p>

<p>It is happening because of the difference between arguments processing in the console and in the configuration.</p>

<p>To fix it, just split your args like that:</p>

<pre><code>args:
  - "--http"
  - "127.0.0.1:8080"
  - "--module code.experimental.launch_service_example.__main__"
  - "--callable"
  - "APP"
  - "--master"
  - "--processes=2"
  - "--enable-threads"
  - "--pyargv"
  - "--test1=3--test2=abc--test3=true"
</code></pre>
