Install the MiddleWare agent with Helm
Helm is the recommended way to deploy, upgrade, and customize the Middleware agent.
Step 1: Access Kubernetes Installation
Log in to your Middleware account, navigate to the Installation Page in the bottom left corner and select Kubernetes from the Infrastructure section
Step 2: Identify the Kubernetes Context
The Middleware agent monitors clusters hosted within a specified Kubernetes context. To verify that the current Kubernetes context is where you want to install the Middleware Agent, run this command:
kubectl config current-context
Note the CLUSTER
name from the output.
To switch between kubernetes contexts, see the customization guide.
Step 3: Install the agent
3a. Add the Middleware helm repo
helm repo add middleware-labs https://helm.middleware.io
3b. Run the install command
In the command below, replace <your-cluster-name>
with the cluster name you noted in step 2 above.
helm install mw-agent middleware-labs/mw-kube-agent-v3 --set mw.apiKey=your-initial-token --set mw.target=your-initial-uid --set clusterMetadata.name=<your-cluster-name> -n mw-agent-ns --create-namespace
Run only one Middleware Agent DaemonSet per cluster per host. Multiple agents will cause unexpected behavior.
Step 4: Verify mw-agent
Installation
Verify the status of the Middleware Agent with the following command:
kubectl get daemonset/mw-kube-agent -n mw-agent-ns kubectl get deployment/mw-kube-agent -n mw-agent-ns
Once the Middleware Agent is installed on your cluster, metrics should begin appearing in the Middleware application within a few minutes. If metrics do not appear, confirm that Kubernetes has access to the internet, either directly or through a proxy, and that only one MW Agent is running per cluster.
Step 5: Check Your Dashboard
Open Middleware and ensure metrics are appearing in the Kubernetes section on the Infrastructure tab. Depending on the size of your cluster, it can take a few minutes for metrics to appear. If metrics do not appear after this time head to our troubleshooting page for common issues.
Upgrade the mw-agent
We frequently add new features that improve the performance of the MiddleWare agent. All upgrades are communicated via our Newsletter. In the event of an upgrade, run this command to upgrade the agent:
helm upgrade --reuse-values mw-agent middleware-labs/mw-kube-agent-v3 --set namespace.name=mw-agent-ns -n mw-agent-ns --create-namespace=false --set configUpdaterImage.repository=ghcr.io/middleware-labs/mw-kube-agent-config-updater --set configUpdaterImage.pullPolicy=IfNotPresent --set configUpdaterImage.tag=1.15.1 --set mw.configCheckInterval=60s
Uninstall the agent
Run this command to uninstall the agent:
helm uninstall mw-agent -n mw-agent-ns kubectl delete ns mw-agent-ns
To switch between kubernetes contexts, use an existing secret with helm to manage API keys, or add host tags, see the customization guide. See all data types the agent collects in the data collected guide.
Need assistance or want to learn more about Middleware? Contact our support team at [email protected].