You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/en/tko/session-5/docs/deploy-apache.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ The Domain Name System (DNS) is a mechanism for linking various sorts of informa
10
10
11
11
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.
12
12
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:
14
14
15
15
```text
16
16
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
32
32
33
33
## 2. Review OTel receiver for PHP/Apache
34
34
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.
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.
56
62
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.
58
64
59
65
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.
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.
83
89
84
90
```text
85
91
Release "splunk-otel-collector" has been upgraded. Happy Helming!
@@ -95,9 +101,9 @@ TEST SUITE: None
95
101
96
102
## 4. Kubernetes ConfigMaps
97
103
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.
99
105
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.
101
107
102
108
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:
103
109
@@ -123,9 +129,15 @@ Is the content of `otel-apache.yaml` saved in the ConfigMap for the collector ag
123
129
124
130
## 5. Review PHP/Apache deployment YAML
125
131
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.
127
139
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.
Copy file name to clipboardExpand all lines: content/en/tko/session-5/docs/fix-apache.md
+14-4Lines changed: 14 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ weight: 4
5
5
---
6
6
## 1. Kubernetes Resources
7
7
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.
9
9
10
10
You do this by placing a Resource section in the deployment of you application/Pod
11
11
@@ -37,7 +37,11 @@ Before we start, let's check the current status of the PHP/Apache deployment. Un
37
37
38
38
{{% /alert %}}
39
39
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
+
```
41
45
42
46
Find the resources section and reduce the CPU limits to **1** and the CPU requests to **0.5**:
43
47
@@ -51,12 +55,15 @@ resources:
51
55
memory: "4Mi"
52
56
```
53
57
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.
0 commit comments