Description of problem: When config eviction-hard/soft parameters with negative values, kubelet still can start successfully. Version-Release number of selected component (if applicable): [root@ip-172-18-4-118 log]# openshift version openshift v3.3.0.7 kubernetes v1.3.0+57fb9ac etcd 2.3.0+git How reproducible: Always Steps to Reproduce: 1.Configure node with negative eviction-hard or eviction-soft value and restart atomic-openshift-node kubeletArguments: eviction-hard: - "memory.available<-100Mi" or kubeletArguments: eviction-soft: - "memory.available<-300Mi" eviction-soft-grace-period: - "memory.available=30s" $ systemctl restart atomic-openshift-node Actual results: 1. restart node successfully Expected results: 1. eviction-hard/soft parameters should not accept negative values Additional info:
I have reproduced it and will send a PR soon upstream.
https://github.com/kubernetes/kubernetes/pull/29618
The PR https://github.com/kubernetes/kubernetes/pull/29618 is merged in kube upstream. I will create a cherry-pick PR to origin.
Cherry pick PR: https://github.com/openshift/origin/pull/10281
I noticed that the changes are already in ose repo, so moving it to ON_QA.
Code has been merged into ose and is in version 3.3.0.31 or newer.
Test on atomic-openshift-3.3.0.32-1.git.0.37bd7ea.el7.x86_64 This is not fixed. I review the change code, it's in v3.4.0.1 https://github.com/openshift/ose/blob/v3.4.0.1/vendor/k8s.io/kubernetes/pkg/kubelet/eviction/helpers.go#L203-L205 But not in ose 3.3.0.x Fix this in 3.4?
Hi DeShuai, I think I messed it up. Yesterday I saw the changes in the https://github.com/openshift/ose in the master repo not really checking the actual version and then claimed that it is fixed in OSE. Others (Eric Paris) concluded it as fixed in 3.3.
This is in 3.4, moved to ON_QA and updated target release.
Verify on openshift v3.4.0.16+cc70b72 Start node with invalid value for eviction: Oct 27 02:12:05 ip-172-18-5-208.ec2.internal atomic-openshift-node[42133]: I1027 02:12:05.680509 42133 reflector.go:200] Starting reflector *api.Pod (0s) from pkg/kubelet/config/apiserver.go:43 Oct 27 02:12:05 ip-172-18-5-208.ec2.internal atomic-openshift-node[42133]: F1027 02:12:05.680567 42133 node.go:322] failed to run Kubelet: failed to create kubelet: eviction threshold memory.available must be positive: -100Mi Oct 27 02:14:39 ip-172-18-5-208.ec2.internal atomic-openshift-node[44353]: I1027 02:14:39.708205 44353 reflector.go:200] Starting reflector *api.Pod (0s) from pkg/kubelet/config/apiserver.go:43 Oct 27 02:14:39 ip-172-18-5-208.ec2.internal atomic-openshift-node[44353]: F1027 02:14:39.708289 44353 node.go:322] failed to run Kubelet: failed to create kubelet: eviction threshold memory.available must be positive: -300Mi
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, 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/RHBA-2017:0066