supplemental/helm/beszel-agent/README.md
A Kubernetes Helm chart for deploying Beszel Agent - a lightweight monitoring agent that collects system metrics and sends them to a central Beszel Hub.
This Helm chart simplifies the deployment of Beszel Agent in Kubernetes environments. By default, it deploys as a DaemonSet to run one agent on each node in the cluster. The agent monitors node-level system resources (CPU, memory, disk, network, temperature, GPU, etc.) and provides detailed metrics to the Beszel Hub for centralized monitoring and alerting.
In Kubernetes environments, the Beszel agent monitors node-level metrics:
hostNetwork: true)Note: The agent does not monitor individual Kubernetes pods or containers. For pod/container metrics, use Kubernetes metrics-server or monitoring tools like Prometheus.
helm install beszel-agent oci://ghcr.io/henrygd/beszel-charts/beszel-agent \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-token-value" \
--set env.HUB_URL="http://beszel-hub:8090"
Or with custom values:
helm install beszel-agent oci://ghcr.io/henrygd/beszel-charts/beszel-agent -f custom-values.yaml
kubectl get pods -l app.kubernetes.io/name=beszel-agent
kubectl logs -l app.kubernetes.io/name=beszel-agent
Essential parameters to configure:
| Parameter | Default | Description |
|---|---|---|
daemonset.enabled | true | Deploy as DaemonSet (one pod per node) |
env.KEY | Required* | SSH public key for Hub authentication (*unless using existingSecret) |
env.TOKEN | Empty | Authentication token (optional) |
env.HUB_URL | Empty | Hub URL (e.g., http://beszel-hub:8090) |
env.PORT | 45876 | Port the agent listens on |
secret.existingSecret | Empty | Name of an existing Kubernetes Secret to use |
secret.sshKey | ssh-key | Key name in the secret for the SSH public key |
secret.tokenKey | token | Key name in the secret for the authentication token |
image.repository | henrygd/beszel-agent | Container image |
image.tag | Chart AppVersion (0.18.8) | Image version |
hostNetwork | false | Use host network for network monitoring |
tolerations | Allows all taints | Tolerations for running on tainted nodes |
helm install beszel-agent ./beszel-agent \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-token-value" \
--set env.HUB_URL="http://beszel-hub:8090"
# values.yaml
image:
repository: henrygd/beszel-agent
tag: "" # Uses chart appVersion
env:
PORT: "45876"
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-token-value"
HUB_URL: "http://beszel-hub:8090"
# Use host network for accurate network monitoring
hostNetwork: false
For systems with NVIDIA GPUs, use the special GPU-enabled image:
image:
repository: henrygd/beszel-agent-nvidia
# Enable NVIDIA runtime
gpuRuntime: nvidia
env:
PORT: "45876"
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-token-value"
HUB_URL: "http://beszel-hub:8090"
NVIDIA_VISIBLE_DEVICES: "all"
NVIDIA_DRIVER_CAPABILITIES: "compute,video,utility"
Note: The GPU image (henrygd/beszel-agent-nvidia) is specifically for monitoring NVIDIA GPUs on the node. It does not provide container-level GPU metrics.
Or via CLI:
helm install beszel-agent ./beszel-agent \
--set image.repository=henrygd/beszel-agent-nvidia \
--set gpuRuntime=nvidia \
--set env.NVIDIA_VISIBLE_DEVICES=all \
--set env.NVIDIA_DRIVER_CAPABILITIES="compute,video,utility" \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-token-value" \
--set env.HUB_URL="http://beszel-hub:8090"
To monitor additional disks or partitions:
volumes:
- name: extra-filesystems
hostPath:
path: /mnt/disk/.beszel
type: DirectoryOrCreate
volumeMounts:
- name: extra-filesystems
mountPath: /extra-filesystems
readOnly: true
env:
PORT: "45876"
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-token-value"
HUB_URL: "http://beszel-hub:8090"
resources:
limits:
cpu: 500m
memory: 256Mi
requests:
cpu: 100m
memory: 128Mi
Run agents on specific nodes:
nodeSelector:
monitoring: "true"
tolerations:
- key: monitoring
operator: Equal
value: "true"
effect: NoSchedule
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- beszel-agent
topologyKey: kubernetes.io/hostname
For detailed network statistics, enable host network mode:
hostNetwork: true
env:
PORT: "45876"
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-token-value"
HUB_URL: "http://beszel-hub:8090"
Note: When hostNetwork: true, the agent can monitor the node's actual network interfaces. When false, it only sees the pod's network namespace.
By default, the agent is deployed as a DaemonSet, running one pod on each cluster node:
daemonset:
enabled: true # Default - one agent per node
# Or disable for single Deployment deployment
daemonset:
enabled: false
replicaCount: 1
By default, tolerations are set to allow agents to run on all nodes, including tainted ones:
tolerations:
- operator: Exists
effect: NoSchedule
- operator: Exists
effect: NoExecute
To restrict agents to specific nodes:
tolerations: []
nodeSelector:
monitoring: "true"
The chart supports referencing an existing Kubernetes Secret instead of having the chart create one. This is useful when:
# Create the secret manually
apiVersion: v1
kind: Secret
metadata:
name: my-beszel-secret
type: Opaque
data:
ssh-key: c3NoLWVkMjU1IDEgQUFBQU... # base64 encoded SSH public key
token: dG9rZW4tdmFsdWU= # base64 encoded token (optional)
Then reference it in your values:
secret:
existingSecret: my-beszel-secret
sshKey: ssh-key # key name in the secret (default: ssh-key)
tokenKey: token # key name in the secret (default: token)
env:
HUB_URL: "http://beszel-hub:8090"
Note: When using existingSecret, do not set env.KEY or env.TOKEN - the chart will use the values from the existing secret instead.
You can also use different key names if your secret uses non-standard keys:
secret:
existingSecret: my-beszel-secret
sshKey: public-key # custom key name
tokenKey: auth-token # custom key name
helm install beszel-agent ./beszel-agent \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-token-value" \
--set env.HUB_URL="http://beszel-hub:8090"
This deploys one agent on every node in the cluster automatically.
# values.yaml
daemonset:
enabled: false
replicaCount: 1
env:
PORT: "45876"
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-token-value"
HUB_URL: "http://beszel-hub:8090"
Or via CLI:
helm install beszel-agent ./beszel-agent \
--set daemonset.enabled=false \
--set replicaCount=1 \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-token-value" \
--set env.HUB_URL="http://beszel-hub:8090"
hostNetwork: true
env:
PORT: "45876"
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-token-value"
HUB_URL: "http://beszel-hub:8090"
podSecurityContext:
hostNetwork: true
# List agent pods
kubectl get pods -l app.kubernetes.io/name=beszel-agent
# View agent logs
kubectl logs -l app.kubernetes.io/name=beszel-agent -f
# Describe a specific pod
kubectl describe pod <pod-name>
# Update the SSH key
helm upgrade beszel-agent ./beszel-agent \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-token-value" \
--set env.HUB_URL="http://beszel-hub:8090"
# Change image version
helm upgrade beszel-agent ./beszel-agent \
--set image.tag="0.18.8"
# For DaemonSet (default)
kubectl rollout restart daemonset beszel-agent
# For Deployment (if daemonset.enabled=false)
kubectl rollout restart deployment beszel-agent
helm uninstall beszel-agent
helm history beszel-agent
helm rollback beszel-agent 1 # Rollback to previous version
| Variable | Default | Description |
|---|---|---|
PORT | 45876 | Port the agent listens on |
KEY | Required | SSH public key for Hub authentication |
TOKEN | Empty | Authentication token (optional) |
HUB_URL | Empty | Hub URL (e.g., http://beszel-hub:8090) |
NVIDIA_VISIBLE_DEVICES | Not set | GPU visibility (GPU agents only) |
NVIDIA_DRIVER_CAPABILITIES | Not set | GPU capabilities (GPU agents only) |
# Check pod events and logs
kubectl describe pod <pod-name>
kubectl logs <pod-name>
kubectl exec <pod-name> -- nslookup beszel-hub.default.svc.cluster.localhenrygd/beszel-agent-nvidiakubectl exec <pod-name> -- nvidia-smienv.KEYAdjust resource limits:
resources:
limits:
memory: 512Mi
requests:
memory: 256Mi
The chart automatically creates a Kubernetes Secret to store sensitive authentication data:
# Install with all configuration options
helm install beszel-agent ./beszel-agent \
--set env.KEY="ssh-ed25519 AAAA... your-public-key" \
--set env.TOKEN="your-optional-token" \
--set env.HUB_URL="http://beszel-hub:8090"
Or create the installation with a values file:
# values.yaml
env:
KEY: "ssh-ed25519 AAAA... your-public-key"
TOKEN: "your-optional-token"
HUB_URL: "http://beszel-hub:8090"
Configuration stored in Kubernetes Secrets (encrypted at rest):
KEY - SSH public key for authentication (required)TOKEN - Authentication token (optional)Configuration as regular environment variables:
HUB_URL - Hub address (e.g., http://beszel-hub:8090 or https://beszel.example.com)To verify the secret was created:
kubectl get secret beszel-agent
kubectl get secret beszel-agent -o jsonpath='{.data.ssh-key}' | base64 -d
Note: The main Beszel documentation describes Docker/Podman container monitoring. In Kubernetes, the agent focuses on node-level metrics. For Kubernetes-specific container/pod monitoring, use tools like metrics-server, Prometheus, or the Kubernetes Metrics API.
Please refer to the main Beszel project repository for license information.