linzhengen / tech-notes

My tech notes write in github issues🧲
1 stars 0 forks source link

[20230712] `kustomize edit set image` で カスタマイズリソースのimageの更新でもできるぞ! #178

Open linzhengen opened 1 year ago

linzhengen commented 1 year ago

busybox-template.yaml

apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
  name: busybox-template
spec:
  templates:
    - container:
        image: __MAGE__
        name: "busybox"

kustomization-config.yaml

images:
  - path: spec/templates[]/container/image
    kind: WorkflowTemplate
  - path: spec/templates[]/script/image
    kind: WorkflowTemplate

kustomization.yaml

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
configurations:
  - kustomization-config.yaml
resources:
  - busybox-template.yaml

set imageコマンド実行

kustomize edit set image __IMAGE__=busybox:1.36.1