Argo CD
How to install and use the CloudTruth Argo CD Plugin
Last updated
How to install and use the CloudTruth Argo CD Plugin
Last updated
Copyright© 2023 CloudTruth
This walkthrough shows you how to use CloudTruth parameters and secrets in Argo CD directly from our Argo CD plugin.
You are familiar with Argo CD.
You have created one or more CloudTruth Parameters.
You have created a CloudTruth API Access token.
The CloudTruth plugin solves how to handle secrets management with Argo CD. When the plugin is installed in your application it will replace any references following the format <parameter>
in your GitOps yaml files.
You can run an automated installer that will install the plugin in your Argo CD installation.
Provide the installer with the following CloudTruth parameters:
The installer will perform the following to configure the plugin in your Argo CD installation:
Create a K8s secret
with the provided parameters in the Argo namespace.
Patch the argocd-repo-server to add the sidecar container and attach the secret
Restart the Argo CD repo server to pick up the changes.
For a full parameters list visit our Argo plugin repo.
Now that the plugin is installed, you can reference CloudTruth config in your app config files. The plugin is enabled for your argocd application in a gitops fashion by creating the file .argocd-cloudtruth-plugin
in the root of your Application's repo, or in a subdirectory if you qualify that repo with a path. The file can be empty or contain a yaml dictionary to override the plugin's configuration for that repo.
The new plugin sidecar mechanism prevents one from using the UI or CLI to enable a plugin if the gitops style enablement is in place. If the gitops style is not for you, you can still force enablement by manually defining the Application manifest.
You can still override any installation parameter values for your specific app with parameters
With the new sidecar plugin scheme, the Argo CLI does not allow you to create apps with the plugin enabled, however, you can create an app and the plugin will automatically be enabled for it if the repo contains the trigger file .argocd-cloudtruth-plugin
The following are a few examples of using the CloudTruth plugin with the Argo CLI.
Create an application:
Create an application and specify a specific project:
Create an application and specify a specific project and environment:
Add the plugin to existing apps by adding the trigger file .argocd-cloudtruth-plugin
to your Application's repo:
To update a plugin parameter value to existing app:
Here is an example use case with the Argo CD plugin that populates a ConfigMap with values pulled from CloudTruth while deploying an application in a GitOps workflow.
We will deploy a flask application from our demo Git repo.
The ConfigMap substitutes data values from CloudTruth using the default substitution format <YOUR_PARAM_NAME>
.
You can use the CloudTruth CLI that sets up a project to deploy this example.
Deploy the app with the following Argo CLI command:
The argocd app create
is broken down into the following commands. The --plugin-env
commands specify the CloudTruth environment to get values from. The project name for the plugin is read from the .argocd-cloudtruth-plugin
file in the repo.
Verify the ConfigMap has values from the configured CloudTruth project with the manifests
command:
Deploy by synching the app:
You can also deploy and verify the app health in the Argo UI.
Parameter | Value |
---|---|
Command | Value |
---|---|
Provides access to your CloudTruth org
Specifies a targeted Environment
Specifies a targeted project
Specifies a targeted tag
--repo
--path
argo-flask/cloudtruth-plugin
--dest-server
https://kubernetes.default.svc
--dest-namespace
default
--plugin-env
CLOUDTRUTH_ENVIRONMENT=production