Skip to content

Commit e8a21e8

Browse files
committed
CNF-24269 Add Core control-plane PerformanceProfile
Add PerformanceProfile and Tuned configuration for Core control-plane MCP. Number of reserved/isolated CPUs, hugepages, and systemReserved memory are all variable content. The kube-compare reference uses the same PerformanceProfile template for both control plane and worker profiles with differences keyed off the machineConfigPoolSelector. Signed-off-by: Ian Miller <imiller@redhat.com>
1 parent fda0964 commit e8a21e8

6 files changed

Lines changed: 98 additions & 16 deletions

File tree

telco-core/configuration/core-overlay.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,25 @@ policies:
132132
nodeSelector:
133133
node-role.kubernetes.io/worker-3: ""
134134

135+
# Control plane PerformanceProfile
136+
- path: reference-crs/required/performance/PerformanceProfile-control-plane.yaml
137+
patches:
138+
- spec:
139+
cpu:
140+
reserved: '{{hub fromConfigMap "" "hw-types" "control-plane-reserved" | toLiteral hub}}'
141+
isolated: '{{hub fromConfigMap "" "hw-types" "control-plane-isolated" | toLiteral hub}}'
142+
135143
# TuneD performance patches for core
136144
- path: reference-crs/required/performance/TunedPerformancePatch.yaml
137145
patches:
138146
- metadata:
139147
name: telco-core-performance-patch
140148
spec:
141149
recommend:
150+
- machineConfigLabels:
151+
machineconfiguration.openshift.io/role: master
152+
priority: 18
153+
profile: control-plane-profile
142154
- machineConfigLabels:
143155
machineconfiguration.openshift.io/role: worker-1
144156
priority: 18

telco-core/configuration/reference-crs-kube-compare/compare_ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ custom-manifests/subscription-validator.yaml
3838

3939
# This is an object-template-raw used only to validate pre-caching state
4040
custom-manifests/precache-validator.yaml
41+
42+
# Control plane PerformanceProfile is merged into the main PerformanceProfile.yaml template
43+
required/performance/PerformanceProfile-control-plane.yaml

telco-core/configuration/reference-crs-kube-compare/required/performance/PerformanceProfile.yaml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,28 @@
33
apiVersion: performance.openshift.io/v2
44
kind: PerformanceProfile
55
metadata:
6-
name: {{ .metadata.name }}
6+
{{- $isControlPlane := false }}
7+
{{- if hasKey .spec "machineConfigPoolSelector" }}
8+
{{- if hasKey .spec.machineConfigPoolSelector "pools.operator.machineconfiguration.openshift.io/master" }}
9+
{{- $isControlPlane = true }}
10+
{{- end }}
11+
{{- end }}
12+
name: {{ if $isControlPlane }}control-plane-profile{{ else }}{{ .metadata.name }}{{ end }}
713
annotations:
14+
{{- if $isControlPlane }}
15+
# systemReserved: when used, it should be tailored for each environment.
16+
{{- $config := (index (.metadata.annotations | default dict) "kubeletconfig.experimental") | fromJson }}
17+
{{- if hasKey $config "allowedUnsafeSysctls" }}
18+
{{- if ne (len $config.allowedUnsafeSysctls) 0 }}
19+
{{- fail "Control plane PerformanceProfile must not have any allowedUnsafeSysctls" }}
20+
{{- end }}
21+
{{- end }}
22+
kubeletconfig.experimental: |
23+
{
24+
"systemReserved":{{ $config.systemReserved | toJson }}
25+
}
26+
{{- else }}
827
# Some pods want the kernel stack to ignore IPv6 router Advertisement.
9-
{{- if .metadata }}
1028
{{ $allowedSysctls := (list
1129
"net.ipv6.conf.default.accept_ra"
1230
"net.ipv6.conf.all.disable_ipv6"
@@ -30,17 +48,10 @@ spec:
3048
"intel_idle.max_cstate=0"
3149
) ) }}
3250
cpu:
33-
# node0 CPUs: 0-17,36-53
34-
# node1 CPUs: 18-34,54-71
35-
# siblings: (0,36), (1,37)...
36-
# we want to reserve the first Core of each NUMA socket
37-
#
38-
# no CPU left behind! all-cpus == isolated + reserved
39-
isolated: {{ .spec.cpu.isolated }} # eg 1-17,19-35,37-53,55-71
40-
reserved: {{ .spec.cpu.reserved }} # eg 0,18,36,54
41-
# Guaranteed QoS pods will disable IRQ balancing for cores allocated to the pod.
42-
# default value of globallyDisableIrqLoadBalancing is false
51+
isolated: {{ .spec.cpu.isolated }}
52+
reserved: {{ .spec.cpu.reserved }}
4353
globallyDisableIrqLoadBalancing: false
54+
{{- if hasKey .spec "hugepages" }}
4455
hugepages:
4556
defaultHugepagesSize: 1G
4657
pages:
@@ -51,20 +62,17 @@ spec:
5162
node: {{ .node }}
5263
{{- end }}
5364
{{- end }}
65+
{{- end }}
5466
{{- if hasKey .spec "kernelPageSize" }}
5567
kernelPageSize: {{ .spec.kernelPageSize }}
5668
{{- end }}
5769
{{- if hasKey .spec "machineConfigPoolSelector" }}
5870
machineConfigPoolSelector:
5971
{{- .spec.machineConfigPoolSelector | toYaml | nindent 4 }}
60-
# # For SNO: machineconfiguration.openshift.io/role: 'master'
61-
# pools.operator.machineconfiguration.openshift.io/worker: ''
6272
{{- end }}
6373
{{- if hasKey .spec "nodeSelector" }}
6474
nodeSelector:
6575
{{- .spec.nodeSelector | toYaml | nindent 4 }}
66-
# # For SNO: node-role.kubernetes.io/master: ""
67-
# node-role.kubernetes.io/worker: ""
6876
{{- end }}
6977
workloadHints:
7078
realTime: false
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# required
2+
# count: 1
3+
---
4+
apiVersion: performance.openshift.io/v2
5+
kind: PerformanceProfile
6+
metadata:
7+
name: control-plane-profile
8+
annotations:
9+
# systemReserved: when used, it should be tailored for each environment.
10+
kubeletconfig.experimental: |
11+
{
12+
"systemReserved":{"memory":"11Gi"}
13+
}
14+
spec:
15+
# Optional kernel arguments:
16+
# To enable acpi_idle CPUIdle driver
17+
# - intel_idle.max_cstate=0
18+
additionalKernelArgs:
19+
- module_blacklist=irdma
20+
cpu:
21+
# siblings: (0,36), (1,37)...
22+
# we want to reserve 8 cores (16 CPUs with HT)
23+
#
24+
# no CPU left behind! all-cpus == isolated + reserved
25+
isolated: 8-35,44-71
26+
reserved: 0-7,36-43
27+
# default value of globallyDisableIrqLoadBalancing is false
28+
globallyDisableIrqLoadBalancing: false
29+
# Hugepages may be configured as needed when using schedulable control planes
30+
#hugepages:
31+
# defaultHugepagesSize: 1G
32+
# pages:
33+
# - count: 64
34+
# size: 1G
35+
machineConfigPoolSelector:
36+
pools.operator.machineconfiguration.openshift.io/master: ''
37+
nodeSelector:
38+
node-role.kubernetes.io/control-plane: ""
39+
workloadHints:
40+
realTime: false
41+
highPowerConsumption: false
42+
perPodPowerManagement: true
43+
realTimeKernel:
44+
enabled: false
45+
numa:
46+
# All guaranteed QoS containers get resources from a single NUMA node
47+
topologyPolicy: "single-numa-node"
48+
net:
49+
userLevelNetworking: false

telco-core/configuration/reference-crs/required/performance/TunedPerformancePatch.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ spec:
1313
data: |
1414
[main]
1515
summary=Top-level core performance tuning overrides
16+
- name: control-plane-profile
17+
data: |
18+
[main]
19+
summary=Control plane core performance tuning overrides
20+
include=openshift-node-performance-control-plane-profile
21+
[sysctl]
22+
kernel.panic_on_unrecovered_nmi=1
1623
- name: worker-profile-1
1724
data: |
1825
[main]

telco-core/configuration/template-values/hw-types.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ metadata:
55
name: hw-types
66
namespace: ztp-core-policies
77
data:
8+
control-plane-reserved: "0-7,36-43"
9+
control-plane-isolated: "8-35,44-71"
10+
811
role-worker-1-reserved: "0-1,52-53"
912
role-worker-1-isolated: "2-51,54-103"
1013
role-worker-1-hugepg-cnt: "4"

0 commit comments

Comments
 (0)