Skip to content
Open
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
1 change: 1 addition & 0 deletions features.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
| GCPCustomAPIEndpoints| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| GCPCustomAPIEndpointsInstall| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| GCPDualStackInstall| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| GomaxprocsInjection| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| HyperShiftOnlyDynamicResourceAllocation| <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | | <span style="background-color: #519450">Enabled</span> | |
| ImageModeStatusReporting| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
| IngressComponentRouteLabels| | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> | | | <span style="background-color: #519450">Enabled</span> | <span style="background-color: #519450">Enabled</span> |
Expand Down
8 changes: 8 additions & 0 deletions features/features.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,4 +1060,12 @@ var (
enhancementPR("https://github.com/openshift/enhancements/pull/2007").
enable(inClusterProfile(SelfManaged), inDevPreviewNoUpgrade()).
mustRegister()

FeatureGateGomaxprocsInjection = newFeatureGate("GomaxprocsInjection").
reportProblemsToJiraComponent("machine-config-operator").
contactPerson("haircommander").
productScope(ocpSpecific).
enhancementPR("https://github.com/openshift/enhancements/pull/2047").
enable(inTechPreviewNoUpgrade(), inDevPreviewNoUpgrade()).
mustRegister()
)
61 changes: 61 additions & 0 deletions machineconfiguration/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,22 @@ type KubeletConfigSpec struct {
// When specified, the type field can be set to either "Old", "Intermediate", "Modern", "Custom" or omitted for backward compatibility.
// +optional
TLSSecurityProfile *configv1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`

// systemGomaxprocsBehavior controls whether the kubelet-auto-node-size service automatically configures
// GOMAXPROCS for kubelet and CRI-O system services based on the system reserved CPU allocation.
// Valid values are "Autosize" and "Disabled".
// When set to "Autosize", the GOMAXPROCS environment variable for kubelet and CRI-O is set to
// max(ceil(system_reserved_cpu), 1). This optimizes the runtime parallelism of these Go-based system
// services based on their CPU allocation rather than total node capacity.
// When set to "Disabled", automatic GOMAXPROCS configuration is disabled and the system services
// use Go's default GOMAXPROCS behavior.
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
// The current default is "Disabled".
//
// +openshift:enable:FeatureGate=GomaxprocsInjection
// +optional
// +kubebuilder:validation:Enum=Autosize;Disabled
SystemGomaxprocsBehavior SystemGomaxprocsBehaviorType `json:"systemGomaxprocsBehavior,omitempty"`
}

// KubeletConfigStatus defines the observed state of a KubeletConfig
Expand Down Expand Up @@ -962,6 +978,27 @@ type ContainerRuntimeConfiguration struct {
// +kubebuilder:validation:MaxItems=10
// +kubebuilder:validation:XValidation:rule="self.all(x, self.exists_one(y, x.path == y.path))",message="additionalArtifactStores must not contain duplicate paths"
AdditionalArtifactStores []AdditionalArtifactStore `json:"additionalArtifactStores,omitempty"`

// containerGomaxprocsBehavior controls whether CRI-O automatically injects the GOMAXPROCS environment variable into containers
// based on their CPU resource requests.
// Valid values are "Autosize" and "Disabled".
// When set to "Autosize", CRI-O will automatically set GOMAXPROCS proportional to the container's CPU request,
// calculated as max(ceil(cpu_request_in_cores * 2), 1). This helps Go applications optimize their runtime parallelism
// based on the allocated CPU resources rather than the total node capacity.
// When set to "Disabled", GOMAXPROCS injection is disabled and containers will use Go's default GOMAXPROCS behavior.
// When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
// The current default is "Disabled".
//
// Containers can override the injected GOMAXPROCS value by:
// - Setting GOMAXPROCS in the container image Dockerfile (ENV GOMAXPROCS=...)
// - Setting GOMAXPROCS in the pod spec (env or envFrom)
// - Calling runtime.GOMAXPROCS() programmatically in Go code
// - Adding the skip-gomaxprocs.crio.io annotation to the pod
//
// +openshift:enable:FeatureGate=GomaxprocsInjection
// +optional
// +kubebuilder:validation:Enum=Autosize;Disabled
ContainerGomaxprocsBehavior ContainerGomaxprocsBehaviorType `json:"containerGomaxprocsBehavior,omitempty"`
}

type ContainerRuntimeDefaultRuntime string
Expand All @@ -974,6 +1011,30 @@ const (
ContainerRuntimeDefaultRuntimeDefault = ContainerRuntimeDefaultRuntimeCrun
)

// ContainerGomaxprocsBehaviorType specifies whether CRI-O should inject GOMAXPROCS into containers
type ContainerGomaxprocsBehaviorType string

const (
// ContainerGomaxprocsBehaviorAutosize enables automatic GOMAXPROCS injection based on CPU requests
ContainerGomaxprocsBehaviorAutosize ContainerGomaxprocsBehaviorType = "Autosize"
// ContainerGomaxprocsBehaviorDisabled disables GOMAXPROCS injection
ContainerGomaxprocsBehaviorDisabled ContainerGomaxprocsBehaviorType = "Disabled"
// ContainerGomaxprocsBehaviorDefault is the default behavior
ContainerGomaxprocsBehaviorDefault = ContainerGomaxprocsBehaviorDisabled
)

// SystemGomaxprocsBehaviorType specifies whether system services should have GOMAXPROCS automatically configured
type SystemGomaxprocsBehaviorType string

const (
// SystemGomaxprocsBehaviorAutosize enables automatic GOMAXPROCS configuration for system services based on system reserved CPU
SystemGomaxprocsBehaviorAutosize SystemGomaxprocsBehaviorType = "Autosize"
// SystemGomaxprocsBehaviorDisabled disables automatic GOMAXPROCS configuration for system services
SystemGomaxprocsBehaviorDisabled SystemGomaxprocsBehaviorType = "Disabled"
// SystemGomaxprocsBehaviorDefault is the default behavior
SystemGomaxprocsBehaviorDefault = SystemGomaxprocsBehaviorDisabled
)

// StorePath is an absolute filesystem path used by additional container storage configurations.
// The path must be between 1 and 256 characters long, begin with a forward slash, and only contain
// the characters a-z, A-Z, 0-9, '/', '.', '_', and '-'. Consecutive forward slashes are not permitted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,27 @@ spec:
x-kubernetes-validations:
- message: additionalLayerStores must not contain duplicate paths
rule: self.all(x, self.exists_one(y, x.path == y.path))
containerGomaxprocsBehavior:
description: |-
containerGomaxprocsBehavior controls whether CRI-O automatically injects the GOMAXPROCS environment variable into containers
based on their CPU resource requests.
Valid values are "Autosize" and "Disabled".
When set to "Autosize", CRI-O will automatically set GOMAXPROCS proportional to the container's CPU request,
calculated as max(ceil(cpu_request_in_cores * 2), 1). This helps Go applications optimize their runtime parallelism
based on the allocated CPU resources rather than the total node capacity.
When set to "Disabled", GOMAXPROCS injection is disabled and containers will use Go's default GOMAXPROCS behavior.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
The current default is "Disabled".

Containers can override the injected GOMAXPROCS value by:
- Setting GOMAXPROCS in the container image Dockerfile (ENV GOMAXPROCS=...)
- Setting GOMAXPROCS in the pod spec (env or envFrom)
- Calling runtime.GOMAXPROCS() programmatically in Go code
- Adding the skip-gomaxprocs.crio.io annotation to the pod
enum:
- Autosize
- Disabled
type: string
defaultRuntime:
description: |-
defaultRuntime is the name of the OCI runtime to be used as the default for containers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,27 @@ spec:
x-kubernetes-validations:
- message: additionalLayerStores must not contain duplicate paths
rule: self.all(x, self.exists_one(y, x.path == y.path))
containerGomaxprocsBehavior:
description: |-
containerGomaxprocsBehavior controls whether CRI-O automatically injects the GOMAXPROCS environment variable into containers
based on their CPU resource requests.
Valid values are "Autosize" and "Disabled".
When set to "Autosize", CRI-O will automatically set GOMAXPROCS proportional to the container's CPU request,
calculated as max(ceil(cpu_request_in_cores * 2), 1). This helps Go applications optimize their runtime parallelism
based on the allocated CPU resources rather than the total node capacity.
When set to "Disabled", GOMAXPROCS injection is disabled and containers will use Go's default GOMAXPROCS behavior.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
The current default is "Disabled".

Containers can override the injected GOMAXPROCS value by:
- Setting GOMAXPROCS in the container image Dockerfile (ENV GOMAXPROCS=...)
- Setting GOMAXPROCS in the pod spec (env or envFrom)
- Calling runtime.GOMAXPROCS() programmatically in Go code
- Adding the skip-gomaxprocs.crio.io annotation to the pod
enum:
- Autosize
- Disabled
type: string
defaultRuntime:
description: |-
defaultRuntime is the name of the OCI runtime to be used as the default for containers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,27 @@ spec:
x-kubernetes-validations:
- message: additionalLayerStores must not contain duplicate paths
rule: self.all(x, self.exists_one(y, x.path == y.path))
containerGomaxprocsBehavior:
description: |-
containerGomaxprocsBehavior controls whether CRI-O automatically injects the GOMAXPROCS environment variable into containers
based on their CPU resource requests.
Valid values are "Autosize" and "Disabled".
When set to "Autosize", CRI-O will automatically set GOMAXPROCS proportional to the container's CPU request,
calculated as max(ceil(cpu_request_in_cores * 2), 1). This helps Go applications optimize their runtime parallelism
based on the allocated CPU resources rather than the total node capacity.
When set to "Disabled", GOMAXPROCS injection is disabled and containers will use Go's default GOMAXPROCS behavior.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
The current default is "Disabled".

Containers can override the injected GOMAXPROCS value by:
- Setting GOMAXPROCS in the container image Dockerfile (ENV GOMAXPROCS=...)
- Setting GOMAXPROCS in the pod spec (env or envFrom)
- Calling runtime.GOMAXPROCS() programmatically in Go code
- Adding the skip-gomaxprocs.crio.io annotation to the pod
enum:
- Autosize
- Disabled
type: string
defaultRuntime:
description: |-
defaultRuntime is the name of the OCI runtime to be used as the default for containers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
systemGomaxprocsBehavior:
description: |-
systemGomaxprocsBehavior controls whether the kubelet-auto-node-size service automatically configures
GOMAXPROCS for kubelet and CRI-O system services based on the system reserved CPU allocation.
Valid values are "Autosize" and "Disabled".
When set to "Autosize", the GOMAXPROCS environment variable for kubelet and CRI-O is set to
max(ceil(system_reserved_cpu), 1). This optimizes the runtime parallelism of these Go-based system
services based on their CPU allocation rather than total node capacity.
When set to "Disabled", automatic GOMAXPROCS configuration is disabled and the system services
use Go's default GOMAXPROCS behavior.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
The current default is "Disabled".
enum:
- Autosize
- Disabled
type: string
tlsSecurityProfile:
description: |-
tlsSecurityProfile configures TLS settings for the kubelet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
systemGomaxprocsBehavior:
description: |-
systemGomaxprocsBehavior controls whether the kubelet-auto-node-size service automatically configures
GOMAXPROCS for kubelet and CRI-O system services based on the system reserved CPU allocation.
Valid values are "Autosize" and "Disabled".
When set to "Autosize", the GOMAXPROCS environment variable for kubelet and CRI-O is set to
max(ceil(system_reserved_cpu), 1). This optimizes the runtime parallelism of these Go-based system
services based on their CPU allocation rather than total node capacity.
When set to "Disabled", automatic GOMAXPROCS configuration is disabled and the system services
use Go's default GOMAXPROCS behavior.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
The current default is "Disabled".
enum:
- Autosize
- Disabled
type: string
tlsSecurityProfile:
description: |-
tlsSecurityProfile configures TLS settings for the kubelet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,22 @@ spec:
type: object
type: object
x-kubernetes-map-type: atomic
systemGomaxprocsBehavior:
description: |-
systemGomaxprocsBehavior controls whether the kubelet-auto-node-size service automatically configures
GOMAXPROCS for kubelet and CRI-O system services based on the system reserved CPU allocation.
Valid values are "Autosize" and "Disabled".
When set to "Autosize", the GOMAXPROCS environment variable for kubelet and CRI-O is set to
max(ceil(system_reserved_cpu), 1). This optimizes the runtime parallelism of these Go-based system
services based on their CPU allocation rather than total node capacity.
When set to "Disabled", automatic GOMAXPROCS configuration is disabled and the system services
use Go's default GOMAXPROCS behavior.
When omitted, this means no opinion and the platform is left to choose a reasonable default, which is subject to change over time.
The current default is "Disabled".
enum:
- Autosize
- Disabled
type: string
tlsSecurityProfile:
description: |-
tlsSecurityProfile configures TLS settings for the kubelet.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ containerruntimeconfigs.machineconfiguration.openshift.io:
Category: ""
FeatureGates:
- AdditionalStorageConfig
- GomaxprocsInjection
FilenameOperatorName: machine-config
FilenameOperatorOrdering: "01"
FilenameRunLevel: "0000_80"
Expand Down Expand Up @@ -87,6 +88,7 @@ kubeletconfigs.machineconfiguration.openshift.io:
Capability: ""
Category: ""
FeatureGates:
- GomaxprocsInjection
- TLSGroupPreferences
FilenameOperatorName: machine-config
FilenameOperatorOrdering: "01"
Expand Down
Loading