In this article, we detail how to integrate the ArgoCD Vault plugin with ArgoCD. This integration enables automatic retrieval of secrets directly from Vault, simplifying and securing the management of your Kubernetes secrets.Documentation Index
Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This setup comprises a Git repository containing Kubernetes manifests, an ArgoCD instance, a Vault server, and a Kubernetes cluster. ArgoCD periodically pulls manifests from the Git repository. One such manifest is a secret template that includes an annotation for the Vault plugin along with a placeholder for the actual secret value. For example:Plugin Integration Approaches
ArgoCD supports custom tooling via configuration management plugins. The Vault plugin can be integrated using two approaches:-
Direct Integration via ConfigMap
If the plugin is lightweight (requiring only a few lines), you can add its configuration directly to the ArgoCD ConfigMap. The repo server pod runs the plugin commands accordingly. -
Sidecar Integration
For more complex plugins that may clutter the ArgoCD ConfigMap, consider deploying the plugin as a sidecar container alongside the repo server.
Modifying the ArgoCD Repo Server
To integrate the Vault plugin, start by modifying the ArgoCD repo server deployment:- Define an empty directory volume to hold custom binaries.
- Use an init container to download the ArgoCD Vault plugin binary and move it to the custom tools directory. This binary is made available to the main container during runtime.
Ensure that the URL provided for the plugin binary is correct and that the binary version is compatible with your ArgoCD installation.
Registering the Plugin with ArgoCD
Once the plugin binary is in place, register it with ArgoCD by updating the ConfigMap under the configuration management plugins section. After updating the ConfigMap, restart the ArgoCD repo server deployment. For instance:Configuring Vault Connectivity
After registering the plugin, configure it to authenticate with your Vault server. You can choose between two common approaches:- Create a dedicated Kubernetes secret containing Vault configurations and reference it from the repo server container.
- Embed the Vault configuration directly within each ArgoCD application’s manifest.
Always ensure that Vault credentials and configurations are secured appropriately. It is recommended to use Kubernetes Secrets to store sensitive Vault information.