Commit Graph

47 Commits (3bd1824ed641805ceba817a32ec6582131aa0c75)

Author SHA1 Message Date
David Ashpole 93b6d026d9 fix memcg fd leak 2018-06-11 11:37:50 -07:00
David Ashpole db99c20a9a cleanup eviction events 2018-05-04 11:02:25 -07:00
David Ashpole 39d9fa60e8 refresh eviction interval periodically 2018-03-06 15:14:05 -08:00
David Ashpole 960856f4e8 collect metrics on the /kubepods cgroup on-demand 2018-02-17 12:32:40 -08:00
Michael Taufen 21dbbe14f2 Ignore 0% and 100% eviction thresholds
Primarily, this gives a way to explicitly disable eviction, which is
necessary to use omitempty on EvictionHard.
See: https://github.com/kubernetes/kubernetes/pull/53833#discussion_r166672137

As justification for this approach, neither 0% nor 100% make sense as
eviction thresholds; in the "less-than" case, you can't have less than
0% of a resource and 100% perpetually evicts; in the
"greater-than" case (assuming we ever add a resource with this
semantic), the reasoning is the reverse (not more than 100%, 0%
perpetually evicts).
2018-02-12 14:13:00 -08:00
Lantao Liu 91cbf93b90 Remove unnecessary summary api call.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-02-08 22:57:30 +00:00
linweibin fa8afc1d39 Remove unused code in UT files in pkg/ 2018-01-15 16:02:35 +08:00
David Ashpole f6721480f4 enable on-demand metrics for eviction 2018-01-08 10:20:02 -08:00
xiangpengzhao 1f2262e6b0 Move some kubelet constants to a common place. 2017-12-01 11:24:04 +08:00
David Ashpole 8b3bd5ae60 take disk requests into account during evictions 2017-11-21 10:21:30 -08:00
David Ashpole 527611ee41 remove disk allocatable evictions 2017-11-18 10:34:59 -08:00
Michael Taufen 1085b6f730 Lift embedded structure out of eviction-related KubeletConfiguration fields
- Changes the following KubeletConfiguration fields from `string` to
`map[string]string`:
  - `EvictionHard`
  - `EvictionSoft`
  - `EvictionSoftGracePeriod`
  - `EvictionMinimumReclaim`
- Adds flag parsing shims to maintain Kubelet's public flags API, while
enabling structured input in the file API.
- Also removes `kubeletconfig.ConfigurationMap`, which was an ad-hoc flag
parsing shim living in the kubeletconfig API group, and replaces it
with the `MapStringString` shim introduced in this PR. Flag parsing
shims belong in a common place, not in the kubeletconfig API.
I manually audited these to ensure that this wouldn't cause errors
parsing the command line for syntax that would have previously been
error free (`kubeletconfig.ConfigurationMap` was unique in that it
allowed keys to be provided on the CLI without values. I believe this was
done in `flags.ConfigurationMap` to facilitate the `--node-labels` flag,
which rightfully accepts value-free keys, and that this shim was then
just copied to `kubeletconfig`). Fortunately, the affected fields
(`ExperimentalQOSReserved`, `SystemReserved`, and `KubeReserved`) expect
non-empty strings in the values of the map, and as a result passing the
empty string is already an error. Thus requiring keys shouldn't break
anyone's scripts.
- Updates code and tests accordingly.

Regarding eviction operators, directionality is already implicit in the
signal type (for a given signal, the decision to evict will be made when
crossing the threshold from either above or below, never both). There is
no need to expose an operator, such as `<`, in the API. By changing
`EvictionHard` and `EvictionSoft` to `map[string]string`, this PR
simplifies the experience of working with these fields via the
`KubeletConfiguration` type. Again, flags stay the same.

Other things:
- There is another flag parsing shim, `flags.ConfigurationMap`, from the
shared flag utility. The `NodeLabels` field still uses
`flags.ConfigurationMap`. This PR moves the allocation of the
`map[string]string` for the `NodeLabels` field from
`AddKubeletConfigFlags` to the defaulter for the external
`KubeletConfiguration` type. Flags are layered on top of an internal
object that has undergone conversion from a defaulted external object,
which means that previously the mere registration of flags would have
overwritten any previously-defined defaults for `NodeLabels` (fortunately
there were none).
2017-11-16 18:35:13 -08:00
Dr. Stefan Schimanski 012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
David Ashpole 539fddb49d kubelet evictions take priority into account 2017-10-12 13:15:05 -07:00
Jing Xu 8f98230f20 Map a resource to multiple signals in eviction manager
It is possible to have multiple signals that point to the same type of
resource, e.g., both SignalNodeFsAvailable and
SignalAllocatableNodeFsAvailable refer to the same resource NodeFs.
Change the map from map[v1.ResourceName]evictionapi.Signal to
map[v1.ResourceName][]evictionapi.Signal
2017-09-01 12:54:37 -07:00
Kubernetes Submit Queue 7f1d9382ec Merge pull request #48846 from dashpole/remove_ood
Automatic merge from submit-queue

Remove flags low-diskspace-threshold-mb and outofdisk-transition-frequency

issue: #48843

This removes two flags replaced by the eviction manager.  These have been depreciated for two releases, which I believe correctly follows the kubernetes depreciation guidelines.

```release-note
Remove depreciated flags: --low-diskspace-threshold-mb and --outofdisk-transition-frequency, which are replaced by --eviction-hard
```

cc @mtaufen since I am changing kubelet flags
cc @vishh @derekwaynecarr 
/sig node
2017-07-24 23:05:50 -07:00
David Ashpole 7a23f8b018 remove deprecated flags LowDiskSpaceThresholdMB and OutOfDiskTransitionFrequency 2017-07-20 13:23:13 -07:00
Jing Xu bb1920edcc Fix issues for local storage allocatable feature
This PR fixes the following issues:
1. Use ResourceStorageScratch instead of ResourceStorage API to represent
local storage capacity
2. In eviction manager, use container manager instead of node provider
(kubelet) to retrieve the node capacity and reserved resources. Node
provider (kubelet) has a feature gate so that storagescratch information
may not be exposed if feature gate is not set. On the other hand,
container manager has all the capacity and allocatable resource
information.
2017-07-13 12:06:19 -07:00
Chao Xu 60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
Jing Xu 943fc53bf7 Add predicates check for local storage request
This PR adds the check for local storage request when admitting pods. If
the local storage request exceeds the available resource, pod will be
rejected.
2017-06-01 15:57:50 -07:00
Michael Taufen cbad320205 Reorganize kubelet tree so apis can be independently versioned 2017-05-12 10:02:33 -07:00
David Ashpole ac612eab8e eviction manager changes for allocatable 2017-03-02 07:36:24 -08:00
Vishnu Kannan cc5f5474d5 add support for node allocatable phase 2 to kubelet
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2017-02-27 21:24:44 -08:00
Dr. Stefan Schimanski bc6fdd925d pkg/api/resource: move to apimachinery 2017-01-29 21:41:44 +01:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Chao Xu 5e1adf91df cmd/kubelet 2016-11-23 15:53:09 -08:00
David Ashpole b8fc546d60 eviction manager ecivts pod using the most inodes. 2016-10-31 11:32:49 -07:00
Kubernetes Submit Queue 6a9d56b35a Merge pull request #32724 from sjenning/eviction-timestamp
Automatic merge from submit-queue

kubelet: eviction: avoid duplicate action on stale stats

Currently, the eviction code can be overly aggressive when synchronize() is called two (or more) times before a particular stat has been recollected by cadvisor.  The eviction manager will take additional  action based on information for which it has already taken actions.

This PR provides a method for the eviction manager to track the timestamp of the last obversation and not take action if the stat has not been updated since the last time synchronize() was run.

@derekwaynecarr @vishh @kubernetes/rh-cluster-infra
2016-10-06 11:05:34 -07:00
Seth Jennings 98e97a475a kubelet: eviction: avoid duplicate action on stale stats 2016-10-06 11:39:05 -05:00
Seth Jennings f52dce9319 kubelet: eviction: allow minreclaim as percentage 2016-09-30 11:12:36 -05:00
derekwaynecarr a65a24a850 kubelet eviction on inode exhaustion 2016-08-17 16:57:44 -04:00
bindata-mockuser d2dd03aecc Support percentage representation for eviction thresholds 2016-08-11 14:10:25 -07:00
derekwaynecarr 68bc47ecc6 Add support to invoke image gc in response to disk eviction thresholds 2016-08-04 17:13:08 -04:00
derekwaynecarr 611c127f0d kubelet eviction manager support for min-reclaim 2016-08-04 11:17:44 -04:00
derekwaynecarr 0de1e62b30 modify fsStats to fsStatsType to avoid confusion with cadvisor types 2016-07-28 16:01:38 -04:00
derekwaynecarr c3324b88a0 Eviction manager observes and acts on disk pressure 2016-07-28 16:01:38 -04:00
Avesh Agarwal cb7766de19 Fix kubelet to not accept negative eviction (hard, soft) thresholds
and add unit tests
2016-07-27 10:56:31 -04:00
derekwaynecarr 2f4a4ea4cf Kubelet parses and validates eviction-minimum-reclaim flag 2016-07-21 16:46:12 -04:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Buddha Prakash c3551ae6cd Refactor qos package
Signed-off-by: Buddha Prakash <buddhap@google.com>
2016-06-24 15:36:04 -07:00
Clayton Coleman e3c8c4c22b
Handle resource.Quantity changes in eviction thresholds 2016-05-19 08:41:43 -04:00
derekwaynecarr edc76f6d4f out of resource killing (memory) 2016-05-14 11:34:45 -04:00
derekwaynecarr 725af223aa Add parsers for eviction thresholds 2016-05-06 12:06:03 -04:00