CoreOS
This guide walks you through installing the Infrastructure Agent (Infra Agent) on a Fedora CoreOS machine. These instructions can also be found on the Installation page in the Middleware application.
Prerequisites
- Butane tool to translate human-readable Butane configs into machine-readable Ignition docs for Fedora CoreOS container Linux.
- A running Fedora CoreOS node with Docker available.
1 Butane Configuration
You will have to create a mw-agent.service systemd unit in your existing Butane configuration:
variant: fcos
version: 1.5.0
systemd:
units:
- name: mw-agent.service
enabled: true
contents: |
[Unit]
Description=Middleware Agent
After=docker.service
[Service]
Environment="MW_API_KEY=<MW_API_KEY>"
Environment="MW_TARGET=https://<MW_UID>.middleware.io:443"
ExecStart=/usr/bin/docker run \
--name mw-agent \
--privileged \
-e MW_API_KEY \
-e MW_TARGET \
ghcr.io/middleware-labs/mw-host-agent:master
Restart=always
[Install]
WantedBy=multi-user.targetReplace <MW_API_KEY> and <MW_UID> with your actual values.
2 Ignition Configuration
Convert your Butane config to an Ignition file:
butane your-configuration.bn > ignition.ignUse the contents of ignition.ign to provision and launch your Fedora CoreOS node.
3 Add Host Tags [Optional]
To embed custom tags, add the MW_HOST_TAGS environment variable (comma-separated key=value pairs) alongside your API key:
MW_HOST_TAGS=key1:value1,key2:value2,... MW_API_KEY="<MW_API_KEY>"Check in the Middleware UI under Infrastructure → [Your Host] → System Information to verify tags.
Managing the Agent Service
Following DataDog’s approach to agent lifecycle management, you can control the mw-agent.service via systemd – for example:
| Action | Command |
|---|---|
| Start Agent | sudo systemctl start mw-agent.service |
| Stop Agent | sudo systemctl stop mw-agent.service |
| Restart Agent | sudo systemctl restart mw-agent.service |
| Check service status | sudo systemctl status mw-agent.service |
| View service logs | sudo journalctl -u mw-agent.service --no-pager |
| Verify Docker container | docker ps -a --filter ancestor=ghcr.io/middleware-labs/mw-host-agent:master |
4 Verify Installation
If the Infra Agent’s status is UP or Exited, the install succeeded; if it’s blank, it failed. Run:
docker ps -a --filter ancestor=ghcr.io/middleware-labs/mw-host-agent:masterto confirm the agent container is present and its exit code.
5 Check Your Dashboard
Navigate to Middleware → Unified Dashboard. It can take up to a few minutes for metrics to show up. If, after waiting, you see no data, move on to troubleshooting.
Troubleshooting
If metrics don’t appear after a few minutes, check for the following:
Service health:
sudo systemctl status mw-agent.serviceAgent logs:
sudo journalctl -u mw-agent.service
docker logs mw-agent- Config verification: Ensure your
MW_API_KEYandMW_TARGETare correctly set in the Ignition config. - Network: Confirm your node can reach
https://<MW_UID>.middleware.io:443. - Further help: Contact Middleware support at [email protected].
Uninstall
If you need to remove the Middleware.io Infra Agent from your Fedora CoreOS host, follow these steps:
1 Stop & disable the service:
sudo systemctl stop mw-agent.service
sudo systemctl disable mw-agent.service2 Remove the systemd unit:
sudo rm /etc/systemd/system/mw-agent.service
sudo systemctl daemon-reload3 Remove the Docker container:
docker rm -f mw-agent4 (Optional) Remove the agent image:
docker rmi ghcr.io/middleware-labs/mw-host-agent:master5 Clean up Ignition/Butane configs:
Remove the mw-agent.service snippet from your .bn/.ign files before reprovisioning.
Need assistance or want to learn more about Middleware? Contact our support team at [email protected] or join our Slack channel.