<p>I created a pod which serve redis database and i want to leave it running when complete. Containers are meant to run to completion. Do i need to create and infinity loop which never ends ?</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: redis
spec:
  containers:
  - name: redis
    image: lfccncf/redis:latest
    command: [ &quot;/bin/bash&quot;, &quot;-c&quot;, &quot;--&quot; ]
    args: [ &quot;while true; do sleep 30; done;&quot; ]
</code></pre>

<p>If the container has a process which keeps running then you don't need to use infinite loop. In this case the container will run the <code>redis</code> process.The <code>dockerfile</code> will have the <code>RUN</code> command to execute the process.</p>
<p>Also I suggest you use a standard redis image or a <a href="https://hub.helm.sh/charts/bitnami/redis" rel="nofollow noreferrer">helm chart</a> to deploy redis.</p>
<p>Here is <a href="https://kubernetes.io/docs/tutorials/stateless-application/guestbook/" rel="nofollow noreferrer">guide</a> on running PHP guestbook app with redis</p>
