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:
1variant: fcos
2version: 1.5.0
3systemd:
4 units:
5 - name: mw-agent.service
6 enabled: true
7 contents: |
8 [Unit]
9 Description=Middleware Agent
10 After=docker.service
11 [Service]
12 Environment="MW_API_KEY=<MW_API_KEY>"
13 Environment="MW_TARGET=https://<MW_UID>.middleware.io:443"
14 ExecStart=/usr/bin/docker run \
15 --name mw-agent \
16 --privileged \
17 -e MW_API_KEY \
18 -e MW_TARGET \
19 ghcr.io/middleware-labs/mw-host-agent:master
20 Restart=always
21 [Install]
22 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:
1butane 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:
1MW_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:
1docker 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:
1sudo systemctl status mw-agent.serviceAgent logs:
1sudo journalctl -u mw-agent.service
2docker 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: Get in touch with us via our Contact Us.
Uninstall#
If you need to remove the Middleware.io Infra Agent from your Fedora CoreOS host, follow these steps:
1 Stop & disable the service:#
1sudo systemctl stop mw-agent.service
2sudo systemctl disable mw-agent.service2 Remove the systemd unit:#
1sudo rm /etc/systemd/system/mw-agent.service
2sudo systemctl daemon-reload3 Remove the Docker container:#
1docker rm -f mw-agent4 (Optional) Remove the agent image:#
1docker 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? Get in touch with us via our Contact Us or join our Slack channel.
What did you think of this content?