Skip to content

Commit 68ba7e6

Browse files
committed
further updates to the hands-on workshop
1 parent 5d13a00 commit 68ba7e6

File tree

7 files changed

+118
-16
lines changed

7 files changed

+118
-16
lines changed

content/en/ninja-workshops/8-docker-k8s-otel/11-summary.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ This workshop provided hands-on experience with the following concepts:
1616
To see how other languages and environments are instrumented with OpenTelemetry,
1717
explore the [Splunk OpenTelemetry Examples GitHub repository](https://github.com/signalfx/splunk-opentelemetry-examples).
1818

19+
To run this workshop on your own in the future, refer back to these instructions and use the **Splunk4Rookies - Observability**
20+
workshop template in Splunk Show to provision an EC2 instance.

content/en/ninja-workshops/8-docker-k8s-otel/5-dockerize-app.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,37 @@ But how do we do that?
1212
The first step is to create a Docker image for our application. This is known as
1313
"dockerizing" and application, and the process begins with the creation of a `Dockerfile`.
1414

15+
But first, let's define some key terms.
16+
17+
## Key Terms
18+
19+
### What is Docker?
20+
21+
_"Docker provides the ability to package and run an application in a loosely isolated environment
22+
called a container. The isolation and security lets you run many containers simultaneously on
23+
a given host. Containers are lightweight and contain everything needed to run the application,
24+
so you don't need to rely on what's installed on the host."_
25+
26+
Source: https://docs.docker.com/get-started/docker-overview/
27+
28+
### What is a container?
29+
30+
_"Containers are isolated processes for each of your app's components. Each component
31+
...runs in its own isolated environment,
32+
completely isolated from everything else on your machine."_
33+
34+
Source: https://docs.docker.com/get-started/docker-concepts/the-basics/what-is-a-container/
35+
36+
### What is a container image?
37+
38+
_"A container image is a standardized package that includes all of the files, binaries,
39+
libraries, and configurations to run a container."_
40+
41+
### Dockerfile
42+
43+
_"A Dockerfile is a text-based document that's used to create a container image. It provides
44+
instructions to the image builder on the commands to run, files to copy, startup command, and more."_
45+
1546
## Create a Dockerfile
1647

1748
Let's create a file named `Dockerfile` in the `/home/splunk/workshop/docker-k8s-otel/helloworld` directory.

content/en/ninja-workshops/8-docker-k8s-otel/7-install-collector-k8s.md

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,45 +5,70 @@ weight: 7
55
time: 15 minutes
66
---
77

8+
## Recap of Part 1 of the Workshop
9+
810
At this point in the workshop, we've successfully:
911

1012
* Deployed the Splunk distribution of the OpenTelemetry Collector on our Linux Host
1113
* Configured it to send traces and metrics to Splunk Observability Cloud
1214
* Deployed a .NET application and instrumented it with OpenTelemetry
1315
* Dockerized the .NET application and ensured traces are flowing to o11y cloud
1416

15-
In the next part of the workshop, we want to run the application in Kubernetes instead.
17+
If you **haven't** completed the steps listed above, please execute the following commands before proceeding with
18+
the remainder of the workshop:
1619

17-
To do this, we first want to deploy the Splunk distribution of the OpenTelemetry Collector
18-
to our Kubernetes cluster.
20+
``` bash
21+
cp /home/splunk/workshop/docker-k8s-otel/docker/Dockerfile /home/splunk/workshop/docker-k8s-otel/helloworld/
22+
cp /home/splunk/workshop/docker-k8s-otel/docker/entrypoint.sh /home/splunk/workshop/docker-k8s-otel/helloworld/
23+
````
1924

20-
## Uninstall the Host Collector
25+
## Introduction to Part 2 of the Workshop
2126

22-
Before moving forward, let’s remove the collector we installed earlier on the Linux host:
27+
In the next part of the workshop, we want to run the application in Kubernetes,
28+
so we'll need to deploy the Splunk distribution of the OpenTelemetry Collector
29+
in our Kubernetes cluster.
2330
24-
``` bash
25-
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh;
26-
sudo sh /tmp/splunk-otel-collector.sh --uninstall
27-
```
31+
Let's define some key terms first.
32+
33+
### Key Terms
34+
35+
#### What is Kubernetes?
36+
37+
_"Kubernetes is a portable, extensible, open source platform for managing containerized
38+
workloads and services, that facilitates both declarative configuration and automation."_
2839

29-
## What is Helm?
40+
Source: https://kubernetes.io/docs/concepts/overview/
3041

31-
We'll use Helm to deploy the OpenTelemetry collector in our K8s cluster. But what is Helm?
42+
We'll deploy the Docker image we built earlier for our application into our Kubernetes cluster, after making
43+
a small modification to the Dockerfile.
44+
45+
#### What is Helm?
3246
3347
Helm is a package manager for Kubernetes.
3448
35-
“It helps you define, install, and upgrade even the most complex Kubernetes application.”
49+
_“It helps you define, install, and upgrade even the most complex Kubernetes application.”_
50+
51+
Source: https://helm.sh/
3652
37-
Source: https://helm.sh/
53+
We'll use Helm to deploy the OpenTelemetry collector in our K8s cluster.
3854

39-
## Benefits of Helm
55+
#### Benefits of Helm
4056

4157
* Manage Complexity
4258
* deal with a single values.yaml file rather than dozens of manifest files
4359
* Easy Updates
4460
* in-place upgrades
4561
* Rollback support
46-
* Just use helm rollback to roll back to an older version of a release
62+
* Just use helm rollback to roll back to an older version of a release
63+
64+
## Uninstall the Host Collector
65+
66+
Before moving forward, let’s remove the collector we installed earlier on the Linux host:
67+
68+
``` bash
69+
curl -sSL https://dl.signalfx.com/splunk-otel-collector.sh > /tmp/splunk-otel-collector.sh;
70+
sudo sh /tmp/splunk-otel-collector.sh --uninstall
71+
```
4772

4873
## Install the Collector using Helm
4974

content/en/ninja-workshops/8-docker-k8s-otel/9-customize-collector-config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Suppose we want to see the traces and logs that are sent to the collector, so we
190190
inspect them before sending them to Splunk. We can use the debug exporter for this purpose, which
191191
can be helpful for troubleshooting OpenTelemetry-related issues.
192192

193-
Let's add the debug exporter to the values.yaml file as follows:
193+
Let's add the debug exporter to the bottom of the values.yaml file as follows:
194194

195195
``` yaml
196196
logsEngine: otel

content/en/ninja-workshops/8-docker-k8s-otel/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ time: 2 minutes
77
authors: ["Derek Mitchell"]
88
description: By the end of this workshop you'll have gotten hands-on experience instrumenting a .NET application with OpenTelemetry, then Dockerizing the application and deploying it to Kubernetes. You’ll also gain experience deploying the OpenTelemetry collector using Helm, customizing the collector configuration, and troubleshooting collector configuration issues.
99
draft: false
10+
hidden: true
1011
---
1112

1213
In this workshop, you'll get hands-on experience with the following:

content/en/ninja-workshops/9-solving-problems-with-o11y-cloud/_index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ time: 2 minutes
77
authors: ["Derek Mitchell"]
88
description: By the end of this workshop you'll have gotten hands-on experience deploying the OpenTelemetry Collector, instrumenting an application with OpenTelemetry, capturing tags from the application, and using Troubleshooting MetricSets and Tag Spotlight to determine the root cause of an issue.
99
draft: false
10+
hidden: true
1011
---
1112

1213
In this workshop, you'll get hands-on experience with the following:
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
2+
3+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
4+
USER app
5+
WORKDIR /app
6+
EXPOSE 8080
7+
8+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
9+
ARG BUILD_CONFIGURATION=Release
10+
WORKDIR /src
11+
COPY ["helloworld.csproj", "helloworld/"]
12+
RUN dotnet restore "./helloworld/./helloworld.csproj"
13+
WORKDIR "/src/helloworld"
14+
COPY . .
15+
RUN dotnet build "./helloworld.csproj" -c $BUILD_CONFIGURATION -o /app/build
16+
17+
# Add dependencies for splunk-otel-dotnet-install.sh
18+
RUN apt-get update && \
19+
apt-get install -y unzip
20+
21+
# Download Splunk OTel .NET installer
22+
RUN curl -sSfL https://github.com/signalfx/splunk-otel-dotnet/releases/latest/download/splunk-otel-dotnet-install.sh -O
23+
24+
# Install the distribution
25+
RUN sh ./splunk-otel-dotnet-install.sh
26+
27+
FROM build AS publish
28+
ARG BUILD_CONFIGURATION=Release
29+
RUN dotnet publish "./helloworld.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false
30+
31+
FROM base AS final
32+
33+
# Copy instrumentation file tree
34+
WORKDIR "//home/app/.splunk-otel-dotnet"
35+
COPY --from=build /root/.splunk-otel-dotnet/ .
36+
37+
WORKDIR /app
38+
COPY --from=publish /app/publish .
39+
COPY entrypoint.sh .
40+
41+
ENTRYPOINT ["sh", "entrypoint.sh"]
42+
CMD ["dotnet", "helloworld.dll"]

0 commit comments

Comments
 (0)