Skip to content

Enabling OTEL Collector as a DaemonSet

Introduction

The OpenTelemetry (OTEL) Collector, deployed as a Kubernetes DaemonSet, runs on every node in the cluster to collect and forward logs to Loki and other observability backends.

By default, the OTEL Collector runs in Deployment mode. To run the OTEL Collector as a DaemonSet, follow the steps below.

Process

Step 1: Access Privacera Manager Instance

SSH into the instance where Privacera Manager is installed.

Step 2: Navigate to Configuration Directory

Navigate to the config directory using the following command:

Bash
cd ~/privacera/privacera-manager/config/

Step 3: Copy Configuration File

Copy the vars.monitoring.yml file from the sample-vars folder to the custom-vars folder:

Note

If the file already exists in custom-vars, you can skip this step.

Bash
cp sample-vars/vars.monitoring.yml custom-vars/

Step 4: Edit Configuration File

Open the vars.monitoring.yml file for editing:

Bash
vi custom-vars/vars.monitoring.yml

Step 5: Deploy the OTEL Collector as a DaemonSet.

Uncomment the following variable in the file and save it:

YAML
OTEL_COLLECTOR_DEPLOYMENT_MODE: "daemonset"

Step 6: Redeploy Monitoring Components

Once the configuration is complete, redeploy the monitoring components.

a. Go to privacera-manager directory.

Bash
cd ~/privacera/privacera-manager
b. Run setup to generate the required files.
Bash
./privacera-manager.sh setup
c. Install the monitoring components.
Bash
./pm_with_helm.sh install-monitoring
d. Run install to update the Grafana.
Bash
./pm_with_helm.sh install
e. Once done, run post-install.
Bash
./privacera-manager.sh post-install

Verification

To verify that the OTEL Collector is deployed and running as a DaemonSet:

Bash
kubectl get daemonset -n privacera-monitoring
kubectl get pods -n privacera-monitoring

Look for pods with names containing otel-receiver-agent and verify that their status is Running.