<pre><code>apiVersion: v1
kind: Pod
spec:
  serviceAccountName: &lt;service account name in kubernetes&gt;
  containers:
  - name: spark-submit
    image: &lt;image arn&gt;
    command:
    - cat
    tty: true
  - name: kube-tools
    image: &lt;image arn&gt;
    command:
    - cat
    tty: true
</code></pre>
<p>this is the part of yaml configuration of kubernetes agent in Jenkinsfile, what does the <strong>- cat  tty: true</strong> means?
i suppose tty: true means activating the terminal.</p>

SAI VINIL
<p>Please note that these are two different settings.
With <code>tty: true</code> you enable a TTY which is required for execution of a shell.</p>
<p>The second is <code>cat</code> as argument for the container <code>command</code>. It means that the <code>cat</code> executable is run without further arguments.
If you run <code>cat</code> on a terminal yourself in this , you will notice that it does nothing, but blocks and waits for input. The reason is that the <code>cat</code> command (&quot;concatenate&quot; in short) reads input from a file or stdin and prints it. If there is nothing, it just waits. (See the manpage here as well: <a href="https://man7.org/linux/man-pages/man1/cat.1.html" rel="nofollow noreferrer">https://man7.org/linux/man-pages/man1/cat.1.html</a> )</p>
<p>That is often the sole idea: Start a container or Pod and keep it running. It will be terminated by other means.
You can think of it like <code>sleep (infinity)</code>.</p>
