Open morey-tech opened 11 months ago
I think this is actually an enhancement request, i.e. automatically create kustomization.yaml for the user if spec.source.kustomize
is populated and the file doesn't already exist.
Good point. The bug is the wording and example in the docs. The feature request is the expected behaviour. I'll put in a PR for the former.
@morey-tech as I understand the use case is to allow users to apply last mile customization to any application (plain yaml, helm, plugin etc), correct? In this case Argo CD cannot just auto-create kustomization.yaml. E.g. app is helm-based then auto-creating kustomization.yaml would switch app to kustomize rendering and just break manifest generation. I think it is an entirely different feature. Argo CD would need to generate manifests first, then store result in e.g. all.yaml
and leverage kustomize to apply patches on top. This would require a new field in the application spec:
spec:
...
## The field definitely should not be kustomize, because kustomize holds "inputs" for kustomize based apps.
overrides:
patches:
- target:
kind: Deployment
name: guestbook-ui
patch: |-
- op: replace
path: /spec/template/spec/containers/0/ports/0/containerPort
value: 443
@alexmt My thought when contributing to the docs was the inline kustomization feature was to avoid needing any kustomize.yaml
Definitely would appreciate a built in way to do last mile modifications to resources.
Until then I created a quick plugin for doing kustomizations inline.
echo "$ARGOCD_ENV_KUSTOMIZATION_YAML" > kustomization.yaml;
kustomize build
And able to consume do everything inline
https://github.com/acelinkio/argocd-homelab/blob/main/manifest/knative-serving.yaml
I'll try to create an equivalent one for doing last mile modification to helm charts. (Definitely do not want to leverage kustomize to use the helm binanry and do a helm release)
@morey-tech is there any possibility to get this roadmaped? Thanks in advance
Checklist:
argocd version
.Describe the bug The docs (add in https://github.com/crenshaw-dev/argo-cd/pull/20/) state that:
However, when using the
kustomize.patches
field, the Application expects thepath
to contain akustomization.yaml
file. Without one, the sync will fail with the erroropen <path to cached source>/<path>/kustomization.yaml: no such file or directory
.To Reproduce Deploy the Application from the example in the docs:
Expected behavior
The Application should ignore a missing
kustomization.yaml
file in thepath
whenkustomize.patches
is used. Or some equivalent (e.g. a toggle to allow missing).Screenshots
Version
Logs