Use Harness expressions in GitOps manifests
Inject Harness service variables, environment variables, and secrets into Argo CD manifests at manifest generation time.
Use the Harness GitOps plugin to resolve Harness expressions in Kubernetes manifests during Argo CD's manifest generation phase. This lets you inject dynamic values from Harness services and environments into your manifests before Argo CD applies them to the cluster.
Application detection
The Harness plugin uses an explicit, per-application connection to determine which applications it processes. The plugin does not automatically claim an application based on repository contents alone. Each application must specify one of the following:
spec.source.plugin.name: argocd-harness-pluginon the Argo CD Application..harness.yamlin the application's source directory.
Without an explicit connection, Harness expressions remain unresolved in generated manifests.
Go to Connect an application to the plugin to configure the connection.
What you will learn from this topic
How to configure the plugin on new or existing GitOps agents
How to connect an application to the plugin so expressions resolve
How the plugin detects your manifest tool (Helm, Kustomize, or plain manifests)
How to use expressions for service variables, environment variables, and secrets
How to override variables per environment
How to troubleshoot common expression resolution issues
Before you begin
Before using Harness expressions in GitOps manifests, ensure you have:
GitOps Agent: Agent version v0.105.x or later installed and running. Go to Install a Harness GitOps Agent for installation steps.
Agent installer helper:
gitops-agent-installer-helperversion v0.0.16 or later (v0.0.18 or later is required for Kustomize support).Harness service: A GitOps service configured with variables. Go to GitOps services to create and configure services.
Harness environment: An environment configured with variables and linked to your service. Go to Environments overview to configure environments and variables.
Configure the Harness Argo CD plugin
Do this once when setting up the agent. If the plugin is already enabled on your agent, skip to Connect an application to the plugin.
For new Agent installations: Select the Enable ArgoCD Harness Plugin (Required for Harness expression resolution) checkbox during GitOps agent installation to use this feature. No additional configuration is needed.

For existing Agent installations (BYOA or Harness-installed Argo): The Enable ArgoCD Harness Plugin (Required for Harness expression resolution) checkbox cannot be changed after the initial installation. You must configure the Harness Argo CD plugin manually. Go to Enable the plugin on an existing agent or BYOA for instructions.
Once enabled, connect each Application to the plugin and use expressions in your manifests:
Step 1. Connect the Application to the plugin
Set the plugin name on the Application:
Or add .harness.yaml to the Application's source directory. Go to Connect an application to the plugin for details on both methods.
Step 2. Use expressions in your manifests
Expressions resolve at manifest generation time. Sync (or let auto-sync trigger) and the deployed manifest contains the resolved values.
Limitations
The following limitations apply when you use the Harness plugin:
Kustomize secretGenerator
Secret resolution inside secretGenerator-produced Secret objects is unverified; use plain Secret manifests instead until confirmed.
Application source type shows as Plugin
Argo CD shows source type as Plugin instead of Helm/Directory. Path listing in UI will not work; specify paths manually.
HELM_ARGS
Shell-injection risk; go to HELM_ARGS environment variable for the warning.
Connect an application to the plugin
Application routing is required
The plugin processes an application's manifests only when Argo CD is configured to route the application to the Harness plugin. If the application is not routed to the plugin, Harness expressions remain unresolved and appear literally in the generated manifests.
There are two ways to connect an Application to the plugin. Use either method:
Explicit plugin name
Set spec.source.plugin.name: argocd-harness-plugin on the Application
File-based activation
Add .harness.yaml to the Application's source directory
Explicit plugin name:
File-based activation: commit .harness.yaml to the application's source directory:
In the example below, the Argo CD Application's spec.source.path is helm-guestbook. The .harness.yaml file is committed inside that directory, alongside Chart.yaml and values.yaml.

.harness.yaml must be inside spec.source.path
Argo CD checks for the file inside the Application's source path. If your Application's path is charts/myapp, the file must be at charts/myapp/.harness.yaml. A file at the repo root will not be found.
Custom activation conditions (optional, advanced)
Not required for most setups. Use this only if neither the explicit plugin name nor the .harness.yaml marker fits your workflow, for example, if you want to use a different filename, or check for multiple possible markers.
The plugin checks for .harness.yaml using a shell command in the ConfigManagementPlugin spec. You can replace that command with any shell expression that exits 0 for applications the plugin should process and non-zero for those it should not. The command runs inside the Application's source directory (spec.source.path).
To customize, edit the discover.find.command in the plugin ConfigMap directly. Go to Enable the plugin on an existing agent or BYOA for the ConfigMap structure.
Or check for a specific key inside the file:
The built-in default (test -f .harness.yaml) is sufficient for almost all cases. Custom conditions are a BYOA or Helm-managed install concern; Harness-provisioned agents manage this ConfigMap automatically.
Manifest tool selection
No configuration needed for most applications. The plugin detects Helm, Kustomize, or plain manifests automatically. Read this section only if auto-detection is picking the wrong tool for your application.
Tool selection at generation time
Once the plugin is processing an Application, it auto-detects the manifest tool by inspecting the source directory. For most applications this requires no configuration. The following table lists the detection rules:
kustomization.yaml, kustomization.yml, or Kustomization exists
kustomize build .
Chart.yaml or values.yaml exists
helm template
None of the above
Plain manifests (native)
Expressions are resolved on the tool's output, after Helm or Kustomize has already rendered the manifests.
If auto-detection picks the wrong tool, you can override it. Go to Overriding the manifest tool.
Plain manifests
No Chart.yaml or kustomization.yaml: just raw manifests. No extra configuration needed:
Helm
Plugin runs helm template and resolves expressions in the output. Helm subchart dependencies (helm dependency build) run automatically; no need to vendor charts/:
Kustomize
Plugin runs kustomize build . and resolves expressions in the output. Expressions can appear in any resource Kustomize renders, including patches:
Kustomize and secretGenerator
Expression resolution for kind: Secret objects produced by Kustomize's secretGenerator is not yet verified. Use plain Secret manifests (not secretGenerator) if you need secret injection with Kustomize.
Overriding the manifest tool
If auto-detection picks the wrong tool, add a tool: key to .harness.yaml:
Expression reference
All expressions resolve at manifest generation time (pre-deployment, not runtime).
Expression types
The following expressions are available in GitOps manifests:
<+serviceVariables.name>
Service-level variables
<+serviceVariables.replicas>
<+env.variables.name>
Environment-level variables
<+env.variables.logLevel>
<+env.name>
Environment display name
production
<+env.identifier>
Environment identifier
prod
<+env.type>
Environment type
Production or PreProduction
<+env.description>
Environment description
<+variable.account.name>
Account-scope fixed variable
<+variable.account.companyId>
<+variable.org.name>
Org-scope fixed variable
<+variable.org.defaultRegion>
<+variable.name>
Project-scope fixed variable
<+variable.projectCode>
<+secrets.getValue("ref")>
Secret (direct reference)
<+secrets.getValue("vault_secret")>
<+serviceVariables.name> (Secret type)
Secret via service variable
resolves to <+secrets.getValue(...)>
Define variables
Service variables: Deployments -> Services -> select the service -> Configuration -> Variables
Environment variables: Deployments -> Environments -> select the environment -> Configuration -> Variables
Fixed variables: Account, Org, or Project Settings -> Variables
Override priority
When the same variable name exists at multiple levels, the highest-priority override wins:
The following table describes each override type:
ENV_SERVICE
Environment -> Service Overrides -> select service
Overrides a service variable for a specific service and environment pair
ENV_GLOBAL
Environment -> Configuration -> Variables
Overrides an environment variable for all services in that environment
Secret variables
Variables defined as type Secret in Harness go through two-stage resolution:
Manifest generation:
<+serviceVariables.dbPassword>resolves to<+secrets.getValue('account.prodDbPassword')>.Deployment time: The actual secret value is injected into the cluster.
Complete example
GitOps expressions vs pipeline expressions
GitOps expressions are a subset of Harness expressions: they only have access to service and environment context, not pipeline runtime context.
The following table compares GitOps expressions and pipeline expressions:
When resolved
Manifest generation (pre-deploy)
Pipeline runtime
Context
Service + environment + metadata
Full pipeline (artifact.*, infra.*, stage.*, etc.)
Not available
pipeline.*, stage.*, artifact.*, infra.*
Use GitOps expressions when the value is known at manifest generation time and tied to service or environment config. Use pipeline expressions for artifact versions, build numbers, or step outputs.
Enable the plugin on an existing agent or BYOA
The Enable ArgoCD Harness Plugin checkbox can only be set at initial Agent installation. Use one of these patch paths if your agent is already installed.
Helm chart installations
Set in
values.yaml:Upgrade the release:
Verify Kustomize is available (requires sidecar image ≥
v0.0.18):If
kustomize versionreturns "command not found," bump the sidecar image tag abovev0.0.18and re-apply.
Plain Kubernetes manifest installations
Apply the plugin ConfigMap:
Patch the
argocd-repo-serverDeployment to add the sidecar (skip if already present):Verify:
HELM_ARGS environment variable
The plugin passes ${ARGOCD_ENV_HELM_ARGS} directly to helm template:
Shell injection risk
HELM_ARGS is passed to helm template without escaping. Only use it when all users with Application edit access are trusted. Prefer chart-native values.yaml overrides in shared or multi-tenant clusters.
Troubleshooting
Next steps
Secret injection in GitOps applications: Vault, Harness Secret Manager, and security model
Manage GitOps Applications: Create, sync, and manage ArgoCD applications in Harness
Harness GitOps basics: Core concepts and architecture of Harness GitOps
Last updated
Was this helpful?