<p>If I run the command</p>
<pre><code>$ kubectl exec pod-name echo Hello World 
</code></pre>
<p>I get a deprecation error message asking me to include the '--' characters.</p>
<pre><code>kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
</code></pre>
<p>Why was the decision made to require the '--' characters there? It seems unnecessary to me. I understand it's deprecated, I'm just trying to understand the reasoning behind the decision.</p>

<p>According the book &quot;Kubernetes in action&quot; by Marko Luksa:</p>
<blockquote>
<p>Why the double dash?</p>
</blockquote>
<blockquote>
<p>The double dash (--) in the command signals the end of command options for
kubectl. Everything after the double dash is the command that should be executed
inside the pod . Using the double dash isn’t necessary if the command has no
arguments that start with a dash. But in your case, if you don’t use the double dash
there, the -s option would be interpreted as an option for kubectl exec and would
result in the following strange and highly misleading error:
$ kubectl exec kubia-7nog1 curl -s <a href="http://10.111.249.153" rel="noreferrer">http://10.111.249.153</a>
The connection to the server 10.111.249.153 was refused – did you
specify the right host or port?
This has nothing to do with your service refusing the connection. It’s because
kubectl is not able to connect to an API server at 10.111.249.153 (the -s option
is used to tell kubectl to connect to a different API server than the default).</p>
</blockquote>
