Kubesense

VM deployments

Single-Step Sensor Installation Guide

This guide covers the steps to install and configure sensors for a VM machine 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
AGGREGATOR_HOST: <KUBESENSE_AGGREGATOR_LB>
AGGREGATOR_PORT: "30054"
METRICS_STORE_HOST: <KUBESENSE_METRICS_SCRAPPER_LB>
METRICS_STORE_PORT: "30060"
SENSOR_INSTALLATION_TYPE: legacy
HOST_NAME: <HOST_NAME> # Optional
LOG_ENABLED: true
METRICS_ENABLED: true
CLUSTER_NAME: <CLUSTER_NAME>
LOG_PATHS:
  - service: <SERVICE_NAME>
    path: <PATH_TO_LOG_FILE>
    type: file
ATTRIBUTES: # Optional
  region: us-east-1

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 (Example - 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=<CLUSTER_NAME>",
    OTEL_EXPORTER_OTLP_TRACES_ENDPOINT: "http://<KUBESENSE_KUBECOL_LB>:33443/v1/traces",
    OTEL_NODE_RESOURCE_DETECTORS: "env,host,os,process",
    NODE_OPTIONS: "--require @opentelemetry/auto-instrumentations-node/register",
}

For more details, visit KubeSense Documentation.