Bug 1923874

Summary: Unable to specify values with % in kubeletconfig
Product: OpenShift Container Platform Reporter: Harshal Patil <harpatil>
Component: NodeAssignee: Harshal Patil <harpatil>
Node sub component: Kubelet QA Contact: MinLi <minmli>
Status: CLOSED ERRATA Docs Contact:
Severity: high    
Priority: high CC: aos-bugs
Version: 4.7   
Target Milestone: ---   
Target Release: 4.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-24 15:57:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1915235    

Description Harshal Patil 2021-02-02 06:30:27 UTC
Description of problem:
https://github.com/openshift/machine-config-operator/pull/2314 introduced a regression which is not allowing values ending with % sign in the kubeletconfig

Comment 1 Harshal Patil 2021-02-02 06:32:46 UTC
Validation if kubeletconfig fields is no longer going to be supported going forward, https://github.com/openshift/machine-config-operator/issues/2357

Hence, instead of fixing it for parsing for percentage (and other things), we will just revert that PR.

Comment 4 MinLi 2021-02-03 09:02:48 UTC
Hi, Harshal Patil
I'd like to confirm I get your point, we just need to validate positive percentage value is acceptable by kubeletconfig.

Comment 5 Harshal Patil 2021-02-03 09:18:32 UTC
We will not support any validation in kubeletconfig (however I didn't remove the validation code that already exists). That's the reason I added a warning in CRD to let users know that validation will not be duplicated in MCO that already exists in upstream, https://github.com/openshift/machine-config-operator/pull/2358

Comment 6 MinLi 2021-02-03 10:45:07 UTC
@Harshal Patil, got you, yet I found the existing validation didn't work as expected. 
At least, percentage value should be allowed, for our doc introduce we can use value with % in kubeletconfig, FYI:https://docs.openshift.com/container-platform/4.6/nodes/nodes/nodes-nodes-garbage-collection.html#nodes-nodes-garbage-collection-configuring_nodes-nodes-configuring


$ oc get clusterversion 
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.7.0-0.nightly-2021-02-02-223803   True        False         4h33m   Cluster version is 4.7.0-0.nightly-2021-02-02-223803

spec:
  kubeletConfig:
    evictionPressureTransitionPeriod: 0s
    evictionSoft:
      memory.available: 20Gi
      nodefs.available: 6%
      nodefs.inodesFree: 5%
    evictionSoftGracePeriod:
      memory.available: 1h
      nodefs.available: 1h
      nodefs.inodesFree: 1h
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: small-pods
status:
  conditions:
  - lastTransitionTime: "2021-02-03T10:31:56Z"
    message: 'Error: KubeletConfiguration: invalid value specified for nodefs.available
      reservation in evictionSoft, 6%'
    status: "False"
    type: Failure

Comment 10 MinLi 2021-02-07 07:52:49 UTC
verified on version : 4.7.0-0.nightly-2021-02-06-084550

spec:
  kubeletConfig:
    evictionHard:
      imagefs.available: 20Gi
      imagefs.inodesFree: 5%
      memory.available: 200Mi
      nodefs.available: 5%
      nodefs.inodesFree: 4%
    evictionPressureTransitionPeriod: 5s
    imageGCHighThresholdPercent: 80
    imageGCLowThresholdPercent: 75
    imageMinimumGCAge: 5m
    maxPods: 240
    podsPerCore: 80
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: small-pods
status:
  conditions:
  - lastTransitionTime: "2021-02-07T07:15:17Z"
    message: Success
    status: "True"
    type: Success


So the previous fixes which are related with kubeletconfig field validation are deprecated, such as https://bugzilla.redhat.com/show_bug.cgi?id=1745919 and https://bugzilla.redhat.com/show_bug.cgi?id=1805019

Comment 13 errata-xmlrpc 2021-02-24 15:57:46 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2020:5633