Skip to content

Commit 87af1ec

Browse files
committed
Create local files for workshop
1 parent b0d6726 commit 87af1ec

File tree

10 files changed

+133
-60
lines changed

10 files changed

+133
-60
lines changed

content/en/tko/session-5/docs/deploy-apache.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ More information can be found here : [DNS for Service and Pods](https://kubernet
3232

3333
## 2. Create OpenTelemetry Collector receiver for PHP/Apache
3434

35-
Create a new file called `otel-apache.yaml` with the following contents:
35+
Inspect the YAML file `~/workshop/k3s/otel-apache.yaml` and validate the contents. This file contains the configuration for the OpenTelemetry agent to monitor the PHP/Apache deployment.
3636

3737
{{< tabpane >}}
38-
{{< tab header="otel-apache.yaml" lang="yaml" >}}
38+
{{< tab header="~/workshop/k3s/otel-apache.yaml" lang="yaml" >}}
3939
agent:
4040
config:
4141
receivers:
@@ -70,10 +70,11 @@ helm upgrade splunk-otel-collector \
7070
--set="splunkObservability.infrastructureMonitoringEventsEnabled=true" \
7171
splunk-otel-collector-chart/splunk-otel-collector \
7272
--namespace splunk \
73-
-f otel-apache.yaml
73+
-f ~/workshop/k3s/splunk-defaults.yaml \
74+
-f ~/workshop/k3s/otel-apache.yaml
7475
{{< /tab >}}
7576
{{< tab header="Helm Upgrade Single Line" lang="bash" >}}
76-
helm upgrade splunk-otel-collector --set="splunkObservability.realm=$REALM" --set="splunkObservability.accessToken=$ACCESS_TOKEN" --set="clusterName=$(hostname)-k3s-cluster" --set="splunkObservability.logsEnabled=true" --set="clusterReceiver.eventsEnabled=true" --set="splunkObservability.infrastructureMonitoringEventsEnabled=true" splunk-otel-collector-chart/splunk-otel-collector --namespace splunk -f otel-apache.yaml
77+
helm upgrade splunk-otel-collector --set="splunkObservability.realm=$REALM" --set="splunkObservability.accessToken=$ACCESS_TOKEN" --set="clusterName=$(hostname)-k3s-cluster" --set="splunkObservability.logsEnabled=true" --set="clusterReceiver.eventsEnabled=true" --set="splunkObservability.infrastructureMonitoringEventsEnabled=true" splunk-otel-collector-chart/splunk-otel-collector --namespace splunk -f ~/workshop/k3s/splunk-defaults.yaml -f ~/workshop/k3s/otel-apache.yaml
7778
{{< /tab >}}
7879
{{< /tabpane >}}
7980

@@ -109,10 +110,12 @@ Is the content of `otel-apache.yaml` saved in the ConfigMap for the collector ag
109110

110111
## 5. Create PHP/Apache Deployment YAML
111112

112-
In the terminal window create a new file called `php-apache.yaml` and copy the following YAML into the file. This will create a new StatefulSet with a single replica of the PHP/Apache image.
113+
Inspect the YAML file `~/workshop/k3s/php-apache.yaml` and validate the contents. This file contains the configuration for the PHP/Apache deployment and will create a new StatefulSet with a single replica of the PHP/Apache image.
114+
115+
A stateless application is one that does not care which network it is using, and it does not need permanent storage. Examples of stateless apps may include web servers (Apache, Nginx, or Tomcat).
113116

114117
{{< tabpane >}}
115-
{{< tab header="php-apache.yaml" lang="yaml" >}}
118+
{{< tab header="~/workshop/k3s/php-apache.yaml" lang="yaml" >}}
116119
apiVersion: apps/v1
117120
kind: StatefulSet
118121
metadata:
@@ -171,7 +174,7 @@ kubectl create namespace apache
171174
Deploy the PHP/Apache application:
172175

173176
``` bash
174-
kubectl apply -f php-apache.yaml -n apache
177+
kubectl apply -f ~/workshop/k3s/php-apache.yaml -n apache
175178
```
176179

177180
Ensure the deployment has been created:
@@ -184,7 +187,7 @@ kubectl get statefulset -n apache
184187
What metrics for your Apache instance are being reported in the Apache Dashboard?
185188
{{% /alert %}}
186189

187-
{{% alert title="Workshop Question" color="question" %}}
190+
{{% alert title="Workshop Question" color="success" %}}
188191
Using the Observability Kubernetes Navigator, can you find the status of the `php-apache-0` pod in **Workload Detail**?
189192

190193
**HINT:** Filter by cluster to isolate your instance!
@@ -193,6 +196,5 @@ Using the Observability Kubernetes Navigator, can you find the status of the `ph
193196
{{% alert title="Workshop Question" color="success" %}}
194197
Where else has the issue with `php-apache` been logged? What is being reported?
195198

196-
**HINT:** Using `event.name = php-apache-*` as **one** of your filters to isolate your instance!
199+
**HINT:** Using `event.name = php-apache*` as **one** of your filters to isolate your instance!
197200
{{% /alert %}}
198-

content/en/tko/session-5/docs/deploy-loadgen.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ Now to see how the autoscaler reacts to increased load. To do this, you'll start
88

99
## 1. Create loadgen YAML
1010

11-
In the terminal window create a new file called `loadgen.yaml` and copy the following YAML into the file:
11+
Inspect the YAML file `~/workshop/k3s/loadgen.yaml` and validate the contents. This file contains the configuration for the load generator and will create a new StatefulSet with a single replica of the load generator image.
1212

1313
{{< tabpane >}}
14-
{{< tab header="loadgen.yaml" lang="yaml" >}}
14+
{{< tab header="~/workshop/k3s/loadgen.yaml" lang="yaml" >}}
1515
apiVersion: apps/v1
1616
kind: StatefulSet
1717
metadata:
@@ -49,7 +49,7 @@ kubectl create namespace loadgen
4949
## 3. Deploy the load generator
5050

5151
``` text
52-
kubectl apply -f loadgen.yaml --namespace loadgen
52+
kubectl apply -f ~/workshop/k3s/loadgen.yaml --namespace loadgen
5353
```
5454

5555
Once you have deployed the load generator, you can see the Pod running in the `loadgen` namespace. Use previous similar commands to check the status of the Pod from the command line.

content/en/tko/session-5/docs/deploy-otel.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ helm install splunk-otel-collector \
5757
splunk-otel-collector-chart/splunk-otel-collector \
5858
--namespace splunk \
5959
--create-namespace \
60-
-f ~/splunk-defaults.yaml
60+
-f ~/workshop/k3s/splunk-defaults.yaml
6161

6262
{{< /tab >}}
63-
{{< tab header="Helm Install Single Line" lang="bash" >}}
64-
helm install splunk-otel-collector --set="splunkObservability.realm=$REALM" --set="splunkObservability.accessToken=$ACCESS_TOKEN" --set="clusterName=$(hostname)-k3s-cluster" --set="splunkObservability.logsEnabled=true" --set="clusterReceiver.eventsEnabled=true" --set="splunkObservability.infrastructureMonitoringEventsEnabled=true" splunk-otel-collector-chart/splunk-otel-collector --namespace splunk --create-namespace
63+
{{< tab header="Helm Install Single Line" lang="text" >}}
64+
helm install splunk-otel-collector --set="splunkObservability.realm=$REALM" --set="splunkObservability.accessToken=$ACCESS_TOKEN" --set="clusterName=$(hostname)-k3s-cluster" --set="splunkObservability.logsEnabled=true" --set="splunkObservability.infrastructureMonitoringEventsEnabled=true" splunk-otel-collector-chart/splunk-otel-collector --namespace splunk --create-namespace -f ~/workshop/k3s/splunk-defaults.yaml
6565
{{< /tab >}}
6666
{{< /tabpane >}}
6767

content/en/tko/session-5/docs/edit-hpa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ How many pods are now in a running state? How many are pending? Why are they pen
1919
## 2. Stop the load test
2020

2121
``` bash
22-
kubectl delete -f loadgen.yaml --namespace loadgen
22+
kubectl delete -f ~/workshop/k3s/loadgen.yaml --namespace loadgen
2323
```
2424

2525
{{% alert title="Workshop Question" color="success" %}}

content/en/tko/session-5/docs/fix-apache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ kubectl delete statefulset php-apache -n apache
6060
```
6161

6262
``` bash
63-
kubectl apply -f php-apache.yaml -n apache
63+
kubectl apply -f ~/workshop/k3s/php-apache.yaml -n apache
6464
```
6565

6666
## 3. Validate the changes

workshop/aws/ec2/templates/userdata.yaml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -87,48 +87,6 @@ write_files:
8787
alias dc='docker-compose'
8888
alias docker='podman'
8989

90-
- path: /etc/skel/splunk-defaults.yaml
91-
permissions: '0744'
92-
content: |
93-
clusterReceiver:
94-
k8sObjects:
95-
- name: events
96-
mode: watch
97-
namespaces: [default, apache, loadgen]
98-
- name: pods
99-
mode: watch
100-
namespaces: [default, apache, loadgen]
101-
config:
102-
receivers:
103-
smartagent/kubernetes-events:
104-
type: kubernetes-events
105-
alwaysClusterReporter: true
106-
whitelistedEvents:
107-
- reason: Created
108-
involvedObjectKind: Pod
109-
- reason: Unhealthy
110-
involvedObjectKind: Pod
111-
- reason: Failed
112-
involvedObjectKind: Pod
113-
- reason: FailedCreate
114-
involvedObjectKind: Job
115-
- reason: Scheduling
116-
involvedObjectKind: Pod
117-
- reason: FailedScheduling
118-
involvedObjectKind: Pod
119-
- reason: ScalingReplicaSet
120-
involvedObjectKind: Deployment
121-
- reason: SuccessfulCreate
122-
involvedObjectKind: ReplicaSet
123-
- reason: MinimumReplicasUnavailable
124-
involvedObjectKind: Pod
125-
- reason: Pulling
126-
involvedObjectKind: Pod
127-
- reason: Pulled
128-
involvedObjectKind: Pod
129-
- reason: FailedScheduling
130-
involvedObjectKind: Scheduler
131-
13290
- path: /etc/rancher/k3s/registries.yaml
13391
permissions: '0600'
13492
owner: root:root

workshop/k3s/loadgen.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: loadgen
5+
labels:
6+
app: loadgen
7+
spec:
8+
replicas: 1
9+
selector:
10+
matchLabels:
11+
app: loadgen
12+
template:
13+
metadata:
14+
name: loadgen
15+
labels:
16+
app: loadgen
17+
spec:
18+
containers:
19+
- name: infinite-calls
20+
image: busybox
21+
command:
22+
- /bin/sh
23+
- -c
24+
- "while true; do wget -q -O- http://php-apache-svc.apache.svc.cluster.local; done"

workshop/k3s/otel-apache.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
agent:
2+
config:
3+
receivers:
4+
receiver_creator:
5+
receivers:
6+
smartagent/apache:
7+
rule: type == "port" && pod.name matches "apache" && port == 80
8+
config:
9+
type: collectd/apache
10+
url: http://php-apache-svc.apache.svc.cluster.local/server-status?auto

workshop/k3s/php-apache.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: php-apache
5+
spec:
6+
updateStrategy:
7+
type: RollingUpdate
8+
selector:
9+
matchLabels:
10+
run: php-apache
11+
replicas: 1
12+
template:
13+
metadata:
14+
labels:
15+
run: php-apache
16+
spec:
17+
containers:
18+
- name: php-apache
19+
image: ghcr.io/splunk/php-apache:latest
20+
ports:
21+
- containerPort: 80
22+
resources:
23+
limits:
24+
cpu: "8"
25+
memory: "9Mi"
26+
requests:
27+
cpu: "6"
28+
memory: "4Mi"
29+
30+
---
31+
apiVersion: v1
32+
kind: Service
33+
metadata:
34+
name: php-apache-svc
35+
labels:
36+
run: php-apache
37+
spec:
38+
ports:
39+
- port: 80
40+
selector:
41+
run: php-apache

workshop/k3s/server-defaults.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
clusterReceiver:
2+
k8sObjects:
3+
- name: events
4+
mode: watch
5+
namespaces: [default, apache, loadgen, splunk]
6+
- name: pods
7+
mode: watch
8+
namespaces: [default, apache, loadgen, splunk]
9+
config:
10+
receivers:
11+
smartagent/kubernetes-events:
12+
type: kubernetes-events
13+
alwaysClusterReporter: true
14+
whitelistedEvents:
15+
- reason: Created
16+
involvedObjectKind: Pod
17+
- reason: Unhealthy
18+
involvedObjectKind: Pod
19+
- reason: Failed
20+
involvedObjectKind: Pod
21+
- reason: FailedCreate
22+
involvedObjectKind: Job
23+
- reason: Scheduling
24+
involvedObjectKind: Pod
25+
- reason: FailedScheduling
26+
involvedObjectKind: Pod
27+
- reason: ScalingReplicaSet
28+
involvedObjectKind: Deployment
29+
- reason: SuccessfulCreate
30+
involvedObjectKind: ReplicaSet
31+
- reason: MinimumReplicasUnavailable
32+
involvedObjectKind: Pod
33+
- reason: Pulling
34+
involvedObjectKind: Pod
35+
- reason: Pulled
36+
involvedObjectKind: Pod
37+
- reason: FailedScheduling
38+
involvedObjectKind: Scheduler

0 commit comments

Comments
 (0)