<p>I was trying to use the netshoot image with Nginx server image on the same pod.</p>
<p>If I do not include sleep argument to netshoot container,</p>
<pre><code>args:
        - sleep
        - '9999999999999999999'
</code></pre>
<p>the pod status always becomes CrashLoopBackOff. I did not figure out why I have to put sleep argument to sleep current thread in netshoot container. Do containers have to consist of application servers or running jars to retain running status? I think I missed the fundamental point about the running mechanism of containers. Thanks.</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  # Define the Deployment Name
  name: nginx-deployment
  labels:
    app: nginx
spec:
  # Define the Number of Pods
  replicas: 1
  # Define the Selector
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers: # Container Details
      - name: nginx
        image: nginx:latest # Image
        ports:
        - containerPort: 80
      - name: netshoot
        image: nicolaka/netshoot:latest
        args:
        - sleep
        - '9999999999999999999'
</code></pre>

<p>Containers are a wrapper around a command, and they run until that command exits. The default command for netshoot is <code>zsh</code>. Like other shells, they run until they reach an exit command, a signal interrupts them, or the input they process returns an EOF. Without any stdin input defined, a container will reach that EOF immediately.</p>
<p>As an aside, a common noop command for containers is <code>tail -f /dev/null</code>.</p>
