Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass Git credentials in a Kustomize build command?

I have a kustomization.yaml file that uses a private repository as a resource:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - https://gitlab.com/my-user/k8s-base-cfg.git
patchesStrategicMerge:
  - app-patch.yaml

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?

Thank you

like image 691
Fernando Lozano Avatar asked Nov 09 '25 02:11

Fernando Lozano


1 Answers

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

like image 159
coderanger Avatar answered Nov 10 '25 21:11

coderanger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!