Cpu performance

From RedHatProductSecurity/prodsec-skills · View interactive version

Cpu performance is an AI agent skill from the GitHub repository RedHatProductSecurity/prodsec-skills. Configure CPU isolation, scheduling policies, storage provisioning, and image pull policies for latency-sensitive Kubernetes workloads. Use when writing, reviewing, or auditing pod specs for telco, far-edge, or real-time workloads that require deterministic CPU performance.

How to use this skill

Skill file

CPU and Performance Configuration

Configure workloads for deterministic CPU performance, correct scheduling policies, and reliable storage and image management.

CPU Isolation

For workloads requiring exclusive CPU access (Guaranteed QoS with dedicated CPUs), all containers in the pod must meet these requirements:

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

apiVersion: apps/v1
kind: Deployment
metadata:
  name: app
  annotations:
    cpu-load-balancing.crio.io: "disable"
    irq-load-balancing.crio.io: "disable"
spec:
  template:
    spec:
      runtimeClassName: performance-rt
      containers:
        - name: app
          resources:
            requests:
              cpu: "2"
              memory: 256Mi
            limits:
              cpu: "2"
              memory: 256Mi

CPU Pool Scheduling Policies

Containers must use the correct scheduling policy for their CPU pool type.

Exclusive CPU Pool

Workloads in the exclusive CPU pool must use real-time (RT) scheduling policy with priority less than 10.

Required for: Far-Edge (mandatory), all others (optional)

Isolated CPU Pool

Workloads in the isolated CPU pool must also use RT scheduling policy.

Required for: Far-Edge (mandatory), all others (optional)

Shared CPU Pool

Workloads in the shared CPU pool must use non-RT scheduling policies (e.g., SCHED_OTHER) to share CPU time fairly with other applications and kernel threads.

Required for: Far-Edge (mandatory), all others (optional)

CPU Pool Consistency

If one container in a pod selects an exclusive CPU pool, all containers in that pod must select the same CPU pool type.

Required for: Far-Edge (mandatory), all others (optional)

Image Pull Policy

Containers must use IfNotPresent as the image pull policy. This ensures pods can restart even if the image registry is temporarily unavailable.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

containers:
  - name: app
    image: registry.example.com/app:v1.2.3
    imagePullPolicy: IfNotPresent

Pod Ownership

Workload pods must be deployed as part of a ReplicaSet (via Deployment) or StatefulSet. Do not use naked pods or DaemonSets — they lack proper lifecycle management for updates, scaling, and recovery.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

Storage Provisioning

Persistent Volume Reclaim Policy

Persistent volumes used by workloads must have a reclaim policy of Delete. This ensures storage is cleaned up when the workload is removed from the cluster.

Required for: Telco (mandatory), Far-Edge (mandatory), Extended (mandatory), Non-Telco (optional)

apiVersion: v1
kind: PersistentVolume
metadata:
  name: app-pv
spec:
  persistentVolumeReclaimPolicy: Delete

Storage Provisioner

Multi-node clusters must not use local storage provisioners (kubernetes.io/no-provisioner, topolvm.io). Local storage is only appropriate for single-node clusters, where only one local provisioner type should be installed (LVMS or no-provisioner).

Required for: all profiles (mandatory)

Implementation Checklist

Certsuite Test Mapping

| Guidance | Certsuite Test ID | Profiles |

|----------|-------------------|----------|

| CPU isolation | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Exclusive CPU pool RT scheduling | CODE0 | Far-Edge: mandatory, all others: optional |

| Isolated CPU pool RT scheduling | CODE0 | Far-Edge: mandatory, all others: optional |

| Shared CPU pool non-RT scheduling | CODE0 | Far-Edge: mandatory, all others: optional |

| CPU pool consistency | CODE0 | Far-Edge: mandatory, all others: optional |

| Image pull policy | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Pod ownership | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| PV reclaim policy | CODE0 | Telco/Far-Edge/Extended: mandatory, Non-Telco: optional |

| Storage provisioner | CODE0 | All profiles: mandatory |

References

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.