Kubernetes Agent with ArgoCD

This guide walks you through installing the Infrastructure Agent (Infra Agent) in Kubernetes environment using ArgoCD. ArgoCD provides a GitOps approach to deploying and managing the Middleware agent with declarative configuration and automated synchronization.

Prerequisites

1 Kubernetes Cluster with ArgoCD

A running Kubernetes cluster with ArgoCD installed and configured.

Verify ArgoCD is running:

2 Kubernetes Access

Access to Kubernetes cluster and client (i.e. kubectl)

kubectl version should be >= v1.17.0. You can verify the current version via this command:

3 ArgoCD CLI (Optional)

Install ArgoCD CLI for command-line operations and complete the login process (optional, can also use ArgoCD UI)

Verify ArgoCD CLI installation:

Installation Methods

Method 1: ArgoCD UI Configuration

This method uses the ArgoCD web interface to create and manage your Middleware agent deployment

Step 1: Generate Values Configuration

First, generate the Helm values configuration for your Middleware agent.

Example generated_values.yaml configuration:

Cluster name is auto-detected from Kubernetes context. Override if not detected or want to change the default name .

Step 2: Create ArgoCD Application via UI

  1. Access your ArgoCD UI (typically available at https://your-argocd-server)
  2. Click "New App" to create a new application
  3. Fill in the following configuration:

General Settings:

  • Application name: mw-agent (or your preferred name)
  • Project name: default (or your target project)
  • Sync Policy: Manual (recommended for initial setup)

Source Settings:

  • Repository URL: https://helm.middleware.io
  • Chart: mw-kube-agent-v3
  • Change the dropdown from "GIT" to "HELM"
  • Version: Latest stable version (avoid older versions)

Destination Settings:

  • Cluster URL: https://kubernetes.default.svc (for same cluster as ArgoCD)
  • Namespace: mw-agent-ns
ArgoCD Application Configuration

Step 3: Configure Helm Values

  1. In the "Parameters" section, change the category from "Directory" to "Helm"
  2. Paste your generated_values.yaml configuration into the "VALUES" field (not "VALUES FILES")

Make sure you fill in the VALUES field, not VALUES FILES

ArgoCD Helm Values Configuration

Step 4: Add Ignore Differences

Click "Edit as YAML" and add the following ignoreDifferences section to prevent sync issues with ConfigMaps:

ArgoCD YAML Editor

Step 5: Deploy and Sync

  1. Click "CREATE" to create the application
  2. Click "SYNC" to deploy the Middleware agent
  3. Select "Synchronize" to apply all resources
ArgoCD Sync Process

Method 2: Declarative Configuration

Generate the Helm values file for the MW Agent as outlined above, then commit and push it to your Git repository.

After that, create an ArgoCD Application that points to this values file

Apply the configuration:

Verification

Option 1: Check ArgoCD Application Status

Verify the application is healthy in ArgoCD UI or via CLI:

Option 2: Verify Kubernetes Resources

Check that the Middleware agent pods are running:

Kubernetes Pods Verification

Option 3: Validate Middleware Dashboard

Navigate to your Middleware dashboard and confirm that metrics are appearing. It may take a few minutes for data to start flowing.

Upgrade

Via ArgoCD UI

  1. Navigate to your Middleware application in ArgoCD UI
  2. Click on the application name
  3. Click "APP DETAILS" and then "EDIT"
  4. Update the target revision to the desired version
  5. Click "SAVE" and then "SYNC"
ArgoCD Application Edit
ArgoCD Application Upgrade

Via Declarative Configuration

Update the targetRevision in your Application manifest and apply:

Common Issues

Application Not Syncing:

  • Check ArgoCD has proper permissions to access the target namespace
  • Verify the Helm chart repository is accessible
  • Review ArgoCD application events for specific error messages

Pods Not Starting:

  • Check resource quotas in the target namespace
  • Review pod logs: kubectl logs -n mw-agent-ns -l app=mw-kube-agent

No Metrics in Dashboard:

  • Confirm Kubernetes cluster has internet access
  • Verify API key and target are correct
  • Check agent logs for connection errors
  • Ensure only one MW Agent is running per node

ArgoCD-Specific Issues

Continuous Out-of-Sync Status: Ensure ignoreDifferences is properly configured for ConfigMaps that are dynamically updated by the agent.

Permission Denied: Verify ArgoCD has proper RBAC permissions to create resources in the mw-agent-ns namespace.

Uninstall

Via ArgoCD UI

  1. Navigate to the Middleware application in ArgoCD UI
  2. Click "DELETE"
  3. Confirm deletion by typing the application name
ArgoCD Application Delete

Via ArgoCD CLI

Via kubectl (if using declarative configuration)

Deleting the ArgoCD application will automatically remove all Kubernetes resources created by the Middleware agent,

Need assistance or want to learn more about Middleware? Contact our support team at [email protected].