<p>I want to create specific version of redis to be used as a cache. Task:</p>
<ul>
<li>Pod must run in web namespace</li>
<li>Pod name should be cache</li>
<li>Image name is lfccncf/redis with the 4.0-alpine tag</li>
<li>Expose port 6379</li>
<li>The pods need to be running after complete</li>
</ul>
<p>This are my steps:</p>
<ul>
<li><code>k create ns web</code></li>
<li><code>k -n web run cache --image=lfccncf/redis:4.0-alpine --port=6379 --dry-run=client-o yaml &gt; pod1.yaml</code></li>
<li>vi pod1.yaml</li>
<li>pod looks like this
<a href="https://i.stack.imgur.com/7lkup.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7lkup.png" alt="enter image description here" /></a></li>
<li><code>k create -f pod1.yaml</code>
When the expose service name is not define is this right command to fully complete the task ?
<code>k expose pod cache --port=6379 --target-port=6379</code>.
Is it the best way to keep pod running using command like this command: <code>[&quot;/bin/sh&quot;, &quot;-ec&quot;, &quot;sleep 1000&quot;]</code> ?</li>
</ul>

O.Man
<p>You should not use <code>sleep</code> to keep a redis pod running. As long as the redis process runs in the container the pod will be running.</p>
