Bug 1811493 - Failed to create the KubeletConfig object
Summary: Failed to create the KubeletConfig object
Keywords:
Status: CLOSED DUPLICATE of bug 1811211
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.4.0
Assignee: Ryan Phillips
QA Contact: Sunil Choudhary
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-03-09 03:49 UTC by Jian Zhang
Modified: 2020-03-09 13:34 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-03-09 13:34:36 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jian Zhang 2020-03-09 03:49:35 UTC
Description of problem:
Got the below errors when creating the KubeletConfig object:
mac:~ jianzhang$ oc create -f pod_evication.yaml 
The KubeletConfig "worker-kubeconfig" is invalid: 
* spec.kubeletConfig.apiVersion: Required value: must not be empty
* spec.kubeletConfig.kind: Required value: must not be empty

Version-Release number of selected component (if applicable):
Cluster version is 4.4.0-0.nightly-2020-03-08-235004

How reproducible:
always

Steps to Reproduce:
1. Create a KubeleteConfig object by following https://docs.openshift.com/container-platform/4.3/nodes/nodes/nodes-nodes-garbage-collection.html#nodes-nodes-garbage-collection-configuring_nodes-nodes-configuring

mac:~ jianzhang$ oc label machineconfigpool worker custom-kubelet=small-pods
machineconfigpool.machineconfiguration.openshift.io/worker labeled
mac:~ jianzhang$ cat pod_evication.yaml 
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
  name: worker-kubeconfig 
spec:
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: small-pods 
  kubeletConfig:
    evictionSoft:
      memory.available: "90%"
      nodefs.available: "90%"
      nodefs.inodesFree: "90%"
    evictionPressureTransitionPeriod: 0s 


Actual results:
Got the below errors:
mac:~ jianzhang$ oc create -f pod_evication.yaml 
The KubeletConfig "worker-kubeconfig" is invalid: 
* spec.kubeletConfig.apiVersion: Required value: must not be empty
* spec.kubeletConfig.kind: Required value: must not be empty

Expected results:
The KubeletConfig object can be created successfully.

Additional info:
It did work well in 4.4.0-0.nightly-2020-03-04-012453.
mac:~ jianzhang$ oc create -f pod_evication.yaml 
kubeletconfig.machineconfiguration.openshift.io/worker-kubeconfig created
mac:~ jianzhang$ oc get clusterversion
NAME      VERSION                             AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.4.0-0.nightly-2020-03-04-012453   True        False         58m     Cluster version is 4.4.0-0.nightly-2020-03-04-012453

Comment 1 Jian Zhang 2020-03-09 03:56:05 UTC
Workaround: add the apiVersion/Kind in it:

mac:~ jianzhang$ cat pod_evication.yaml 
apiVersion: machineconfiguration.openshift.io/v1
kind: KubeletConfig
metadata:
  name: worker-kubeconfig 
spec:
  machineConfigPoolSelector:
    matchLabels:
      custom-kubelet: small-pods 
  kubeletConfig:
    apiVersion: machineconfiguration.openshift.io/v1
    kind: KubeletConfig
    evictionSoft:
      memory.available: "90%"
      nodefs.available: "90%"
      nodefs.inodesFree: "90%"
    evictionPressureTransitionPeriod: 0s 

mac:~ jianzhang$ oc create -f pod_evication.yaml 
kubeletconfig.machineconfiguration.openshift.io/worker-kubeconfig created

mac:~ jianzhang$ oc get machineconfigpool
NAME     CONFIG                                             UPDATED   UPDATING   DEGRADED   MACHINECOUNT   READYMACHINECOUNT   UPDATEDMACHINECOUNT   DEGRADEDMACHINECOUNT   AGE
master   rendered-master-e3490b51f062c3a94b508209b44089f6   True      False      False      3              3                   3                     0                      94m
worker   rendered-worker-9bf0b68b8e317cb5aaccf7b61b2d13f5   False     True       False      3              0                   0                     0                      94m
mac:~ jianzhang$ oc get nodes
NAME                                         STATUS                        ROLES    AGE   VERSION
ip-10-0-131-77.us-east-2.compute.internal    Ready                         worker   88m   v1.17.1
ip-10-0-133-75.us-east-2.compute.internal    Ready                         master   95m   v1.17.1
ip-10-0-146-18.us-east-2.compute.internal    Ready                         master   96m   v1.17.1
ip-10-0-153-230.us-east-2.compute.internal   NotReady,SchedulingDisabled   worker   90m   v1.17.1
ip-10-0-168-220.us-east-2.compute.internal   Ready                         worker   88m   v1.17.1
ip-10-0-173-167.us-east-2.compute.internal   Ready                         master   96m   v1.17.1

Comment 2 Ryan Phillips 2020-03-09 13:34:36 UTC

*** This bug has been marked as a duplicate of bug 1811211 ***


Note You need to log in before you can comment on or make changes to this bug.