<p>I need to make my Linux container running (without any app or service in it) so I can enter /bin/bash and modify some local linux files before I actually <strong>manually</strong> run my app from the container shell (this is  purely for some debugging purposes so I do not want any modifications in my image itself, please do not suggest that as an option)</p>
<p>I have defined my Kubernetes YAML file hoping that I would be able to execute simple <code>command: [&quot;/bin/bash&quot;]</code> but this does not work because it will execute command and Exit the container. So how I can make it not to exit so I am able to <code>exec</code> container?</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: frontarena-ads-deployment2
  labels:
    app: frontarena-ads-deployment2
spec:
  replicas: 1
  template:
    metadata:
      name: frontarena-ads-aks-test2
      labels:
        app: frontarena-ads-aks-test2
    spec:
      nodeSelector:
        &quot;beta.kubernetes.io/os&quot;: linux
      restartPolicy: Always
      containers:
      - name: frontarena-ads-aks-test2
        image: test.dev/ads:test2
        imagePullPolicy: Always
        env:
        - name: DB_TYPE
          value: &quot;odbc&quot;
        - name: LANG
          value: &quot;en_US.utf8&quot;
        command: [&quot;/bin/bash&quot;]
      imagePullSecrets:
        - name: fa-repo-secret
  selector:
    matchLabels:
      app: frontarena-ads-aks-test2 
</code></pre>
<p>When I want to see what is going on after the deployment I can notice:</p>
<pre><code>NAME                                                      READY   STATUS             RESTARTS   AGE
frontarena-ads-deployment2-546fc4b75-zmmrs                0/1     CrashLoopBackOff   19         77m
</code></pre>
<p><strong><code>kubectl logs $POD</code></strong> doesn't return anything
and <code>kubectl describe pod $POD</code> output is:</p>
<pre><code>Command:
  /bin/bash
State:          Waiting
  Reason:       CrashLoopBackOff
Last State:     Terminated
  Reason:       Completed
  Exit Code:    0
  Started:      Wed, 07 Apr 2021 11:40:31 +0000
  Finished:     Wed, 07 Apr 2021 11:40:31 +0000
</code></pre>

vel
<p>You just need to run some long/endless process for the container to be up. For example you can read a stream, that'll last forever unless you kill the pod/container:</p>
<pre><code>command: [&quot;/bin/bash&quot;, &quot;-c&quot;]
args: [&quot;cat /dev/stdout&quot;]
</code></pre>
