<p>We want to deploy using ArgoCD from our Jenkinsfile (which is slightly not how this is intended to be done but close enough), and after done some experiments want to try using the official container with the CLI, so we have added this snippet to our our pipeline kubernetes yaml:</p>

<pre><code>  - name: argocdcli
    image: argoproj/argocli
    command:
    - argo
    args: 
    - version
    tty: true
</code></pre>

<p>Unfortunately the usual way to keep these containers alive is to invoke <code>cat</code> in the container, which isn't there, so it fails miserably.  Actually the <em>only</em> command in there is the "argo" command which doesn't have a way to sleep infinitely.  (We are going to report this upstream so it will be fixed, but while we wait for that....)</p>

<p>My question therefore is, is there a way to indicate to Kubernetes that we <em>know</em> that this pod cannot keep itself up on its own, and therefore not tear it down immediately?  </p>

Thorbjørn Ravn Andersen
<p>Unfortunately it's not possible since as you stated, <code>argo</code> is the only command available on this image. </p>

<p>It can be confirmed <a href="https://github.com/argoproj/argo/blob/master/Dockerfile#L97-L102" rel="nofollow noreferrer">here</a>: </p>

<pre><code>####################################################################################################
# argocli
####################################################################################################
FROM scratch as argocli
COPY --from=argo-build /go/src/github.com/argoproj/argo/dist/argo-linux-amd64 /bin/argo
ENTRYPOINT [ "argo" ]
</code></pre>

<p>As we can see on this output, running argo is all this container is doing:</p>

<pre><code>$ kubectl run -i --tty --image argoproj/argocli argoproj1 --restart=Never 
argo is the command line interface to Argo

Usage:
  argo [flags]
  argo [command]
...  
</code></pre>

<p>You can optionally create you own image based on that and include sleep, so it'll be possible to keep it running as in this example: </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: busybox
  namespace: default
spec:
  containers:
  - name: busybox
    image: busybox:1.28
    command:
      - sleep
      - "3600"
    imagePullPolicy: IfNotPresent
  restartPolicy: Always
</code></pre>
