<p>I have below pod.yaml file and I am expecting the pod to keep running but it completes.
Can anyone please tell me what am I doing wrong ?</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: app1
spec:
  containers:
  - name: base
    image: &quot;alpine:latest&quot;
    command: [&quot;/bin/sh&quot;]
    args: [&quot;-c&quot;, &quot;while true; do echo app1:$(date -u) &gt;&gt; /data/test.log; sleep 5; done&quot;]
    volumeMounts:
    - name: persistent-storage
      mountPath: /data
  volumes:
  - name: persistent-storage
    persistentVolumeClaim:
      claimName: emy-claim
</code></pre>

Naxi
<p>Please update the <code>pod.yaml</code> file with the below information to keep the pod running using the <code>while</code> condition and to update the <code>log entries</code> continuosly in the <code>test</code> file under <code>data</code> directory for every <code>5 seconds</code>.</p>
<pre><code>args: [&quot;-c&quot;, &quot;while true; do echo echo $(date -u) 'app1' &gt;&gt;  /data/test.log; sleep 5; done&quot;]
</code></pre>
<p>Please see the <a href="https://learning-ocean.com/tutorials/kubernetes/kubernetes-side-car-container" rel="nofollow noreferrer">documentation</a> for more details.</p>
