<p>Using CLI arguments to pass secrets is generally found upon: It exposes the secrets to other processes (<code>ps aux</code>) and potentially stores it in the shell history.</p>
<p>Is there a way to create Kubernetes secrets using <code>kubectl</code> that is not exposing the secret as described? I.e. a way to do this interactively?</p>
<pre><code>kubectl create secret generic mysecret --from-literal key=token
</code></pre>

Moritz
<p>You can create from file using e.g.</p>
<pre><code>kubectl create secret generic mysecret --from-file=key=name-of-file.txt
</code></pre>
<p>This will prevent the secret text in the commandline, but it <em>does</em> still tell anyone looking through your history where to find the secret text</p>
<p>Also, if you put a space at the start of the line, it does not get added to shell history</p>
<pre><code>kubectl create secret generic mysecret --from-literal....
</code></pre>
<p>vs</p>
<pre><code> kubectl create secret generic mysecret --from-literal....
</code></pre>
<p>(with space at the start)</p>
