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.target

Replace <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.ign

Use 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:

ActionCommand
Start Agentsudo systemctl start mw-agent.service
Stop Agentsudo systemctl stop mw-agent.service
Restart Agentsudo systemctl restart mw-agent.service
Check service statussudo systemctl status mw-agent.service
View service logssudo journalctl -u mw-agent.service --no-pager
Verify Docker containerdocker 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:master

to 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.service

Agent logs:

1sudo journalctl -u mw-agent.service
2docker logs mw-agent
  • Config verification: Ensure your MW_API_KEY and MW_TARGET are 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:

1sudo systemctl stop mw-agent.service
2sudo systemctl disable mw-agent.service

2 Remove the systemd unit:

1sudo rm /etc/systemd/system/mw-agent.service
2sudo systemctl daemon-reload

3 Remove the Docker container:

1docker rm -f mw-agent

4 (Optional) Remove the agent image:

1docker rmi ghcr.io/middleware-labs/mw-host-agent:master

5 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.