<p>Trying to use <code>timeout</code> and <code>bash</code> as entrypoint is not working as expected. The pod keeps running even after the specified timeout. Intention is to have a <code>bash -c</code> entry point for which I can define a timeout, after which, the pod enters an &quot;Error&quot; state. Once this is working, this will be used to timeout jobs like backups/cleaning that could get stuck forever otherwise.</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
metadata:
  labels:
    run: redis-cli
  name: redis-cli
spec:
  containers:
  - name: redis-cli
    image: xxxx/redis-cli:0.0.1
    imagePullPolicy: Always
    env:
      - name: REDIS_SERVICE
        value: redis.svc
      - name: REDIS_PORT
        value: &quot;6666&quot;
    command: ['/usr/bin/timeout', '20', '/bin/bash', '-c' ]
    args:
      - sleep 6000
    resources:
      limits:
        memory: &quot;12Gi&quot;
        cpu: &quot;2000m&quot;
  dnsPolicy: ClusterFirst
  restartPolicy: Never
</code></pre>

carrotcakeslayer
<p>You can achieve the timeout using spec.activeDeadlineSeconds.</p>
<pre><code>spec:
  activeDeadlineSeconds: 10
  containers:
  - command:
    - /bin/sh
    - -c
    - sleep 6000
    image: busybox
</code></pre>
