Bug 1357825 - [infrastructure_public_287]eviction-hard/soft parameters should not accept negative values
Summary: [infrastructure_public_287]eviction-hard/soft parameters should not accept ne...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 3.3.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Avesh Agarwal
QA Contact: DeShuai Ma
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-07-19 10:23 UTC by DeShuai Ma
Modified: 2020-09-20 12:14 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Previously it was possible to configure resource (CPU, memory) eviction thresholds (hard and soft) to a negative value and kubelet started successfully. As eviction thresholds can not be negative, this erroneous behavior has been fixed now. The result is that kubelet fails to start if a negative eviction threshold is configured.
Clone Of:
Environment:
Last Closed: 2017-01-18 12:51:25 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 0 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 17:23:26 UTC

Description DeShuai Ma 2016-07-19 10:23:17 UTC
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:

Comment 1 Avesh Agarwal 2016-07-26 14:46:48 UTC
I have reproduced it and will send a PR soon upstream.

Comment 2 Avesh Agarwal 2016-07-26 15:00:57 UTC
https://github.com/kubernetes/kubernetes/pull/29618

Comment 3 Avesh Agarwal 2016-08-08 13:52:29 UTC
The PR https://github.com/kubernetes/kubernetes/pull/29618 is merged in kube upstream. I will create a cherry-pick PR to origin.

Comment 4 Avesh Agarwal 2016-08-08 18:00:20 UTC
Cherry pick PR: https://github.com/openshift/origin/pull/10281

Comment 5 Avesh Agarwal 2016-09-22 18:46:52 UTC
I noticed that the changes are already in ose repo, so moving it to ON_QA.

Comment 6 Troy Dawson 2016-09-22 18:55:58 UTC
Code has been merged into ose and is in version 3.3.0.31 or newer.

Comment 8 DeShuai Ma 2016-09-23 05:58:48 UTC
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?

Comment 9 Avesh Agarwal 2016-09-23 11:54:42 UTC
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.

Comment 11 Derek Carr 2016-10-25 20:21:33 UTC
This is in 3.4, moved to ON_QA and updated target release.

Comment 12 DeShuai Ma 2016-10-27 06:16:10 UTC
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

Comment 14 errata-xmlrpc 2017-01-18 12:51:25 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, 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


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