Install the Collector for Kubernetes using Helm

Deploy the Splunk Distribution of OpenTelemetry Collector onto your Kubernetes cluster.

You can deploy the Splunk Distribution of the OpenTelemetry Collector on your Kubernetes cluster using the collector's Helm chart. This Helm chart can:

  • Create a Kubernetes DaemonSet along with other Kubernetes objects in a Kubernetes cluster.

  • Receive, process, and export metric, trace, and log data for Splunk Enterprise, Splunk Cloud Platform, and Splunk Observability Cloud.

To learn more about the Splunk Distribution of the OpenTelemetry Collector Helm chart, see:

Supported Kubernetes distributions

The Helm chart works with default configurations of the main Kubernetes distributions. Use actively supported versions:

While the chart should work for other Kubernetes distributions, you might need to modify the default settings in its values.yaml configuration file.

Supported Helm versions

The Helm chart works with Helm versions that are still supported or that were released in the last year. Older Helm 3 versions, and all Helm 2 versions, are not supported. For more information on the version skew supported between Helm and Kubernetes, see Helm Version Support Policy.

Required privileges

You must have administrator access to your Kubernetes cluster.

Collector destination

The Splunk Distribution of the OpenTelemetry Collector requires a destination of either Splunk Enterprise or Splunk Cloud Platform (splunkPlatform) or Splunk Observability Cloud (splunkObservability).

Depending on your destination, you need:

  • To send data to splunkPlatform:

    • Splunk Enterprise 8.0 or higher.

    • A minimum of one Splunk platform index ready to collect the log data. This index is used for ingesting logs.

    • An HTTP Event Collector (HEC) token and endpoint. See Set up and use HTTP Event Collector in Splunk Web and Scale HTTP Event Collector .

    • splunkPlatform.endpoint. URL to a Splunk instance, for example http://localhost:8088/services/collector.

    • splunkPlatform.token. Splunk HTTP Event Collector token.

  • To send data to splunkObservability:

Note: The Collector for Kubernetes uses main as the default Splunk platform index. You can use annotations to send data to different indexes. See Send logs to different indexes for more information.

Deploy the Helm chart

Run the following commands to deploy the Helm chart:

  1. Add the Helm repository:

    BASH
    helm repo add splunk-otel-collector-chart https://.github.io/splunk-otel-collector-chart
  2. Ensure the repository is up to date:
    CODE
    helm repo update
  3. Determine your destination.

    For Splunk Observability Cloud:

    BASH
    helm install my-splunk-otel-collector --set="splunkObservability.realm=us0,splunkObservability.accessToken=xxxxxx,clusterName=my-cluster" splunk-otel-collector-chart/splunk-otel-collector

    For Splunk Enterprise or Splunk Cloud Platform:

    BASH
    helm install my-splunk-otel-collector --set="splunkPlatform.endpoint=https://127.0.0.1:8088/services/collector,splunkPlatform.token=xxxxxx,splunkPlatform.metricsIndex=k8s-metrics,splunkPlatform.index=main,clusterName=my-cluster" splunk-otel-collector-chart/splunk-otel-collector

    For both Splunk Observability Cloud and Splunk Enterprise or Splunk Cloud Platform:

    BASH
    helm install my-splunk-otel-collector --set="splunkPlatform.endpoint=https://127.0.0.1:8088/services/collector,splunkPlatform.token=xxxxxx,splunkPlatform.metricsIndex=k8s-metrics,splunkPlatform.index=main,splunkObservability.realm=us0,splunkObservability.accessToken=xxxxxx,clusterName=my-cluster" splunk-otel-collector-chart/splunk-otel-collector
  4. Specify a namespace to deploy the chart to with the -n argument:

    BASH
    helm -n otel install my-splunk-otel-collector -f values.yaml splunk-otel-collector-chart/splunk-otel-collector
CAUTION: The values.yaml file lists all supported configurable parameters for the Helm chart, along with a detailed explanation of each parameter. Review it to understand how to configure this chart. You can also configure the Helm chart to support different use cases, such as trace sampling and sending data through a proxy server. See Examples of chart configuration for more information.

Configure other parameters

You can configure the following:

For example:

BASH
helm repo add splunk-otel-collector-chart https://.github.io/splunk-otel-collector-chart
helm install my-splunk-otel-collector --set="splunkRealm=us0,splunkAccessToken=xxxxxx,clusterName=my-cluster" --set=distribution={value},cloudProvider={value} splunk-otel-collector-chart/splunk-otel-collector

Set Helm values using a YAML file

You can specify Helm values in a YAML file instead of on the command line. For example, you can create my_values.yaml, put command line options in it, and then run the following command to deploy the Helm chart:

BASH
helm install my-splunk-otel-collector --values my_values.yaml splunk-otel-collector-chart/splunk-otel-collector

See an example of a YAML file in GitHub.

Set Prometheus metrics

Set the Collector to automatically scrape any pod emitting Prometheus metrics by adding this property to the Helm chart’s values YAML:

BASH
autodetect:
   prometheus: true

Add this configuration in the resources file for any pods in the deployment:

BASH
metadata:
   annotations:
      prometheus.io/scrape: "true"
      prometheus.io/path: /metrics
      prometheus.io/port: "8080"

Verify the deployment

If the Helm chart deployed successfully, it displays a message indicating that the Splunk Distribution of the OpenTelemetry Collector for Kubernetes is being deployed onto your Kubernetes cluster along with the last deployment date and the status.

Use the Kubernetes Operator in OpenTelemetry

Using the same Helm chart, you can also deploy an upstream OpenTelemetry Kubernetes Operator for zero-code instrumentation. For more information, see Automatic discovery for Kubernetes.

This instance of the Kubernetes Operator is part of the upstream OpenTelemetry Operator project. See the OpenTelemetry Operator documentation in GitHub for more information.

Note: The upstream Kubernetes Operator is not related to the Splunk Operator for Kubernetes, which is used to deploy and operate Splunk Enterprise deployments in a Kubernetes infrastructure.

Next steps

After deploying the Helm chart you can: