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
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 thecredentials.helper
setting for more complex options, either from a local file or a tool that reads from some backing store directly.