Platform-specific scripts
This method is useful for quick setup or automated provisioning.
Step 1: Download the installation script
MW_API_KEY="your-initial-token" MW_TARGET=your-initial-uid bash -c "$(curl -L https://install.middleware.io/scripts/mw-kube-agent-install-v3.sh)"
MW_API_KEY="..."
MW_TARGET="..."
are the environment variables being set inline for the command that follows. They are only active for this specific command execution and don't permanently modify your shell's environment. Change "your-initial-token"
to your MiddleWare API token.
bash -c "..."
tells your shell to execute the string within the double quotes as a bash command.curl -L
downloads the script from the specified URL. The -L flag ensures curl follows any redirects. $()
is the command substitution that executes the curl command first, captures its output (which is the content of the script), and then passes that output (the script content) to bash -c for execution.
Download the Middleware Agent batch file here. Open PowerShell, change the directory to the location of the download, and execute the following commands:
set MW_API_KEY="your-initial-token" set MW_TARGET=your-initial-uid mw-kube-agent-install-windows.bat
MW_API_KEY="..."
MW_TARGET="..."
are your environment variables being set inline for the command that follows. They are only active for this specific command execution.
Review the script for security purposes.
Step 2: Run the script
- Ensure that you have kubectl installed and configured to connect to the correct Kubernetes cluster where you want to install the agent.
- Verify that you have curl installed on your system.
- Copy the commands above.
- Paste the copied command directly into your terminal and press Enter.
Step 3: Verify the 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 the 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 4: 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.
Run only one Middleware Agent DaemonSet per cluster per host. Multiple agents will cause unexpected behavior.
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:
bash -c "$(curl -L https://install.middleware.io/scripts/mw-kube-agent-upgrade.sh)"
To upgrade the agent from windows, you must uninstall the installed version of the agent and reinstall the latest version using steps 1 - 4 above or using the helm method.
Uninstall the agent
To uninstall the Middleware Agent use the following command:
bash -c "$(curl -L https://install.middleware.io/scripts/mw-kube-agent-uninstall-v3.sh)"
Download the MW Kubernetes Uninstall script and execute the following command:
Powershell
.\mw-kube-agent-uninstall-powershell.ps1
If you encounter any issues, check the troubleshooting page. To further configure and customize the installed agent, see the customization guide.
Need assistance or want to learn more about Middleware? Contact our support team at [email protected].