With the current version of Helm, it’s not possible to merge multiple values files. It will override the list from the preceding values file. While trying to solve this problem, I stumbled upon this custom plugin that can take a folder of values files and split them into individual files. This plugin is what I was looking for to solve my problem. Finally, I want to integrate this plugin into my ArgoCD instance.
You’ll need to perform the following steps:
Install Helm Plugin using InitContainer of the repo server.
The configuration management plugin installation entails two steps. First, create a ConfigMap of your CMP configuration, then configure the plugin via sidecar for the repo server. For additional details, see the ArgoCD documentation.
Finally, create an Argo Application to test the multi-values plugin.
We’ll use the custom tooling methodology to add the helm multivalues plugin to the repo server. Update the ArgoCD operator CR to add an init container to the repo spec and volumes to install the helm plugin. We must also add Helm environment variables to override default data, config, and cache paths.
Next, create a ConfigMap with the configuration for the plugin. The generate command under spec section runs in the Application source directory each time manifests need to generate output. As per the plugin documentation, we need to run the helm multivalues [ORIGINAL_COMMAND] -f [VALUES_FOLDER_PATH] [ORIGINAL_ARGS] to generate the output as a stdout
The code snippet above uses an argocd image to mount the plugin we installed in the earlier step and plugin.yaml in the container using the ConfigMap we just created.
Other mounts from Argo CD are necessary, like /var/run/argocd (that contains the argocd-cmp-server command that needs to run) and /home/argocd/cmp-server/plugins.
Apply the changes; Operator will rollout a latest changes of the repo-server pod.
Success! The Config Management Plugin ran the commands in the generate section to render out the YAML and Argo CD applied that YAML to the destination cluster.