-1

I have git repo with my cronjobs yaml files. I want to use kustomize to set image in one place and apply it to all yaml. How to do this with kustomize?

My files:

cronjobs/
├─ cronone/
│  \─ cronone.yaml
├─ crontwo/
│  \─ crontwo.yaml
├─ cronthree/
│  \─ cronthree.yaml
\-kustomize.yaml
Rafał Kot
  • 1,064
  • 3
  • 15
  • 26

1 Answers1

1

You can use the images transformer to rename an image across all your resources. That is, if all of your cronjobs have something like:

image: fakeimage:latest

You can put in your kustomization.yaml:

images:
  - name: fakeimage
    newName: docker.io/postgres
    newTag: 14

And your transformed cronjobs will all end up with:

image: docker.io/postgres:14
larsks
  • 277,717
  • 41
  • 399
  • 399