Executing a kubectl patch command from or based on a ConfigOption

I would like to have an option in the KOTS Admin Console, that when selected it runs the a kubectl patch command to patch a value of the kotsadm-confg ConfigMap in the namespace where kots is installed.

Specifically we would like to provide an option to disable garbage collection in the embedded registry from the config panel of kots.

Here are the documents we are trying to execute.

Do you have a recommendation on how to achieve this? Any help provided is greatly appreciated.

Hi @David_Vizena

Would a Kubernetes Job work? It would of course require the necessary permission that allows executing a patch.

This is likely what we will end up having to go with after talking to my colleagues. I was just wondering if there was some functionality that someone else knew up prior to going that route.