Skip to content

Commit ccf08d2

Browse files
committed
Add playbook to apply Performance profile to run llc tests
Signed-off-by: Niranjan M.R <mniranja@redhat.com>
1 parent c69cfb1 commit ccf08d2

3 files changed

Lines changed: 104 additions & 0 deletions

File tree

roles/llc/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# LLC Role
2+
3+
This Ansible role creates a PerformanceProfile for Low Latency Communications (LLC) workloads on OpenShift clusters.
4+
5+
## Description
6+
7+
The role creates a PerformanceProfile with specific configurations optimized for low latency workloads including:
8+
- CPU isolation and reservation
9+
- Huge pages configuration
10+
- Real-time kernel settings
11+
- Network optimizations
12+
- NUMA topology settings
13+
14+
## Variables
15+
16+
The following variables can be customized in your playbook or inventory:
17+
18+
- `llc_performance_profile_name`: Name of the performance profile (default: "performance")
19+
- `llc_performance_profile_namespace`: Namespace where the profile will be created (default: "openshift-cluster-node-tuning-operator")
20+
- `pp_kubeconfig`: Path to kubeconfig file (optional)
21+
22+
## Usage
23+
24+
Include this role in your playbook:
25+
26+
```yaml
27+
- hosts: localhost
28+
roles:
29+
- llc
30+
```
31+
32+
Or with custom variables:
33+
34+
```yaml
35+
- hosts: localhost
36+
vars:
37+
llc_performance_profile_name: "my-llc-profile"
38+
roles:
39+
- llc
40+
```
41+
42+
## Requirements
43+
44+
- kubernetes.core collection
45+
- Access to OpenShift cluster with cluster-admin privileges
46+
- Node Feature Discovery and Performance Addon Operator installed

roles/llc/defaults/main.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
llc_performance_profile_name: performance
3+
llc_performance_profile_namespace: openshift-cluster-node-tuning-operator

roles/llc/tasks/main.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
- name: Create LLC performance profile
3+
kubernetes.core.k8s:
4+
kubeconfig: "{{ pp_kubeconfig | default(omit) }}"
5+
state: present
6+
definition:
7+
apiVersion: performance.openshift.io/v2
8+
kind: PerformanceProfile
9+
metadata:
10+
name: "{{ llc_performance_profile_name }}"
11+
namespace: "{{ llc_performance_profile_namespace }}"
12+
spec:
13+
additionalKernelArgs:
14+
- module_blacklist=irdma
15+
cpu:
16+
isolated: 2-255,258-511
17+
reserved: 0-1,256-257
18+
machineConfigPoolSelector:
19+
machineconfiguration.openshift.io/role: worker-cnf
20+
hugepages:
21+
defaultHugepagesSize: 1G
22+
pages:
23+
- count: 1
24+
node: 0
25+
size: 1G
26+
- count: 128
27+
node: 1
28+
size: 2M
29+
net:
30+
userLevelNetworking: true
31+
nodeSelector:
32+
node-role.kubernetes.io/worker-cnf: ""
33+
numa:
34+
topologyPolicy: single-numa-node
35+
realTimeKernel:
36+
enabled: false
37+
workloadHints:
38+
highPowerConsumption: true
39+
perPodPowerManagement: false
40+
realTime: true
41+
42+
- name: Wait for performance profile to be applied
43+
kubernetes.core.k8s_info:
44+
kubeconfig: "{{ pp_kubeconfig | default(omit) }}"
45+
api_version: performance.openshift.io/v2
46+
kind: PerformanceProfile
47+
name: "{{ llc_performance_profile_name }}"
48+
namespace: "{{ llc_performance_profile_namespace }}"
49+
register: performance_profile_status
50+
until:
51+
- "'resources' in performance_profile_status"
52+
- performance_profile_status.resources | length > 0
53+
- performance_profile_status.resources[0].status is defined
54+
retries: 30
55+
delay: 10

0 commit comments

Comments
 (0)