<p>Im starting with K8s and I have problem with my DaemonSet resource. When I apply it, it goes to <code>Running</code> state, then <code>Completed</code> and then <code>CrashLoopBackOff</code> and then again to running etc. I would like to have all my pods to be in <code>Running</code> state. Here is my manifest:</p>
<pre><code>apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: ds-test
  labels:
    app: busybox-ds
spec:
  selector:
    matchLabels:
      name: busybox-ds
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 0
      maxSurge: 3
  template:
    metadata:
      labels:
        name: busybox-ds
    spec:
      containers:
      - name: busybox-ds
        image: busybox
</code></pre>
<p>Could somebody tell me what am I doing wrong?</p>

Frendom
<p>The <code>busybox</code> image just runs <code>sh</code> as its command. If it's not being interacted with, it immediately exits, and hence why you see your pod go to the <code>Completed</code> state.</p>
<p>You need to have that image run a command that will keep its process running.</p>
<p>Using <code>tail -f /dev/null</code> is a common way to do this. So your manifest would look like:</p>
<pre class="lang-yaml prettyprint-override"><code>    spec:
      containers:
      - name: busybox-ds
        image: busybox
        command:
        - tail
        - -f
        - /dev/null
</code></pre>
