Supported Platforms
Linux
Debian/Ubuntu and RHEL/CentOS distributions
Docker
Containerized deployment with host metric collection
Kubernetes
DaemonSet and Deployment modes with auto-instrumentation
Windows
Windows Server 2016+ with native service integration
Linux Installation
The agent supports both Debian-based and Red Hat-based Linux distributions through an automated installation script.Supported Distributions
Debian/Ubuntu Family:- Ubuntu 18.04, 20.04, 22.04, 24.04
- Debian 9, 10, 11, 12
- RHEL 7, 8, 9
- CentOS 7, 8
- Rocky Linux 8, 9
- AlmaLinux 8, 9
Installation Command
What Gets Installed
The installation script performs the following actions:Configuration Paths
config.go:54-65
- Configuration:
/etc/kmagent/config.yaml - Binary:
/usr/local/bin/kmagent - Logs:
/var/log/kmagent/kmagent.log - Service:
/etc/systemd/system/kmagent.service
Service Management
Uninstallation
Docker Installation
The Docker agent runs as a containerized service that collects host-level metrics and logs through volume mounts.Installation Command
Docker Mode Configuration
The agent detects Docker mode and adjusts its behavior:config.go:14-26
Manual Docker Run
You can also run the agent manually with Docker:Volume Mounts Explained
| Mount Point | Purpose | Access |
|---|---|---|
/var/log:/var/log:ro | Collect system and application logs | Read-only |
/proc:/host/proc:ro | CPU, memory, and process metrics | Read-only |
/sys:/host/sys:ro | System device and hardware metrics | Read-only |
/var/run/docker.sock | Monitor Docker containers | Read-only |
Docker-Specific Features
- Container Discovery: Automatically discovers and monitors running containers
- Docker Metrics: Collects container CPU, memory, network, and disk I/O
- Log Collection: Captures container logs via volume mounts
- Auto-Restart: Container configured with restart policy for reliability
Kubernetes Installation
The Kubernetes deployment uses both DaemonSet (node-level) and Deployment (cluster-level) modes for comprehensive monitoring.Prerequisites
Installation
Helm Configuration
Key configuration options fromvalues.yaml:
values.yaml:1-18
Kubernetes Architecture
The Kubernetes agent runs in two modes: DaemonSet (Node-Level):- Runs one pod per node
- Collects node CPU, memory, disk, network metrics
- Monitors pods running on the node
- Gathers container logs
- Single replica for cluster-wide monitoring
- Collects Kubernetes events
- Monitors cluster resources (namespaces, services, deployments)
- Handles auto-instrumentation coordination
Tolerations for Tainted Nodes
If your cluster uses node taints, configure tolerations:Node Affinity
Fromvalues.yaml, default node affinity prefers:
values.yaml:56-78
- Prefers Linux nodes (weight: 100)
- Avoids spot instances (weight: 80)
- Prefers nodes in availability zones (weight: 60)
GKE Private Cluster Requirements
Windows Installation
The agent runs as a Windows service on Windows Server 2016 and later.Download and Install
- Download the Windows installer from the releases page
- Run the
.exeinstaller with administrator privileges - Follow the installation wizard
- Configure API key and collector endpoint when prompted
Configuration
Windows configuration path:config.go:56-58
- Configuration:
C:\Program Files\KloudMate\kmagent\config.yaml - Binary:
C:\Program Files\KloudMate\kmagent\kmagent.exe - Logs: Windows Event Viewer or
C:\ProgramData\KloudMate\logs\
Service Management
Service Integration
The agent uses the kardianos/service library for cross-platform service management:main.go:121-133
Platform Detection
The agent automatically detects the running platform:updater.go:66-69
linux: Native Linux installationwindows: Native Windows installationdarwin: macOS (limited support)docker: Docker containerized mode
Environment-Specific Features
Linux-Specific
- Systemd integration
- Journald log collection
- Host metric collection via
/procand/sys - Package manager integration (apt/yum)
Docker-Specific
- Container discovery and monitoring
- Docker socket access for metrics
- Volume-mounted log collection
- Container lifecycle tracking
Kubernetes-Specific
- Auto-instrumentation via OpenTelemetry Operator
- DaemonSet for node-level metrics
- Deployment for cluster-level monitoring
- Service discovery
- Resource attributes from K8s API
Windows-Specific
- Windows Event Log integration
- Performance counter collection
- Windows Service Manager integration
- IIS monitoring (if enabled)
Configuration File Differences
While the agent configuration is mostly platform-agnostic, some paths differ:Cross-Platform Command Reference
| Operation | Linux | Docker | Kubernetes | Windows |
|---|---|---|---|---|
| Start | systemctl start kmagent | docker start kloudmate-agent | helm install ... | Start-Service kmagent |
| Stop | systemctl stop kmagent | docker stop kloudmate-agent | helm uninstall ... | Stop-Service kmagent |
| Status | systemctl status kmagent | docker ps -f name=kloudmate | kubectl get pods -n km-agent | Get-Service kmagent |
| Logs | journalctl -u kmagent -f | docker logs -f kloudmate-agent | kubectl logs -n km-agent -l app=km-agent | Get-EventLog -Source kmagent |
| Config | /etc/kmagent/config.yaml | Environment variables | ConfigMap | C:\Program Files\KloudMate\... |
Best Practices
Use Platform-Native Tools
Leverage systemd on Linux, Docker Compose for containers, Helm for Kubernetes, and Services on Windows
Consistent Configuration
Use configuration management tools (Ansible, Terraform) to maintain consistent settings across platforms
Centralized Monitoring
View all agents in the KloudMate dashboard regardless of platform
Platform-Specific Optimization
Configure receivers based on platform capabilities (e.g., Windows Performance Counters, Docker stats)
Troubleshooting by Platform
Linux: Service won't start
Linux: Service won't start
Check:
- SELinux/AppArmor restrictions:
sudo journalctl -xe - File permissions:
ls -la /etc/kmagent/ - Binary permissions:
ls -la /usr/local/bin/kmagent - Port conflicts:
sudo netstat -tulpn | grep 4318
Docker: Container exits immediately
Docker: Container exits immediately
Check:
- Container logs:
docker logs kloudmate-agent - Volume mount permissions
- API key environment variable:
docker inspect kloudmate-agent | grep KM_API_KEY - Network connectivity to collector endpoint
Kubernetes: Pods not scheduling
Kubernetes: Pods not scheduling
Check:
- Pod events:
kubectl describe pod -n km-agent - Node taints and tolerations
- Resource limits and node capacity
- Image pull errors:
kubectl get events -n km-agent
Windows: Service fails to start
Windows: Service fails to start
Check:
- Event Viewer logs (Application log)
- User permissions (must run as Administrator)
- Firewall rules for outbound HTTPS
- Config file syntax:
type "C:\Program Files\KloudMate\kmagent\config.yaml"
Next Steps
Agent Configuration
Learn about agent configuration options
Collector Configuration
Configure the OpenTelemetry Collector