Commit Graph

714 Commits

Author SHA1 Message Date
Oleg Chunikhin
b651178849 fix incorrect configuration of kubepods.slice unit by kubelet (issue #88197) 2020-02-17 13:22:45 -05:00
Kubernetes Prow Robot
1a0f923a65
Merge pull request #87712 from alena1108/jan30kubelet
Ineffassign fixes for pkg/controller and kubelet
2020-02-14 14:29:27 -08:00
Takeaki Matsumoto
785fac6826 Make updateAllocatedDevices() as a public method and call it in
podresources api
2020-02-07 13:26:56 +09:00
Kevin Klues
d5addb4090 Cleanup logging and creation logic of TopologyManager in prep for beta 2020-02-03 17:13:29 +00:00
Kevin Klues
bc686ea27b Update TopologyManager.GetTopologyHints() to take pointers
Previously, this function was taking full Pod and Container objects
unnecessarily. This commit updates this so that they will take pointers
instead.
2020-02-03 17:13:28 +00:00
Kevin Klues
adaa58b6cb Update TopologyManager.Policy.Merge() to return a simple bool
Previously, the verious Merge() policies of the TopologyManager all
eturned their own lifecycle.PodAdmitResult result. However, for
consistency in any failed admits, this is better handled in the
top-level Topology manager, with each policy only returning a boolean
about whether or not they would like to admit the pod or not. This
commit changes the semantics to match this logic.
2020-02-03 17:13:28 +00:00
Kevin Klues
95a3ac447f Fix bug in TopologManager RemoveContainer()
Previously, we unconditionally removed *all* topology hints from a pod
whenever just one container was being removed. This commit makes it so
we only remove the hints for the single container being removed, and
then conditionally remove the pod from the podTopologyHints[podUID] when
no containers left in it.
2020-02-03 17:13:14 +00:00
Alena Prokharchyk
6c3093f970 Ineffassign fixes for pkg/controller and kubelet 2020-01-30 14:35:10 -08:00
sewon.oh
463442aa29
Update container hugepage limit when creating the container
Unit test for updating container hugepage limit
Add warning message about ignoring case.
Update error handling about hugepage size requirements

Signed-off-by: sewon.oh <sewon.oh@samsung.com>
2020-01-28 09:35:02 +09:00
Kubernetes Prow Robot
98f63eee1b
Merge pull request #87460 from nolancon/policies_refactor
Refactor Topology Manager policies to reduce code duplication
2020-01-24 21:11:15 -08:00
nolancon
4d76b1c8de Add mergeFilteredHints:
- Move remaining logic from mergeProvidersHints to generic top level
mergeFilteredHints function.
- Add numaNodes as parameter in order to make generic.
- Move single NUMA node specific check to single-numa-node Merge
function.
2020-01-22 09:07:41 +00:00
nolancon
fc300e0e7d Move filterSingleNumaHints call to top level Merge 2020-01-22 08:39:22 +00:00
nolancon
45660fd3a2 Add filterProvidersHints function:
- Move initial 'filtering' functionality to generic function
filterProvidersHints level policy.go.
- Call new function from top level Merge function.
- Rename some variables/parameters to reflect changes.
2020-01-22 08:35:28 +00:00
nolancon
df9b2595f3 Update filterHints to filterSingleNumaHints:
- Change function name
- Remove policy parameter (unnecessary)
- Update unit test to reflect change
2020-01-22 07:15:00 +00:00
Kubernetes Prow Robot
9822016bf8
Merge pull request #87397 from klueska/upstream-cpu-manager-set-initial-containers
Initialize CPUManager containerMap to set of initial containers
2020-01-20 17:39:50 -08:00
Kubernetes Prow Robot
e6b5194ec1
Merge pull request #84300 from klueska/upstream-cpu-manager-reconcile-on-container-state
Update logic in `CPUManager` `reconcileState()`
2020-01-20 12:27:37 -08:00
Kevin Klues
bd9d8fa42f Initialize CPUManager containerMap to set of initial containers
A recent change made it so that the CPUManager receives a list of
initial containers that exist on the system at startup. This list can be
non-empty, for example, after a kubelet retart.

This commit ensures that the CPUManagers containerMap structure is
initialized with the containers from this list.
2020-01-20 20:42:29 +01:00
Kubernetes Prow Robot
37ee6425ef
Merge pull request #87255 from klueska/upstream-remove-redundant-active-pods-check
Remove check for empty activePods list in CPUManager removeStaleState
2020-01-20 09:05:50 -08:00
Kubernetes Prow Robot
23fa359d6c
Merge pull request #84705 from whypro/cpumanager-panic-master
Return error instead of panic when cpu manager fails on startup.
2020-01-20 07:25:37 -08:00
Kevin Klues
7be9b0fe55 Update comments and error messages in the CPUManager 2020-01-20 15:31:01 +01:00
Kevin Klues
f2acbf6607 Base CPUManager state reconciliation on container state, not pod state 2020-01-20 13:57:30 +00:00
Kevin Klues
f6cf9b8ce9 Move CPUManager Pod Status logic before container loop 2020-01-20 13:57:30 +00:00
Kubernetes Prow Robot
50f9ea7999
Merge pull request #85798 from nolancon/merge-policy-rebase
Updated - topologymanager: Add Merge method to Policy
2020-01-17 05:14:56 -08:00
Kubernetes Prow Robot
9701baea0f
Merge pull request #87283 from klueska/update-printing-for-tm-bitmask
Update bitmask printing to print in groups of 2 instead of all 64 bits
2020-01-16 12:04:32 -08:00
Kevin Klues
708278098a Update bitmask printing to print in groups of 2 instead of all 64 bits 2020-01-16 17:28:52 +01:00
Kevin Klues
7069b1d6e8 Update TopologyManager single-numa-node logic to handle "don't cares"
The logic has been updated to match the logic of the best-effort policy
except in two places:

1) The hint filtering frunction has been updated to allow "don't care"
hints encoded with a `nil` affinity mask, to pass through the filter in
addition to hints that have just a single NUMA bit set.

2) After calculating the `bestHint` we transform "don't care" affinities
encoded as having all NUMA bits set in their affinity masks into "don't
care" affinities encoded as `nil`.
2020-01-16 08:50:35 +00:00
Kevin Klues
2905ffffa7 Rename TopologyManager test TestPolicyBestEffortMerge for consistency 2020-01-16 08:50:21 +00:00
Kevin Klues
94489c137c Cleanup use of defaultAffinity in mergePermutation of TopologyManager 2020-01-16 08:50:12 +00:00
nolancon
5e23517ebf Use reflect.DeepEqual check in policy_test.go 2020-01-16 08:13:07 +00:00
nolancon
92eb7cd601 Update "Single NUMA hint generation" expected affinity to nil 2020-01-16 08:13:07 +00:00
nolancon
8b3f6e61a2 Move test case "Two providers, 1 with 2 hints, 1 with single
non-preferred hint matching" into specific policy tests
2020-01-16 08:13:07 +00:00
nolancon
681c42bfc2 Move test case "Two providers, 1 hint each, same mask, 1 preferred, 1
not 2/2" into specific policy tests
2020-01-16 08:13:07 +00:00
nolancon
a38a2562b2 Move test case "Two providers, 1 hint each, same mask, 1 preferred, 1
not 1/2" into specific policy test.
2020-01-16 08:13:07 +00:00
nolancon
f639da7637 Move test case "Two providers, 1 hint each, no common mask" into
specific policy tests.
2020-01-16 08:13:07 +00:00
nolancon
401a2bb285 Move test case "Single TopologyHint with Preferred as false and
NUMANodeAffinity as nil" into specific policy tests.
2020-01-16 08:13:06 +00:00
nolancon
6460ef6392 Move test case "Single TopologyHint with Preferred as true and
NUMANodeAffinity as nil" into specific policy tests.
2020-01-16 08:13:06 +00:00
nolancon
baeff9ec5d Move test case "HintProvider returns empty non-nil map[string][]TopologyHint from
provider" into specific policy tests.
2020-01-16 08:13:06 +00:00
nolancon
599217d482 Move test case "HintProvider returns -nil map[string][]TopologyHint from provider" into specific policy tests 2020-01-16 08:13:06 +00:00
nolancon
57661ee946 Move test case 'HintProvider returns empty non-nil map[string][]TopologyHint' into specific policy tests. 2020-01-16 08:13:06 +00:00
nolancon
51f1af0395 Move test case 'TopologyHint not set' into individual policy tests 2020-01-16 08:13:06 +00:00
nolancon
8466a5852a Restore policy_test.go to upstream
Following commits will contain incremental changes to this file to ease
review process and ensure all tests are accounted for.
2020-01-16 08:13:06 +00:00
nolancon
59bb6c4d6f Update checks in mergeProvidersHints:
- Initialize best Hint to TopologyHint{}
- Update checks.
- Move generic unit test case into policy specific tests and updated
expected outcome to reflect changes.
2020-01-16 08:13:06 +00:00
nolancon
6758f95117 Restore original policy none test cases:
Mistakenly overwritten in earlier commit
2020-01-16 08:13:06 +00:00
nolancon
2d1a535a35 Make mergePermutation generic:
- Remove policy parameters to make function generic
- Move function into top level policy.go
2020-01-16 08:13:06 +00:00
nolancon
5487941485 Refactor filterHints:
- Restructure function
- Remove bug fix for catching {nil true} - To be fixed in later commit
- Restore unit tests to original state for testing filterHints
2020-01-16 08:13:06 +00:00
nolancon
adfd11f38f Make iterateAllProviderTopologyHints generic:
- Remove policy parameters to make this function generic.
- Move function out of individual policies and into policy.go
2020-01-16 08:13:06 +00:00
nolancon
e43f0a5293 Reinstate canAdmitPodResult in policy_none:
This is to keep consistency with the other policies.
This change may be made across all policies in a future PR, but removing it
from the scope of this PR for now.
2020-01-16 08:13:05 +00:00
nolancon
4cc5b9e46c Edit hints returned from policies and unit tests:
- Best Effort Policy: Return hint with nil affinity as opposed to
defaultAffinity when provider has no preference for NUMA affinty or no
possible NUMA affinities.
- Single NUMA Node Policy: Remove defaultHint from mergeProvidersHints.
Instead return appropriate TopologyHint where required.
- Update unit tests to reflect changes. Some test cases moved into
individual policy test functions due to differing returned affinties
per policy.
2020-01-16 08:13:05 +00:00
nolancon
e3d0c9397f Updates to single-numa-node policy:
- Remove getHintMatch method.
- Replace with simplified versions of mergePermutation and
iterateAllProviderTopologyHints methods - as used in best-effort.
- Remove getHintMatch unit tests.
2020-01-16 08:13:05 +00:00
nolancon
b5ca4989e3 Update unit tests:
- Update filterHints test to reflect changes in previous commit.
- Some common test cases achieve differing expected results based on
policy due to independent merge strategies. These cases are moved into
individual policy based test functions.
2020-01-16 08:13:05 +00:00