Argo CD CLI Plugin Support¶
Support for kubectl
-like plugins for the argocd
CLI.
Summary¶
Enhance the Argo CD argocd
CLI client to support the ability to provide other CLI tools as "plugins" in a similar way that the Kubernetes kubectl
CLI client provides. This will shift argocd
to be more of a "building block" or "interface" for interacting with Argo CD and plugins can be a means to develop more complex workflows while leaving the baseline argocd use-case small.
Motivation¶
Currently, the argocd
CLI client is-getting/already-is pretty bloated. The solution has either been written-in the support for certain solutions (like ApplicationSets) or having a separate CLI tool in Argo Project Labs (like Autopilot and Vault Plugin).
Having a plugin system makes sense, as we add more and more features down the line (OCI, Hydrator, GitOps Promoter, etc). In this way, we can keep the argocd
CLI "lean" but also extensible and keep things "out of tree". As mentioned before, other tools that can benefit from this besides the Argo CD OCI cli is a tool like argocd-autopilot
. Also, there is a potential for other Argo Project tools to have plugins, like a Rollouts plugin or an argocd-image-updater
plugin for Argo CD.
The idea initially came up during a discussion about adding CLI support for the upcoming OCI integration.
Goals¶
The goal is to provide a plugin mechanism without changing the current behavior of argocd
's subcommands and options.
Non Goals¶
Make any guarantees for any public argocd
plugins provided by any third party.
Proposal¶
Similarly to how kubectl
plugins are handled, The argocd
CLI tool will look in the end user's $PATH
for any binaries that start with argocd-
and execute that binary. For example if I had a binary called argocd-mytool
in my $PATH
, I could call it by running argocd mytool
. Support for tab completion should also be taken into account.
Outstanding Questions¶
Things to consider:
- Should it act exactly like
kubectl
and just look in$PATH
or be more stringent and have users store plugins in~/.config/argocd/plugins
? Similar to Tekton plugins - Is there a way to integrate this with Krew for installing plugins?
- Should we let each plugin manage its own configuration settings or make plugins use
~/.config/argocd/config
and provide a new field called.pluginConfigs
? For example theargocd-mytool
plugin's config will be under.pluginConfigs.mytool
Should we even care/have an opinion? - Should we provide any guidelines to submit a plugin? Do we only "accept" plugins that are in argoproj-labs?