Single-Step Sensor Installation Guide
This guide covers the steps to install and configure sensors for a Kubernetes cluster using a single-step installation process.
Step 1: Create Configuration File​
Create a file named config.yaml
with the following structure. Update values as needed for your environment.
# config.yaml
KUBECOL_HOST: 127.0.0.1
AGGREGATOR_HOST: kubesense.ai
AGGREGATOR_PORT: "30054"
METRICS_STORE_HOST: kubesense.ai
METRICS_STORE_PORT: "30060"
SENSOR_INSTALLATION_TYPE: legacy
DOCKER_COMPOSE_PROJECT_NAME: kubesense
SENSOR_GROUP_ID: xxx
CLUSTER_NAME: xxx
KUBESENSOR_AUTH: xxx
LOG_PATHS:
# Format: service_name: log_file_path
Step 2: Run Installation Script​
Pass the configuration file to the install script using the following command:
bash <(wget -qO- https://docker.kubesense.ai/setup.sh) sensor config.yaml
This script deploys and configures all required services and components based on the values defined in config.yaml
.
Step 3: APM Instrumentation (Node.js)​
Below is the example for Node.js application instrumentation.
Install OpenTelemetry Packages​
npm install --save @opentelemetry/api
npm install --save @opentelemetry/auto-instrumentations-node
Set Environment Variables​
Configure your application's environment with the following variables:
env: {
OTEL_SERVICE_NAME: "", // Set your service name here
OTEL_RESOURCE_ATTRIBUTES: "kubesense.env_type=legacy,kubesense.cluster=xxx",
OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://kubesense.ai:33443/v1/traces",
OTEL_NODE_RESOURCE_DETECTORS: "env,host,os,process",
NODE_OPTIONS: "--require @opentelemetry/auto-instrumentations-node/register",
}
These settings enable automatic instrumentation and export traces to the configured Kubesense OTLP endpoint.
Additional Information​
- Required Permissions: The container runs in privileged mode to enable kernel-level operations like eBPF.
For more details, visit KubeSense Documentation.