Add patches/resources via kustomize deployment
Is your feature request related to a problem? Would be nice to support patches and referencing additional resources directly in kustomize deployment spec.
Which solution do you suggest? Temporary kustomization.yaml file can be created as an overlay, this file can absorb orginal kustomize settings plus additional patches and resources from devspace.yaml to prevent inconsistency of original kustomization.
deployments:
- name: my-deployment
kubectl:
kustomize: true
manifests:
- .
patches:
- path: ingress_patch.json
target:
group: networking.k8s.io
version: v1beta1
kind: Ingress
name: my-ingress
- target:
kind: Deployment
name: deploy
patch: |-
- op: replace
path: /spec/template/spec/containers/0/image
value: nginx:latest
resources:
- https://github.com/lukasmrtvy/kustomize//raw.yaml?ref=master
Which alternative solutions exist?
hooks:
- command: kustomize
args:
- edit
- add
- patch
- --group=networking.k8s.io
- --version=v1
- --kind=Ingress
- --name=${INGRESS_OBJECT_NAME}
- --patch=[{...}]
when:
before:
deployments: all
There is a chance that users can commit modified version of kustomization.yaml ( even with hook which will remove patch ), beacuse kustomize edit add patch command actualy modifies kustomization.yaml file itself.
Additional context
Thanks
/kind feature
@lukasmrtvy thanks for creating this issue! Yes thats a good idea, we should add support for patches with kustomize
@FabianKramm - any update on this issue? We are currently moving some of our apps from Helm to Kustomize and utilise the features in Devspace to interpolate the values/variables to amend the Image Repository value but we cannot do this at present in Kustomize unless we use the Hooks suggestion above.