Skip to content

Commit d63c107

Browse files
authored
Merge pull request #149 from jelkhouri-splunk/main
Small changes
2 parents 62df21f + 6aec028 commit d63c107

File tree

2 files changed

+35
-13
lines changed

2 files changed

+35
-13
lines changed

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

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The Domain Name System (DNS) is a mechanism for linking various sorts of informa
1010

1111
Most Kubernetes clusters include an internal DNS service configured by default to offer a lightweight approach for service discovery. Even when Pods and Services are created, deleted, or shifted between nodes, built-in service discovery simplifies applications to identify and communicate with services on the Kubernetes clusters.
1212

13-
In short the DNS system for Kubernetes will create a DNS entry for each Pod and Service. In general a Pod has the following DNS resolution:
13+
In short, the DNS system for Kubernetes will create a DNS entry for each Pod and Service. In general, a Pod has the following DNS resolution:
1414

1515
``` text
1616
pod-name.my-namespace.pod.cluster-domain.example
@@ -32,7 +32,13 @@ More information can be found here : [DNS for Service and Pods](https://kubernet
3232

3333
## 2. Review OTel receiver for PHP/Apache
3434

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.
35+
Inspect the YAML file `~/workshop/k3s/otel-apache.yaml` and validate the contents using the following command:
36+
37+
``` bash
38+
cat ~/workshop/k3s/otel-apache.yaml
39+
```
40+
41+
This file contains the configuration for the OpenTelemetry agent to monitor the PHP/Apache deployment.
3642

3743
{{< tabpane >}}
3844
{{< tab header="~/workshop/k3s/otel-apache.yaml" lang="yaml" >}}
@@ -54,7 +60,7 @@ agent:
5460

5561
The above file contains an observation rule for Apache using the OTel `receiver_creator`. This receiver can instantiate other receivers at runtime based on whether observed endpoints match a configured rule.
5662

57-
The configured rules will be evaluated for each endpoint discovered. If the rule evaluates to true then the receiver for that rule will be started as configured against the matched endpoint.
63+
The configured rules will be evaluated for each endpoint discovered. If the rule evaluates to true, then the receiver for that rule will be started as configured against the matched endpoint.
5864

5965
In the file above we tell the OpenTelemetry agent to look for Pods that match the name `apache` and have port `80` open. Once found, the agent will configure an Apache receiver to read Apache metrics from the configured URL. Note, the K8s DNS based URL in the above YAML for the service.
6066

@@ -79,7 +85,7 @@ helm upgrade splunk-otel-collector --set="splunkObservability.realm=$REALM" --se
7985
{{< /tabpane >}}
8086

8187
{{% alert title="Note" color="info" %}}
82-
The **REVISION** number of the deployment has changed (a way to keep track of your changes).
88+
The **REVISION** number of the deployment has changed, which is a helpful way to keep track of your changes.
8389

8490
``` text
8591
Release "splunk-otel-collector" has been upgraded. Happy Helming!
@@ -95,9 +101,9 @@ TEST SUITE: None
95101

96102
## 4. Kubernetes ConfigMaps
97103

98-
A ConfigMap is an object in Kubernetes consisting of key-value pairs which can be injected into your application. With a ConfigMap you can separate configuration from your Pods.
104+
A ConfigMap is an object in Kubernetes consisting of key-value pairs which can be injected into your application. With a ConfigMap, you can separate configuration from your Pods.
99105

100-
This way, you can prevent hardcoding configuration data. ConfigMaps are useful for storing and sharing non-sensitive, unencrypted configuration information.
106+
Using ConfigMap, you can prevent hardcoding configuration data. ConfigMaps are useful for storing and sharing non-sensitive, unencrypted configuration information.
101107

102108
The OpenTelemetry collector/agent uses ConfigMaps to store the configuration of the agent and the K8s Cluster receiver. You can/will always verify the current configuration of an agent after a change by running the following commands:
103109

@@ -123,9 +129,15 @@ Is the content of `otel-apache.yaml` saved in the ConfigMap for the collector ag
123129

124130
## 5. Review PHP/Apache deployment YAML
125131

126-
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.
132+
Inspect the YAML file `~/workshop/k3s/php-apache.yaml` and validate the contents using the following command:
133+
134+
``` bash
135+
cat ~/workshop/k3s/otel-apache.yaml
136+
```
137+
138+
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.
127139

128-
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).
140+
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 such as Apache, Nginx, or Tomcat.
129141

130142
{{< tabpane >}}
131143
{{< tab header="~/workshop/k3s/php-apache.yaml" lang="yaml" >}}
@@ -176,7 +188,7 @@ spec:
176188

177189
## 6. Deploy PHP/Apache
178190

179-
Save the above file and deploy the PHP/Apache application to the cluster.
191+
Create an apache namespace then deploy the PHP/Apache application to the cluster.
180192

181193
Create the `apache` namespace:
182194

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

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ weight: 4
55
---
66
## 1. Kubernetes Resources
77

8-
Especially in Production Kubernetes Clusters, CPU and Memory are considered precious resources. And the Cluster operators will normally require you to specify in the deployment the amount of CPU and Memory your Pod or Service will require, so they can have the Cluster automatically manage on which Node(s) your solution will be placed.
8+
Especially in Production Kubernetes Clusters, CPU and Memory are considered precious resources. Cluster Operators will normally require you to specify the amount of CPU and Memory your Pod or Service will require in the deployment, so they can have the Cluster automatically manage on which Node(s) your solution will be placed.
99

1010
You do this by placing a Resource section in the deployment of you application/Pod
1111

@@ -37,7 +37,11 @@ Before we start, let's check the current status of the PHP/Apache deployment. Un
3737
3838
{{% /alert %}}
3939
40-
To fix the PHP/Apache StatefulSet, edit `~/workshop/k3s/php-apache.yaml` and reduce the CPU resources further:
40+
To fix the PHP/Apache StatefulSet, edit `~/workshop/k3s/php-apache.yaml` using the following commands to reduce the CPU resources:
41+
42+
``` bash
43+
vim ~/workshop/k3s/php-apache.yaml
44+
```
4145

4246
Find the resources section and reduce the CPU limits to **1** and the CPU requests to **0.5**:
4347

@@ -51,12 +55,15 @@ resources:
5155
memory: "4Mi"
5256
```
5357

54-
Save the above changes. Now, we must delete the existing StatefulSet and re-create it. StatefulSets are immutable, so we must delete the existing one and re-create it with the new changes.
58+
Save the changes youhave made. (Hint: Use `Esc` followed by `:wq!` to save your changes).
59+
60+
Now, we must delete the existing StatefulSet and re-create it. StatefulSets are immutable, so we must delete the existing one and re-create it with the new changes.
5561

5662
``` bash
5763
kubectl delete statefulset php-apache -n apache
58-
```
5964
65+
```
66+
Now, deploy your changes:
6067
``` bash
6168
kubectl apply -f ~/workshop/k3s/php-apache.yaml -n apache
6269
```
@@ -83,6 +90,8 @@ Another Auto-Detect Detector has fired, which one is it this time?
8390

8491
## 4. Fix memory issue
8592

93+
Let's edit the stateful set and increase the memory to what is shown in the image below:
94+
8695
``` bash
8796
kubectl edit statefulset php-apache -n apache
8897
```
@@ -96,6 +105,7 @@ resources:
96105
cpu: "0.5"
97106
memory: "12Mi"
98107
```
108+
Save the changes youhave made. (Hint: Use `Esc` followed by `:wq!` to save your changes).
99109

100110
Because the StatefulSet is immutable, we must delete the existing Pod and let the StatefulSet re-create it with the new changes.
101111

0 commit comments

Comments
 (0)