This is the multi-page printable view of this section.
Click here to print.
Return to the regular view of this page.
Deploy
The HUATUO collector huatuo-bamai runs on physical machines or VMs.
We provide both binary packages and Docker images, and you can deploy them in any custom way, such as:
- systemd and DaemonSet deployments are recommended for production.
- Docker / Compose is suitable for development and quick validation scenarios.
Binary Download
The latest binary package provided is v2.1.0; the master branch is for reference only.
Mirror Download
Docker images are stored on Docker Hub by default (https://hub.docker.com/u/huatuo).
1 - Daemonset
HUATUO provides the simplest DaemonSet deployment option to minimize setup complexity.
Deploying the HUATUO collector via DaemonSet involves the following steps:
1. Download the Collector Configuration File
curl -L -o huatuo-bamai.conf https://github.com/ccfos/huatuo/raw/main/huatuo-bamai.conf
Modify this configuration file according to your environment, such as kubelet connection settings and Elasticsearch settings.
2. Create a ConfigMap
kubectl create configmap huatuo-bamai-config --from-file=./huatuo-bamai.conf
3. Deploy the Collector
kubectl apply -f huatuo-daemonset.minimal.yaml
Contents of huatuo-daemonset.minimal.yaml:
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: huatuo
namespace: default
labels:
app: huatuo
spec:
selector:
matchLabels:
app: huatuo
template:
metadata:
labels:
app: huatuo
spec:
containers:
- name: huatuo
image: docker.io/huatuo/huatuo-bamai:latest
resources:
limits:
cpu: '1'
memory: 2Gi
requests:
cpu: 500m
memory: 512Mi
securityContext:
privileged: true
volumeMounts:
- name: proc
mountPath: /proc
- name: sys
mountPath: /sys
- name: run
mountPath: /run
- name: var
mountPath: /var
- name: etc
mountPath: /etc
- name: huatuo-local
mountPath: /home/huatuo-bamai/huatuo-local
- name: huatuo-bamai-config-volume
mountPath: /home/huatuo-bamai/conf/huatuo-bamai.conf
subPath: huatuo-bamai.conf
volumes:
- name: proc
hostPath:
path: /proc
- name: sys
hostPath:
path: /sys
- name: run
hostPath:
path: /run
- name: var
hostPath:
path: /var
- name: etc
hostPath:
path: /etc
- name: huatuo-local
hostPath:
path: /var/log/huatuo/huatuo-local
type: DirectoryOrCreate
- name: huatuo-bamai-config-volume
configMap:
name: huatuo-bamai-config
hostNetwork: true
hostPID: true
2 - Docker
Run Only the Collector
Start the Container
docker run --privileged --cgroupns=host --network=host -v /sys:/sys -v /proc:/proc -v /run:/run huatuo/huatuo-bamai:latest
⚠️ This uses the default configuration file inside the container. The internal default configuration does not connect to Elasticsearch. For a complete setup, mount your own huatuo-bamai.conf using -v, and update the config according to your environment (kubelet access, Elasticsearch settings, local log storage path, etc.).
Deploy All Components (Docker Compose)
For local development and validation, using Docker Compose is the most convenient approach.
You can quickly launch a full environment containing the collector, Elasticsearch, Prometheus, Grafana, and other components.
docker compose --project-directory ./build/docker up
It is recommended to install Docker Compose using the plugin method: https://docs.docker.com/compose/install/linux/
3 - Systemd
Install by RPM
OpenCloudOS currently provides the v2.1.0 RPM package; the master is for reference only.
Tencent OpenCloudOS provides an official HUATUO package:
https://mirrors.opencloudos.tech/epol/9/Everything/x86_64/os/Packages/huatuo-bamai-2.1.0-2.oc9.x86_64.rpm
This allows HUATUO to be quickly installed and enabled on OpenCloudOS.
wget https://mirrors.opencloudos.tech/epol/9/Everything/x86_64/os/Packages/huatuo-bamai-2.1.0-2.oc9.x86_64.rpm
wget https://mirrors.opencloudos.tech/epol/9/Everything/aarch64/os/Packages/huatuo-bamai-2.1.0-2.oc9.aarch64.rpm
sudo rpm -ivh huatuo-bamai*.rpm
Other RPM-based operating systems can install HUATUO the same way.
As usual, you must update the config file according to your environment (e.g., kubelet connection, Elasticsearch settings).
Full OpenCloudOS installation guide:
https://mp.weixin.qq.com/s/Gmst4_FsbXUIhuJw1BXNnQ
Install by Binary Package
The latest binary package provided is v2.1.0; the master branch is for reference only.
You can also download the binary package and configure/manage it manually.
Again, update the configuration file based on your actual environment (kubelet connection, Elasticsearch settings, etc.).