Skip to content
This repository has been archived by the owner on Feb 7, 2022. It is now read-only.

craftslab/metalbeat

Repository files navigation

metalbeat

Actions Status Docker Go Report Card License Tag

Introduction

metalbeat is an agent of metalflow written in Go.

Prerequisites

  • Go >= 1.15.0
  • etcd == 3.3.25
  • gRPC == 1.26.0

Build

git clone https://github.com/craftslab/metalbeat.git

cd metalbeat
make build

Run

./metalbeat --config-file="config.yml" --host-addr="127.0.0.1"

Docker

git clone https://github.com/craftslab/metalbeat.git

cd metalbeat
docker build --no-cache -f Dockerfile -t craftslab/metalbeat:latest .
docker run craftslab/metalbeat:latest /metalbeat --config-file="/config.yml" --host-addr="127.0.0.1"

Usage

usage: metalbeat --config-file=CONFIG-FILE --host-addr=HOST-ADDR [<flags>]

Metal Beat

Flags:
  --help                     Show context-sensitive help (also try --help-long
                             and --help-man).
  --version                  Show application version.
  --config-file=CONFIG-FILE  Config file (.yml)
  --host-addr=HOST-ADDR      Host address
# Fetch host address via ifconfig
ifconfig -a | grep inet | grep -v 127.0.0.1 | grep -v 172.17.0.1 | grep -v inet6 | awk '{print $2}' | tr -d "addr:"

Settings

metalbeat parameters can be set in the directory config.

An example of configuration in config.yml:

apiVersion: v1
kind: agent
metadata:
  name: metalbeat
spec:
  etcd:
    host: 127.0.0.1
    port: 2379

Design

design

Etcd

  • Agent
key: /metalflow/agent/{HOST}/register
val: metalbeat
  • Master
key: /metalflow/worker/{HOST}/dispatch
val: {COMMAND}

License

Project License can be found here.

Reference