Skip to content

machineconfiguration: add dropInDir details for KubeletConfigSpec #2387

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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 @@ -43,6 +43,7 @@
| InsightsOnDemandDataGather| | | <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> |
| InsightsRuntimeExtractor| | | <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> |
| KMSEncryptionProvider| | | <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> |
| KubeletConfigDropInDir| | | <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> |
| MachineAPIMigration| | | <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> |
| ManagedBootImagesAzure| | | <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> |
| ManagedBootImagesvSphere| | | <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 @@ -701,6 +701,14 @@ var (
enhancementPR("https://github.com/openshift/enhancements/pull/1697").
mustRegister()

FeatureGateKubeletConfigDropInDir = newFeatureGate("KubeletConfigDropInDir").
reportProblemsToJiraComponent("Node").
contactPerson("sohankunkerkar").
productScope(ocpSpecific).
enableIn(configv1.DevPreviewNoUpgrade, configv1.TechPreviewNoUpgrade).
enhancementPR("https://github.com/kubernetes/enhancements/issues/3983").
mustRegister()

FeatureGateNutanixMultiSubnets = newFeatureGate("NutanixMultiSubnets").
reportProblemsToJiraComponent("Cloud Compute / Nutanix Provider").
contactPerson("yanhli").
Expand Down
22 changes: 22 additions & 0 deletions machineconfiguration/v1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,7 @@ type KubeletConfigSpec struct {
// A nil selector will result in no pools being selected.
// +optional
MachineConfigPoolSelector *metav1.LabelSelector `json:"machineConfigPoolSelector,omitempty"`

// kubeletConfig fields are defined in kubernetes upstream. Please refer to the types defined in the version/commit used by
// OpenShift of the upstream kubernetes. It's important to note that, since the fields of the kubelet configuration are directly fetched from
// upstream the validation of those values is handled directly by the kubelet. Please refer to the upstream version of the relevant kubernetes
Expand All @@ -721,6 +722,27 @@ type KubeletConfigSpec struct {
// the maximum available minTLSVersion is VersionTLS12.
// +optional
TLSSecurityProfile *configv1.TLSSecurityProfile `json:"tlsSecurityProfile,omitempty"`

// dropInConfig allows users to define a drop-in configuration for Kubelet.
// +optional
DropInConfig *KubeletDropInDirConfigDetails `json:"dropInConfig,omitempty"`
}

// KubeletDropInDirConfigDetails defines the details for Kubelet drop-in configuration.
type KubeletDropInDirConfigDetails struct {
// ConfigDirectory allows users to define a directory for Kubelet's drop-in configuration.
// This enables incremental configuration updates without modifying the main KubeletConfig.
// +required
ConfigDirectory string `json:"configDirectory"`

// ConfigFile defines a specific configuration file within the drop-in directory.
// +required
ConfigFile string `json:"configFile"`

// KubeletConfig fields are defined in Kubernetes upstream. This must be set if DropInConfigDirectory
// and DropInConfigFile are provided.
// +required
KubeletConfig runtime.RawExtension `json:"kubeletConfig"`
}

// KubeletConfigStatus defines the observed state of a KubeletConfig
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ spec:
properties:
autoSizingReserved:
type: boolean
dropInConfig:
description: dropInConfig allows users to define a drop-in configuration
for Kubelet.
properties:
configDirectory:
description: |-
ConfigDirectory allows users to define a directory for Kubelet's drop-in configuration.
This enables incremental configuration updates without modifying the main KubeletConfig.
type: string
configFile:
description: ConfigFile defines a specific configuration file
within the drop-in directory.
type: string
kubeletConfig:
description: |-
KubeletConfig fields are defined in Kubernetes upstream. This must be set if DropInConfigDirectory
and DropInConfigFile are provided.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- configDirectory
- configFile
- kubeletConfig
type: object
kubeletConfig:
description: |-
kubeletConfig fields are defined in kubernetes upstream. Please refer to the types defined in the version/commit used by
Expand Down
22 changes: 22 additions & 0 deletions machineconfiguration/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ spec:
properties:
autoSizingReserved:
type: boolean
dropInConfig:
description: dropInConfig allows users to define a drop-in configuration
for Kubelet.
properties:
configDirectory:
description: |-
ConfigDirectory allows users to define a directory for Kubelet's drop-in configuration.
This enables incremental configuration updates without modifying the main KubeletConfig.
type: string
configFile:
description: ConfigFile defines a specific configuration file
within the drop-in directory.
type: string
kubeletConfig:
description: |-
KubeletConfig fields are defined in Kubernetes upstream. This must be set if DropInConfigDirectory
and DropInConfigFile are provided.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- configDirectory
- configFile
- kubeletConfig
type: object
kubeletConfig:
description: |-
kubeletConfig fields are defined in kubernetes upstream. Please refer to the types defined in the version/commit used by
Expand Down
12 changes: 12 additions & 0 deletions machineconfiguration/v1/zz_generated.swagger_doc_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,30 @@ spec:
properties:
autoSizingReserved:
type: boolean
dropInConfig:
description: dropInConfig allows users to define a drop-in configuration
for Kubelet.
properties:
configDirectory:
description: |-
ConfigDirectory allows users to define a directory for Kubelet's drop-in configuration.
This enables incremental configuration updates without modifying the main KubeletConfig.
type: string
configFile:
description: ConfigFile defines a specific configuration file
within the drop-in directory.
type: string
kubeletConfig:
description: |-
KubeletConfig fields are defined in Kubernetes upstream. This must be set if DropInConfigDirectory
and DropInConfigFile are provided.
type: object
x-kubernetes-preserve-unknown-fields: true
required:
- configDirectory
- configFile
- kubeletConfig
type: object
kubeletConfig:
description: |-
kubeletConfig fields are defined in kubernetes upstream. Please refer to the types defined in the version/commit used by
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@
{
"name": "KMSEncryptionProvider"
},
{
"name": "KubeletConfigDropInDir"
},
{
"name": "MachineAPIMigration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@
{
"name": "KMSv1"
},
{
"name": "KubeletConfigDropInDir"
},
{
"name": "MachineAPIMigration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@
{
"name": "KMSv1"
},
{
"name": "KubeletConfigDropInDir"
},
{
"name": "MachineAPIMigration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
{
"name": "KMSEncryptionProvider"
},
{
"name": "KubeletConfigDropInDir"
},
{
"name": "MachineAPIMigration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@
{
"name": "KMSv1"
},
{
"name": "KubeletConfigDropInDir"
},
{
"name": "MachineAPIMigration"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@
{
"name": "KMSv1"
},
{
"name": "KubeletConfigDropInDir"
},
{
"name": "MachineAPIMigration"
},
Expand Down