How to patch a k8s yaml file with a plugin

Hi all,
I am trying to create a plugin to modify the YAML definition of K8S resources.
I can see that there is a {{ patch("k8s-something") }}, which allows to append a definition at the end of the file. But I need to make a small chante to a previous definition. But if I put the code in the patch, it will be appended at the end as a new definition, not a modification to the default.

Is there a way to do this, without forking tutor or modifying manually the files created by tutor config save?

I understand the problem you face, but I don’t have a very good solution to offer – that’s because I lack experience with Kubernetes. Could you add an item to the “resources” entry (with the “kustomization-resources” patch) and that item would point to a folder with a kustomization.yml file? From the docs, this would create an “overlay” that would achieve what you want? I think?

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.