-
Notifications
You must be signed in to change notification settings - Fork 585
NO-ISSUE: Fixes KubeletConfig API doc and adds tests #2651
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
Open
ngopalak-redhat
wants to merge
1
commit into
openshift:master
Choose a base branch
from
ngopalak-redhat:ngopalak/autonode_doc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
276 changes: 276 additions & 0 deletions
276
...guration/v1/tests/kubeletconfigs.machineconfiguration.openshift.io/KubeletConfigSpec.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,276 @@ | ||
| apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this | ||
| name: "KubeletConfig" | ||
| crdName: kubeletconfigs.machineconfiguration.openshift.io | ||
| tests: | ||
| onCreate: | ||
| # AutoSizingReserved tests | ||
| - name: Should be able to set autoSizingReserved to true | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| - name: Should be able to set autoSizingReserved to false | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: false | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: false | ||
| - name: Should be able to omit autoSizingReserved | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| # LogLevel tests | ||
| - name: Should be able to set logLevel to 2 | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 2 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 2 | ||
| - name: Should be able to set logLevel to 4 | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 4 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 4 | ||
| - name: Should be able to omit logLevel | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| # MachineConfigPoolSelector tests | ||
| - name: Should be able to set machineConfigPoolSelector for worker pool | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/worker: "" | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/worker: "" | ||
| - name: Should be able to set machineConfigPoolSelector for master pool | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/master: "" | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/master: "" | ||
| - name: Should be able to omit machineConfigPoolSelector | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| # KubeletConfig tests | ||
| - name: Should be able to set kubeletConfig with maxPods | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| kubeletConfig: | ||
| maxPods: 250 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| kubeletConfig: | ||
| maxPods: 250 | ||
| - name: Should be able to omit kubeletConfig | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| # Combined fields tests | ||
| - name: Should be able to set multiple fields together | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| logLevel: 2 | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/worker: "" | ||
| kubeletConfig: | ||
| maxPods: 250 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| logLevel: 2 | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/worker: "" | ||
| kubeletConfig: | ||
| maxPods: 250 | ||
| onUpdate: | ||
| # AutoSizingReserved update tests | ||
| - name: Should be able to update autoSizingReserved from true to false | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| updated: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: false | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: false | ||
| - name: Should be able to update autoSizingReserved from false to true | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: false | ||
| updated: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| # LogLevel update tests | ||
| - name: Should be able to update logLevel from 2 to 4 | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 2 | ||
| updated: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 4 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 4 | ||
| - name: Should be able to remove logLevel | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| logLevel: 2 | ||
| updated: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: {} | ||
| # MachineConfigPoolSelector update tests | ||
| - name: Should be able to update machineConfigPoolSelector from worker to master | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/worker: "" | ||
| updated: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/master: "" | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| machineConfigPoolSelector: | ||
| matchLabels: | ||
| pools.operator.machineconfiguration.openshift.io/master: "" | ||
| # Combined update tests | ||
| - name: Should be able to update multiple fields together | ||
| initial: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: false | ||
| logLevel: 2 | ||
| updated: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| logLevel: 4 | ||
| kubeletConfig: | ||
| maxPods: 250 | ||
| expected: | | ||
| apiVersion: machineconfiguration.openshift.io/v1 | ||
| kind: KubeletConfig | ||
| spec: | ||
| autoSizingReserved: true | ||
| logLevel: 4 | ||
| kubeletConfig: | ||
| maxPods: 250 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,22 +47,30 @@ spec: | |
| description: spec contains the desired kubelet configuration. | ||
| properties: | ||
| autoSizingReserved: | ||
| description: |- | ||
| autoSizingReserved controls whether system-reserved CPU and memory are automatically | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you think we should mention this is applicable to worker nodes only? |
||
| calculated based on each node's installed capacity. When enabled, prevents node failure | ||
| from resource starvation of system components (kubelet, CRI-O) without manual configuration. | ||
| When unset or true, automatic sizing is enabled. Set to false to disable and use manual settings. | ||
| type: boolean | ||
| kubeletConfig: | ||
| description: |- | ||
| 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 | ||
| for the valid values of these fields. Invalid values of the kubelet configuration fields may render cluster nodes unusable. | ||
| kubeletConfig contains upstream Kubernetes kubelet configuration fields. | ||
| Values are validated by the kubelet itself. Invalid values may render nodes unusable. | ||
| Refer to OpenShift documentation for the Kubernetes version corresponding to your | ||
| OpenShift release to find valid kubelet configuration options. | ||
| type: object | ||
| x-kubernetes-preserve-unknown-fields: true | ||
| logLevel: | ||
| description: |- | ||
| logLevel sets the kubelet log verbosity. Higher values increase log detail. | ||
| Defaults to 2 if unset. | ||
| format: int32 | ||
| type: integer | ||
| machineConfigPoolSelector: | ||
| description: |- | ||
| machineConfigPoolSelector selects which pools the KubeletConfig shoud apply to. | ||
| A nil selector will result in no pools being selected. | ||
| machineConfigPoolSelector selects which pools the KubeletConfig should apply to. | ||
| A nil selector results in no pools being selected. | ||
| properties: | ||
| matchExpressions: | ||
| description: matchExpressions is a list of label selector requirements. | ||
|
|
@@ -109,9 +117,9 @@ spec: | |
| x-kubernetes-map-type: atomic | ||
| tlsSecurityProfile: | ||
| description: |- | ||
| If unset, the default is based on the apiservers.config.openshift.io/cluster resource. | ||
| Note that only Old and Intermediate profiles are currently supported, and | ||
| the maximum available minTLSVersion is VersionTLS12. | ||
| tlsSecurityProfile configures TLS settings for the kubelet. | ||
| If unset, defaults to the apiservers.config.openshift.io/cluster resource. | ||
| Only Old and Intermediate profiles are supported; maximum minTLSVersion is VersionTLS12. | ||
| properties: | ||
| custom: | ||
| description: |- | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on https://github.com/openshift/api/pull/2651/changes#diff-96f8b17cfbe8b29ea3c9111c566dd910b5d5bf9095c87564f3fda5831c02eb35R67, shouldn't the expected log level be 2?