CPU Hog Scenario
Overview
The CPU Hog scenario is designed to create CPU pressure on one or more nodes in your Kubernetes/OpenShift cluster for a specified duration. This scenario helps you test how your cluster and applications respond to high CPU utilization.
How It Works
The scenario deploys a stress workload pod on targeted nodes. These pods use stress-ng to consume CPU resources according to your configuration. The workload runs for a specified duration and then terminates, allowing you to observe your cluster’s behavior under CPU stress.
When to Use
Use the CPU Hog scenario to:
- Test your cluster’s ability to handle CPU resource contention
- Validate that CPU resource limits and quotas are properly configured
- Evaluate the impact of CPU pressure on application performance
- Test whether your monitoring and alerting systems properly detect CPU saturation
- Verify that the Kubernetes scheduler correctly handles CPU-constrained nodes
- Simulate scenarios where rogue pods consume excessive CPU without limits
Key Configuration Options
In addition to the common hog scenario options, CPU Hog scenarios support:
| Option | Type | Description |
|---|---|---|
cpu-load-percentage | number | The percentage of CPU that will be consumed by the hog |
cpu-method | string | The CPU load strategy adopted by stress-ng (see stress-ng documentation for available options) |
Usage
Select your deployment method to get started:
- CPU Hog using Krkn - Configuration for direct Krkn usage
- CPU Hog using Krknctl - Configuration for Krknctl CLI
- CPU Hog using Krkn-Hub - Configuration for Krkn-Hub