Install the OpenTelemetry Collector in K8s
15 minutesRecap of Part 1 of the Workshop
At this point in the workshop, we’ve successfully:
- Deployed the Splunk distribution of the OpenTelemetry Collector on our Linux Host
- Configured it to send traces and metrics to Splunk Observability Cloud
- Deployed a .NET application and instrumented it with OpenTelemetry
- Dockerized the .NET application and ensured traces are flowing to o11y cloud
If you haven’t completed the steps listed above, please execute the following commands before proceeding with the remainder of the workshop:
IMPORTANT once these files are copied, open
/home/splunk/workshop/docker-k8s-otel/helloworld/Dockerfile
with an editor and replace$INSTANCEin your Dockerfile with your instance name, which can be determined by runningecho $INSTANCE.
Introduction to Part 2 of the Workshop
In the next part of the workshop, we want to run the application in Kubernetes, so we’ll need to deploy the Splunk distribution of the OpenTelemetry Collector in our Kubernetes cluster.
Let’s define some key terms first.
Key Terms
What is Kubernetes?
“Kubernetes is a portable, extensible, open source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation.”
Source: https://kubernetes.io/docs/concepts/overview/
We’ll deploy the Docker image we built earlier for our application into our Kubernetes cluster, after making a small modification to the Dockerfile.
What is Helm?
Helm is a package manager for Kubernetes.
“It helps you define, install, and upgrade even the most complex Kubernetes application.”
Source: https://helm.sh/
We’ll use Helm to deploy the OpenTelemetry collector in our K8s cluster.
Benefits of Helm
- Manage Complexity
- deal with a single values.yaml file rather than dozens of manifest files
- Easy Updates
- in-place upgrades
- Rollback support
- Just use helm rollback to roll back to an older version of a release
Uninstall the Host Collector
Before moving forward, let’s remove the collector we installed earlier on the Linux host:
Install the Collector using Helm
Let’s use the command line rather than the in-product wizard to create our own
helm command to install the collector.
We first need to add the helm repo:
And ensure the repo is up-to-date:
To configure the helm chart deployment, let’s create a new file named values.yaml in
the /home/splunk directory:
Press ‘i’ to enter into insert mode in vi before pasting the text below.
Then paste the following contents:
To save your changes in vi, press the
esckey to enter command mode, then type:wq!followed by pressing theenter/returnkey.
Now we can use the following command to install the collector:
Confirm the Collector is Running
We can confirm whether the collector is running with the following command:
Confirm your K8s Cluster is in O11y Cloud
In Splunk Observability Cloud, navigate to Infrastructure -> Kubernetes -> Kubernetes Clusters,
and then search for your cluster name (which is $INSTANCE-cluster):
