<p>Good evening, first of all, sorry if I don't respect all of the StackOverflow codes, this is the first time I've published one of my problems.</p>
<p>For a project, I developed an application with a node server and a React client, and I have some problems deploying the react on Kubernetes.</p>
<p>After several researches I learned that in order to use react docker, I had to launch the docker in interactive mode with the flag <code>-it</code>.
So here are the queries I use to dockersize my front.</p>
<pre><code>docker build -t front-end .   
docker run -it -p 3000:3000 -d front-end 
</code></pre>
<p>And here is the dockerfile.</p>
<pre><code>FROM node:12-slim

ENV NODE_ENV production

WORKDIR /usr/src/app/front-end

COPY ./package.json ./

RUN npm install 

COPY . . 

EXPOSE 3000

CMD [&quot;npm&quot;, &quot;start&quot;]
</code></pre>
<p>On the docker application, this setup works correctly. However I have some problems when using Kubernetes. I can't launch the pods with a container in interactive mode, I tried several methods, but here is my last one:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata: 
  name: front
spec:
  replicas: 1
  selector: 
    matchLabels: 
      app: webapps-front-test
      version: v01
  template:
    metadata:
      labels:
        app: webapps-front-test
        version: v01
    spec:
      volumes:
      containers:
      - name: front
        image: myRep/do_front
        stdin: true
        tty: true
        ports: 
        - containerPort: 3000
        args:
        - &quot;-it&quot;
</code></pre>
<p><strong>edit</strong> :
This happen on kubernetes :</p>
<pre><code>kubectl get pods                                                                                                                                  
NAME                     READY   STATUS             RESTARTS   AGE
front-76998f6794-xx  0/1     CrashLoopBackOff   11         33m
</code></pre>
<p>This happen when i run on docker ( which is not a problem since a use <code>-it</code>)</p>
<pre><code>&gt; react-scripts start


ℹ ｢wds｣: Project is running at http://1xx.x.x.x/

ℹ ｢wds｣: webpack output is served from

ℹ ｢wds｣: Content not from webpack is served from /usr/src/app/front-end/public

ℹ ｢wds｣: 404s will fallback to /
</code></pre>
<p>Do you know how to solve this problem?
Thank you,
Good evening/day</p>

Arthur Met
<p><code>-i</code> and <code>-t</code> are specific options to <code>docker run</code>; they correspond to the <code>stdin_open: true</code> and <code>tty: true</code> Kubernetes pod settings.  You don't need to repeat them in <code>args:</code>.</p>
<p>The Kubernetes <code>args:</code> setting actually replaces the <code>CMD</code> in your Dockerfile (somewhat confusingly, Kubernetes <code>command:</code> replaces Docker <code>ENTRYPOINT</code>), so when you provide <code>args: ['-it']</code> you're actually overwriting the command the container's trying to run.  You should see the same error you get if you incorrectly put the <code>-it</code> option after the image name instead of before it in the <code>docker run</code> command.</p>
<pre class="lang-yaml prettyprint-override"><code>stdin: true  # docker run -i
tty: true    # docker run -t
# args: ...  # docker run &lt;image-name&gt; arg1 arg2
</code></pre>
