<p>I have a <em>kustomization.yaml</em> file that uses a private repository as a resource:</p>
<pre><code>apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - https://gitlab.com/my-user/k8s-base-cfg.git
patchesStrategicMerge:
  - app-patch.yaml
</code></pre>
<p>I want to automate this on a Jenkins Pipeline. I don't know how to pass Git credentials to the kustomize build command. Is there any option to do that?</p>
<p>Thank you</p>

<p>You can't, you would set up the credentials in git before starting Kustomize. In this case probably something very simple like <code>git config --global user.password &quot;your password&quot;</code> but look up the <code>credentials.helper</code> setting for more complex options, either from a local file or a tool that reads from some backing store directly.</p>
