62
62
- " stress"
63
63
- " --cpus"
64
64
- " 1"
65
+ resources :
66
+ limits :
67
+ cpu : " 500m"
68
+ requests :
69
+ cpu : " 500m"
65
70
` ` `
66
71
67
72
Apply it to your cluster: ` kubectl apply -f cpu-pressure-pod.yaml`
@@ -85,7 +90,7 @@ Query the `/metrics/cadvisor` endpoint to see the `container_pressure_cpu_waitin
85
90
` ` ` shell
86
91
# Replace <node-name> with the name of the node where the pod is running
87
92
kubectl get --raw "/api/v1/nodes/<node-name>/proxy/metrics/cadvisor" | \
88
- grep 'container_pressure_cpu_waiting_seconds_total{container="cpu-stress",pod="cpu-pressure-pod"} '
93
+ grep 'container_pressure_cpu_waiting_seconds_total{container="cpu-stress"'
89
94
` ` `
90
95
The output should show an increasing value, indicating that the container is spending time stalled waiting for CPU resources.
91
96
@@ -139,7 +144,7 @@ Query the `/metrics/cadvisor` endpoint to see the `container_pressure_memory_wai
139
144
` ` ` shell
140
145
# Replace <node-name> with the name of the node where the pod is running
141
146
kubectl get --raw "/api/v1/nodes/<node-name>/proxy/metrics/cadvisor" | \
142
- grep 'container_pressure_memory_waiting_seconds_total{container="memory-stress",pod="memory-pressure-pod"} '
147
+ grep 'container_pressure_memory_waiting_seconds_total{container="memory-stress"'
143
148
` ` `
144
149
In the output, you will observe an increasing value for the metric, indicating that the system is under significant memory pressure.
145
150
@@ -188,7 +193,7 @@ Query the `/metrics/cadvisor` endpoint to see the `container_pressure_io_waiting
188
193
` ` ` shell
189
194
# Replace <node-name> with the name of the node where the pod is running
190
195
kubectl get --raw "/api/v1/nodes/<node-name>/proxy/metrics/cadvisor" | \
191
- grep 'container_pressure_io_waiting_seconds_total{container="io-stress",pod="io-pressure-pod"} '
196
+ grep 'container_pressure_io_waiting_seconds_total{container="io-stress"'
192
197
` ` `
193
198
You will see the metric's value increase as the Pod continuously writes to disk.
194
199
0 commit comments