<p>I would like to my jenkins pod authenticate and get secret from vault pod running on the same cluster. Which auth method will be the best option for that? I think about kubernetes auth method but I'm not sure it is best option for my case. This method in my opinion is better for use when vault is running outside the kubernetes cluster.</p>

<p>Thanks in advance.</p>

k0chan
<p>I got two options for you:</p>

<ol>
<li>Use <a href="https://github.com/jenkinsci/hashicorp-vault-plugin#jenkins-vault-plugin" rel="nofollow noreferrer">Jenkins Vault Plugin</a>:</li>
</ol>

<blockquote>
  <p>This plugin allows authenticating against Vault using the AppRole
  authentication backend. Hashicorp recommends using AppRole for Servers
  / automated workflows (like Jenkins)</p>
</blockquote>

<p>This is the recommended way for authenticating and it works by registering an approle auth backend using a self-chosen name (e.g. Jenkins). The approle is identified by a <code>role-id</code> and secured with a <code>secret_id</code>. If you have both of those values you can ask Vault for a token that can be used to access vault. </p>

<ol start="2">
<li>Use <a href="https://kubernetes.io/docs/reference/access-authn-authz/authentication/" rel="nofollow noreferrer">Kubernetes auth method</a>.</li>
</ol>

<p><a href="https://medium.com/hootsuite-engineering/jenkins-kubernetes-and-hashicorp-vault-c2011bd2d66c" rel="nofollow noreferrer">Here</a> you can find an interesting read regarding Jenkins, Kubernetes, and Hashicorp Vault.</p>

<p>Choose the option that better suits you. Both are explained in detail.</p>

<p>Please let me know if that helped. </p>
