<p>I want to trigger remote Jenkins job from my container(k8s).</p>
<p>Currently, I'm using:</p>
<p><code>curl -k -X POST -u $USER:$JENKINS_TOKEN &quot;${JENKINS_URL}/job/{$JOB_NAME}/buildWithParameters?token=12345&quot;</code></p>
<p>But this information($USER,$JENKINS_TOKEN) is displayed in ArgoUI, is there any secure/other way to save credentials for remote trigger?</p>

<p>You can try one of the following.</p>
<p>Save the password in a file called <code>password-file</code> and read from that</p>
<pre><code>curl -k -X POST -u $USER:$(cat .password-file)&quot;${JENKINS_URL}/job/{$JOB_NAME}/buildWithParameters?token=12345&quot;
</code></pre>
<p>Accept credentials from the STDIN.</p>
<pre><code>curl -k -X POST &quot;${JENKINS_URL}/job/{$JOB_NAME}/buildWithParameters?token=12345&quot; -K- &lt;&lt;&lt; &quot;--user $USER:$JENKINS_TOKEN&quot;
</code></pre>
<p>You can also try using <code>--netrc-file</code> option with curl where you can store the username and password in a file itself.</p>
<p>file</p>
<pre><code>machine JENKINS_HOST login USERNAME password PASSWORD
</code></pre>
<p>Curl Command</p>
<pre><code>curl -k -X POST --netrc-file my-password-file &quot;${JENKINS_URL}/job/{$JOB_NAME}/buildWithParameters?token=12345&quot;
</code></pre>
