Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions telco-core/configuration/core-overlay.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,25 @@ policies:
nodeSelector:
node-role.kubernetes.io/worker-3: ""

# Control plane PerformanceProfile
- path: reference-crs/required/performance/PerformanceProfile-control-plane.yaml
patches:
- spec:
cpu:
reserved: '{{hub fromConfigMap "" "hw-types" "control-plane-reserved" | toLiteral hub}}'
isolated: '{{hub fromConfigMap "" "hw-types" "control-plane-isolated" | toLiteral hub}}'
Comment thread
coderabbitai[bot] marked this conversation as resolved.

# TuneD performance patches for core
- path: reference-crs/required/performance/TunedPerformancePatch.yaml
patches:
- metadata:
name: telco-core-performance-patch
spec:
recommend:
- machineConfigLabels:
machineconfiguration.openshift.io/role: master
priority: 18
profile: control-plane-profile
- machineConfigLabels:
machineconfiguration.openshift.io/role: worker-1
priority: 18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ custom-manifests/subscription-validator.yaml

# This is an object-template-raw used only to validate pre-caching state
custom-manifests/precache-validator.yaml

# Control plane PerformanceProfile is merged into the main PerformanceProfile.yaml template
required/performance/PerformanceProfile-control-plane.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,29 @@
apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
name: {{ .metadata.name }}
{{- $isControlPlane := false }}
{{- if hasKey .spec "machineConfigPoolSelector" }}
{{- if hasKey .spec.machineConfigPoolSelector "pools.operator.machineconfiguration.openshift.io/master" }}
{{- $isControlPlane = true }}
{{- end }}
{{- end }}
name: {{ if $isControlPlane }}control-plane-profile{{ else }}{{ .metadata.name }}{{ end }}
annotations:
{{- if $isControlPlane }}
# systemReserved: when used, it should be tailored for each environment.
{{- $rawConfig := index (.metadata.annotations | default dict) "kubeletconfig.experimental" }}
{{- $config := $rawConfig | default "{}" | fromJson }}
{{- if hasKey $config "allowedUnsafeSysctls" }}
{{- if ne (len $config.allowedUnsafeSysctls) 0 }}
{{- fail "Control plane PerformanceProfile must not have any allowedUnsafeSysctls" }}
{{- end }}
{{- end }}
kubeletconfig.experimental: |
{
"systemReserved":{{ $config.systemReserved | toJson }}
}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
{{- else }}
# Some pods want the kernel stack to ignore IPv6 router Advertisement.
{{- if .metadata }}
{{ $allowedSysctls := (list
"net.ipv6.conf.default.accept_ra"
"net.ipv6.conf.all.disable_ipv6"
Expand All @@ -30,19 +49,12 @@ spec:
"intel_idle.max_cstate=0"
) ) }}
cpu:
# node0 CPUs: 0-17,36-53
# node1 CPUs: 18-34,54-71
# siblings: (0,36), (1,37)...
# we want to reserve the first Core of each NUMA socket
#
# no CPU left behind! all-cpus == isolated + reserved
isolated: {{ .spec.cpu.isolated }} # eg 1-17,19-35,37-53,55-71
reserved: {{ .spec.cpu.reserved }} # eg 0,18,36,54
# Guaranteed QoS pods will disable IRQ balancing for cores allocated to the pod.
# default value of globallyDisableIrqLoadBalancing is false
isolated: {{ .spec.cpu.isolated }}
reserved: {{ .spec.cpu.reserved }}
globallyDisableIrqLoadBalancing: false
{{- if or (not $isControlPlane) (hasKey .spec "hugepages") }}
hugepages:
defaultHugepagesSize: 1G
defaultHugepagesSize: {{ .spec.hugepages.defaultHugepagesSize }}
pages:
{{- range .spec.hugepages.pages }}
- size: {{ .size }}
Expand All @@ -51,20 +63,17 @@ spec:
node: {{ .node }}
{{- end }}
{{- end }}
{{- end }}
{{- if hasKey .spec "kernelPageSize" }}
kernelPageSize: {{ .spec.kernelPageSize }}
{{- end }}
{{- if hasKey .spec "machineConfigPoolSelector" }}
machineConfigPoolSelector:
{{- .spec.machineConfigPoolSelector | toYaml | nindent 4 }}
# # For SNO: machineconfiguration.openshift.io/role: 'master'
# pools.operator.machineconfiguration.openshift.io/worker: ''
{{- end }}
{{- if hasKey .spec "nodeSelector" }}
nodeSelector:
{{- .spec.nodeSelector | toYaml | nindent 4 }}
# # For SNO: node-role.kubernetes.io/master: ""
# node-role.kubernetes.io/worker: ""
{{- end }}
workloadHints:
realTime: false
Expand All @@ -77,5 +86,5 @@ spec:
topologyPolicy: "single-numa-node"
{{- if hasKey .spec.net "userLevelNetworking" }}
net:
userLevelNetworking: false
userLevelNetworking: {{ if $isControlPlane }}true{{ else }}false{{ end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# required
# count: 1
---
apiVersion: performance.openshift.io/v2
kind: PerformanceProfile
metadata:
name: control-plane-profile
annotations:
# systemReserved: when used, it should be tailored for each environment.
kubeletconfig.experimental: |
{
"systemReserved":{"memory":"11Gi"}
}
spec:
# Optional kernel arguments:
# To enable acpi_idle CPUIdle driver
# - intel_idle.max_cstate=0
additionalKernelArgs:
- module_blacklist=irdma
cpu:
# siblings: (0,36), (1,37)...
# we want to reserve 8 cores (16 CPUs with HT)
#
# no CPU left behind! all-cpus == isolated + reserved
isolated: 8-35,44-71
reserved: 0-7,36-43
# default value of globallyDisableIrqLoadBalancing is false
globallyDisableIrqLoadBalancing: false
# Hugepages may be configured as needed when using schedulable control planes
#hugepages:
# defaultHugepagesSize: 1G
# pages:
# - count: 64
# size: 1G
machineConfigPoolSelector:
pools.operator.machineconfiguration.openshift.io/master: ''
nodeSelector:
node-role.kubernetes.io/master: ""
workloadHints:
realTime: false
highPowerConsumption: false
perPodPowerManagement: true
realTimeKernel:
enabled: false
numa:
# All guaranteed QoS containers get resources from a single NUMA node
topologyPolicy: "single-numa-node"
net:
userLevelNetworking: true
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ spec:
data: |
[main]
summary=Top-level core performance tuning overrides
- name: control-plane-profile
data: |
[main]
summary=Control plane core performance tuning overrides
include=openshift-node-performance-control-plane-profile
[sysctl]
kernel.panic_on_unrecovered_nmi=1
- name: worker-profile-1
data: |
[main]
Expand Down
3 changes: 3 additions & 0 deletions telco-core/configuration/template-values/hw-types.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ metadata:
name: hw-types
namespace: ztp-core-policies
data:
control-plane-reserved: "0-7,36-43"
control-plane-isolated: "8-35,44-71"

role-worker-1-reserved: "0-1,52-53"
role-worker-1-isolated: "2-51,54-103"
role-worker-1-hugepg-cnt: "4"
Expand Down
Loading