Commit Graph

8604 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
d09f8b9d54
Merge pull request #79409 from takmatsu/add-phase
Modify Kubelet Pod Resources API to get only active pods
2020-02-08 16:09:52 -08:00
Mike Danese
bfc75d9a5c manual fixes 2020-02-08 12:32:33 -05:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Kubernetes Prow Robot
dde6e8e746 Merge pull request #87858 from smarterclayton/different_type
kubelet: Debug pod status output diff is wrong
2020-02-08 06:44:06 -08:00
Kubernetes Prow Robot
334d788f08 Merge pull request #87299 from mikedanese/ctx
context in client-go
2020-02-08 06:43:52 -08:00
Kubernetes Prow Robot
b3ba969756 Merge pull request #87913 from cheftako/master
Add code to fix kubelet/metrics memory issue.
2020-02-07 21:51:53 -08:00
Mike Danese
2637772298 some manual fixes 2020-02-07 18:17:40 -08:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
Kubernetes Prow Robot
d8b325b534
Merge pull request #85856 from adelina-t/cpu_requests_fix_ctrd
Fix Cpu Requests priority Windows.
2020-02-07 15:19:58 -08:00
Walter Fender
9802bfcec0 Add code to fix kubelet/metrics memory issue.
Bucketing url paths based on concept/handling.
Bucketing code placed by handling code to encourage usage.
Added unit tests.
Fix format.
2020-02-07 15:12:24 -08:00
James DeFelice
6f8dfdfb0e Fix docker/journald logging conformance
See issue #86367
2020-02-07 16:04:27 -06:00
Kubernetes Prow Robot
8af70aeafc
Merge pull request #87390 from mattjmcnaughton/mattjmcnaughton/refactor-docker-specific-oom-out-of-qos-pkg
Refactor docker specific oom const out of qos pkg
2020-02-07 12:31:48 -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
Kubernetes Prow Robot
3dc3c7c653
Merge pull request #87788 from ahg-g/ahg-filter
Reduce overhead of error message formatting and allocation for NodeResource filter
2020-02-06 17:46:50 -08:00
Kubernetes Prow Robot
6ac8f2c70c
Merge pull request #87758 from klueska/upstream-cleanup-topology-manager
Cleanup TopologyManager and update policy.Merge()
2020-02-06 17:46:27 -08:00
Alena Prokharchyk
d634ed3850 Removed unnecessary not nil check in node registration process 2020-02-06 15:49:15 -08:00
marosset
999fdfaddf Calling hcsshim instead of docker api to get stats for windows to greatly reduce latency 2020-02-06 17:59:10 +00:00
Clayton Coleman
aed4d639a5
kubelet: Debug pod status output diff is wrong
The types were different so the diff output is not useful, both
should be pointers:

```
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: I0205 19:44:40.222259    2737 status_manager.go:642] Pod status is inconsistent with cached status for pod "prometheus-k8s-1_openshift-monitoring(0e9137b8-3bd2-4353-b7f5-672749106dc1)", a reconciliation should be triggered:
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]:    interface{}(
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: -         s"&PodStatus{Phase:Running,Conditions:[]PodCondition{PodCondition{Type:Initialized,Status:True,LastProbeTime:0001-01-01 00:00:00 +0000 UTC,LastTransitionTime:2020-02-05 19:13:30 +0000 UTC,Reason:,Message:,},PodCondit>
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: +         v1.PodStatus{
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: +                 Phase: "Running",
Feb 05 19:44:40 ci-ln-6k7l4-w-c-w9wbb.c.openshift-gce-devel-ci.internal hyperkube[2737]: +                 Conditions: []v1.PodCondition{
```
2020-02-05 14:52:46 -05:00
Kubernetes Prow Robot
d90dd93855
Merge pull request #82111 from xieyanker/xieyanker-patch-2
remove stateCheckPeriod
2020-02-05 04:17:55 -08:00
Abdullah Gharaibeh
0a476eb7d4 reduce overhead of error message formatting and allocation for scheudler NodeResource filter 2020-02-04 11:02:29 -05: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
Kubernetes Prow Robot
7e5bfe4417
Merge pull request #85472 from dcbw/kubelet-network-approvers
kubelet/network: add sig-network-approvers to OWNERS
2020-02-01 12:55:19 -08:00
wojtekt
b11b7d354d WatchBasedManager stops watching immutable objects 2020-01-31 20:53:21 +01:00
Kubernetes Prow Robot
1baceba376
Merge pull request #87394 from mattjmcnaughton/mattjmcnaughton/delete-sysctl-runtime-admit-handler
Delete the sysctl runtime admit handler
2020-01-30 21:20:45 -08:00
Alena Prokharchyk
6c3093f970 Ineffassign fixes for pkg/controller and kubelet 2020-01-30 14:35:10 -08:00
Lee Verberne
d05bcf6800 Add namespace mode targeting to dockershim 2020-01-30 15:31:43 +01:00
Lee Verberne
4d4e111f01 Generated code for kubelet namespace targeting 2020-01-30 15:31:43 +01:00
Lee Verberne
9a6d50cb2a Add namespace targeting to the kubelet 2020-01-30 15:31:43 +01:00
Kubernetes Prow Robot
7164152844
Merge pull request #87664 from liggitt/revert-parallel-volume
Revert "Merge pull request #87258 from verult/slow-rxm-attach"
2020-01-29 22:12:01 -08:00
Kubernetes Prow Robot
ec3fc59f1b
Merge pull request #87627 from tallclair/rc-metrics
Register RunPodSandbox* metrics
2020-01-29 22:11:25 -08:00
Jordan Liggitt
cd1059e3c4 Revert "Merge pull request #87258 from verult/slow-rxm-attach"
This reverts commit 15c3f1b119, reversing
changes made to 52d7614a8c.
2020-01-29 14:58:32 -05:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
Kubernetes Prow Robot
649391af22
Merge pull request #84154 from ohsewon/hugepage_per_container
Implement support for setting hugepages limit on container cgroup sandbox.
2020-01-29 07:32:14 -08:00
Tim Allclair
43c7f3be29 Register RunPodSandbox* metrics 2020-01-28 13:26:11 -08:00
Kubernetes Prow Robot
15c3f1b119
Merge pull request #87258 from verult/slow-rxm-attach
Parallelize attach operations across different nodes for volumes that allow multi-attach
2020-01-28 08:33:41 -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
Cheng Xing
c6a03fa5be Parallelize attach operations across different nodes for volumes that allow multi-attach 2020-01-27 15:02:25 -08:00
Jiahui Feng
b2bb3dfb59 add logging before kubelet waiting for cert
during bootstrapping.
2020-01-27 10:12:36 -08: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
mattjmcnaughton
9e1c99c4e2
Delete the sysctl runtime admit handler
As of https://github.com/kubernetes/kubernetes/pull/72831, the minimum
docker version is 1.13.1. (and the minimum API version is 1.26). The
only time the `RuntimeAdmitHandler` returns anything other than accept
is when the Docker API version < 1.24. In other words, we can be
confident that Docker will always support sysctl.

As a result, we can delete this unnecessary and docker-specific code.
2020-01-22 08:51:39 -05: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
Wei Huang
3f8b202266
Move GeneralPredicates logic to kubelet. 2020-01-21 09:27:00 -08: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
mattjmcnaughton
73b2d83125
Refactor docker specific oom const out of qos pkg
Previously, `pkg/kubelet/qos` contained two different docker-specific
OOM constants. One set the oom adj for sandbox docker containers and the
other set the oom adj for the docker daemon. Move both to be closer to
their actual usages in `dockershim`.

This change addresses a TODO and leads us towards the overall goal of
making `pkg/kubelet` runtime agnostic except for `dockershim`.
2020-01-20 10:22:31 -05: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
Davanum Srinivas
b3853138a4
update generated files 2020-01-17 11:23:53 -05: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
nolancon
17d615bca2 Update filterHints:
- Only append valid preferred-true hints to filtered
- Return true if allResourceHints only consist of
nil-affinity/preferred-true hints: {nil true}, update defaultHint
preference accordingly.
2020-01-16 08:13:05 +00:00
Adrian Chiris
9f21f49493 Additional unit tests for Topology Manager methods 2020-01-16 08:13:05 +00:00
Adrian Chiris
f886d2a832 Update single-numa-node policy unit tests 2020-01-16 08:13:05 +00:00
Adrian Chiris
2825a7be1a Add new functionality for single-numa-node policy:
Explanation taken from original commit:
- Change the current method of finding the best hint.
  Instead of going over all permutations, sort the hints and find
  the narrowest hint common to all resources.
- Break out early when merging to a preferred hint is not possible
2020-01-16 08:13:05 +00:00
Adrian Chiris
5ce2ea2773 Return defaultAffinity from PolicyBestEffort:
Now that PolicySingleNUMANode is not considered here, return
defaultAffinity as was the original case before previous bug fix
2020-01-16 08:13:05 +00:00
Adrian Chiris
eda1521562 Make mergeProviderHints policy-specific:
- Remove need to pass policy and numaNodes as arguments
- Remove PolicySingleNUMANode special case check in policy_best_effort
- Add mergeProviderHints base to policy_single_numa_node for upcoming
commit
2020-01-16 08:13:05 +00:00
Adrian Chiris
dc36924c37 Update policy_none removing canAdmitPodResult
Update unit tests for none_policy
Add Name test for policy_restricted
2020-01-16 08:13:05 +00:00
Adrian Chiris
cf8b098dda Refactor policy-best-effort
- Modularize code with mergePermutation method
2020-01-16 08:13:05 +00:00
Sascha Grunert
278717bc57
Fix ineffectual assignment to CPUSets
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-01-16 08:57:42 +01:00
Kevin Klues
34b942a41d Remove check for empty activePods list in CPUManager removeStaleState
This check is redundant since we protect this call with a call to
`m.sourcesReady.AllReady()` earlier on. Moreover, having this check in
place means that we will leave some stale state around in cases where
there are actually no active pods in the system and this loop hasn't
cleaned them up yet. This can happen, for example, if a pod exits while
the kubelet is down for some reason. We see this exact case being
triggered in our e2e tests, where a test has been failing since October
when this change was first introduced.
2020-01-15 20:09:24 +01:00
Kevin Klues
5802f3a910 Add proper activePods list in TestGetTopologyHints for CPUManager 2020-01-15 20:08:41 +01:00
Eric Ernst
cdd92d39b7 preemption: typo cleanup
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2020-01-15 10:55:40 -08:00
Kubernetes Prow Robot
208cc18c69
Merge pull request #86728 from mattjmcnaughton/mattjmcnaughton/add-test-coverage-oom-watcher
Add test coverage for oom watcher
2020-01-15 01:21:33 -08:00
Kubernetes Prow Robot
de34d2ce1e
Merge pull request #87193 from mattjmcnaughton/mattjmcnaughton/cleanup-rkt-code-in-pleg
Clean up rkt specific code in `pkg/kubelet/pleg`
2020-01-14 22:21:46 -08:00
mattjmcnaughton
9077603b97
Add richer unit tests for OomWatcher
Add unit tests for OomWatcher that actually test the logic defined in
the `Start` method. As a result of an earlier refactor, its now trivial
to mock the OOMInstance events which the `oom_watcher` is supposed to be
watching.
2020-01-14 07:57:06 -05:00
mattjmcnaughton
ab7e0f58d5
Clean up rkt specific code in pkg/kubelet/pleg
Clean up code in PLEG which was only necessary for the `rkt` runtime.

Rkt is no longer a built-in runtime and docker(shim) uses the CRI, so
its safe to remove this code entirely.

This diff removes the last mentions of `rkt` in the kubelet.
2020-01-14 07:42:30 -05:00
Kubernetes Prow Robot
be26fbc638
Merge pull request #86282 from RainbowMango/pr_refactor_resource_endpoint
Refactor kubelet resource metrics
2020-01-14 02:23:09 -08:00
Kubernetes Prow Robot
f4db8212be
Merge pull request #76496 from danielqsj/metrics-2
Clean deprecated metrics
2020-01-13 20:53:09 -08:00
Kubernetes Prow Robot
61d36e4a43
Merge pull request #85850 from danwinship/kubelet-ipv6-node-ip
Allow "kubelet --node-ip ::" to mean prefer IPv6
2020-01-13 17:41:08 -08:00
Kubernetes Prow Robot
8467561f2c
Merge pull request #86783 from mattjmcnaughton/mattjmcnaughton/remove-unnecessary-modification-container-pid-namespace
Remove no longer needed `modifyContainerPIDNamespaceOverrides`
2020-01-10 15:43:50 -08:00
Kubernetes Prow Robot
befc371364
Merge pull request #86702 from mattjmcnaughton/mattjmcnaughton/refactor-oom-watcher-to-allow-greater-test-coverage
Refactor oom watcher to allow greater test coverage
2020-01-10 15:43:37 -08:00
danielqsj
ab182552b4 clean SinceInMicroseconds, convert to SinceInSeconds 2020-01-10 17:05:38 +08:00
danielqsj
8ae3f80048 remove deprecated metrics of dockershim 2020-01-10 17:05:38 +08:00
danielqsj
1a9b121764 remove deprecated metrics of kubelet 2020-01-10 16:46:52 +08:00
Kubernetes Prow Robot
7a50fdb2a6
Merge pull request #85993 from chendotjs/fix-cidr
kubenet: replace gateway with cni result
2020-01-09 20:13:04 -08:00
Kubernetes Prow Robot
792fe793a1
Merge pull request #86946 from cchord/fix_typo
fix typo
2020-01-08 14:46:24 -08:00
Kubernetes Prow Robot
fd0358fd21
Merge pull request #86689 from klueska/upstream-fix-cpumanager-v1-state-checksum
Lock checksum calculation for v1 CPUManager state to pre 1.18 logic
2020-01-08 02:57:40 -08:00
Jiahao Zhu
680df17f39 fix typo 2020-01-08 15:48:58 +08:00
Kubernetes Prow Robot
8dca390262
Merge pull request #84927 from mattjmcnaughton/mattjmcnaughton/fix-kubelet-config-common
Fix golint failures for pkg/kubelet/config/...
2020-01-07 21:09:40 -08:00
mattjmcnaughton
8897c435ad
Refactor oom watcher to allow greater test coverage
This diff contains a strict refactor; there are no behavioral changes.

Address a long standing TODO in `oom_watcher_linux_test.go` around test
coverage. We refactor our `oom.Watcher` so it takes in a struct
fulfulling the `streamer` interface (i.e. defines `StreamOoms` method).
In production, we will continue to use the `oomparser` from `cadvisor`.
However, for testing purposes, we can now create our own `fakeStreamer`,
and control how it streams `oomparser.OomInstance`. With this fake, we
can implement richer unit testing for the `oom.Watcher` itself.

Actually adding the additional unit tests will come in a later commit.
2020-01-07 21:48:14 -05:00
Kubernetes Prow Robot
49e24adf3e
Merge pull request #86832 from mattjmcnaughton/mattjmcnaughton/remove-dead-code-in-fake-docker-client
Remove dead code in fake docker client
2020-01-07 07:36:18 -08:00
Dan Winship
ce68edf700 Allow "kubelet --node-ip ::" to mean prefer IPv6 2020-01-07 07:53:21 -05:00
Kubernetes Prow Robot
f3df7a2fdb
Merge pull request #86727 from mattjmcnaughton/mattjmcnaughton/remove-recorder-PastEventf
Remove `recorder.PastEventf` method
2020-01-07 04:38:49 -08:00
Kubernetes Prow Robot
dd5272b76f
Merge pull request #86575 from gongguan/nkubemark
kubemark use remote cri
2020-01-07 03:20:46 -08:00
Kubernetes Prow Robot
195e8e3ad9
Merge pull request #86844 from mattjmcnaughton/mattjmcnaughton/update-cadvisor-stats-provider-comment
Correct comment around which integrations require cadvisor_stats
2020-01-07 01:13:14 -08:00
Kubernetes Prow Robot
8b8f2aa4a5
Merge pull request #85431 from irbull/api-doc
Add public documentation for kubelet/apis/config
2020-01-06 23:12:18 -08:00
louisgong
324e5ce7e3 hollow-node use remote CRI 2020-01-07 11:00:45 +08:00
Kubernetes Prow Robot
59b4933fb8
Merge pull request #86724 from gongguan/fix-fake-CRI
fix fake remote CRI
2020-01-06 18:06:57 -08:00
Kubernetes Prow Robot
49bc696614
Merge pull request #86251 from bboreham/pleg-last-seen-metric
Kubelet: add a metric to observe time since PLEG last seen
2020-01-06 18:06:18 -08:00
Kubernetes Prow Robot
d6412b856f
Merge pull request #84345 from danielqsj/withdialer
replace grpc.WithDialer which is deprecated
2020-01-06 15:56:17 -08:00
Kubernetes Prow Robot
19ecd690fa
Merge pull request #86646 from yutedz/client-protocol
Require client / server protocols
2020-01-06 13:34:18 -08:00
Kubernetes Prow Robot
b112ad4f0b
Merge pull request #86845 from mattjmcnaughton/mattjmcnaughton/remove-rkt-from-runtime-options
Remove `rkt` from container runtime options
2020-01-06 11:12:29 -08:00
Kubernetes Prow Robot
9acf7d11fe
Merge pull request #86344 from klueska/upstream-cm-approver
Add klueska as an approver in pkg/kubelet/cm/OWNERS
2020-01-06 09:54:16 -08:00
Ted Yu
906adbdfcd Require client / server protocols 2020-01-06 08:50:04 -08:00
mattjmcnaughton
794d0d9b4d
Remove rkt from container runtime options
Part of efforts to clean up mentions of rkt in kubelet.

rkt was removed entirely in 1.11, in favor of using `rktlet` and CRI
instead. It should no longer be listed at all as a runtime.
2020-01-05 09:27:38 -05:00
mattjmcnaughton
06b44c76fd
Correct comment around which integrations require cadvisor_stats
This commit is part of a larger effort to clean up references to `rkt`
in the kubelet.

Previously, this comment hard-coded which integrations required
the cadvisor stats provider. The comment has grown stale
(i.e. referenced rkt and did not reference cri-o).

Update the comment to instead point to the code which determines which
integrations need the cadvisor stats provider.
2020-01-05 09:23:09 -05:00
mattjmcnaughton
f2cb1f35fe
Remove dead code in fake docker client
The `FakeDockerClient` had a number of methods defined on it which were
not being called anywhere. The majority were of the form `Assert...`.

In the spirit of removing dead code, remove the methods which aren't
being called.
2020-01-05 08:31:59 -05:00
louisgong
e8eb5c656b fix fake remote CRI 2020-01-04 08:43:17 +08:00
Aresforchina
2293b47346 add some comments for const variable 2020-01-03 23:28:21 +08:00
Bryan Boreham
cc0b3e82eb Kubelet: add a metric to observe time since PLEG last seen
Expose the measurement that kubelet uses to judge that "PLEG is
unhealthy". If we can observe the measurement growing then we can
alert before the node goes unhealthy.

Note that the existing metrics PLEGRelistInterval and
PLEGRelistDuration are poor for this, because when relist() gets
stuck they are never updated.

Signed-off-by: Bryan Boreham <bryan@weave.works>
2020-01-03 10:01:27 +00:00
mattjmcnaughton
d09fe8e247
Remove no longer needed modifyContainerPIDNamespaceOverrides
As of https://github.com/kubernetes/kubernetes/pull/72831/, the minimum
kubernetes version is now 1.13.1. As a result, this function becomes a
no-op. As the TODO indicates, we should delete it.
2020-01-02 09:09:02 -05:00
mattjmcnaughton
92940fa80d
Remove recorder.PastEventf method
The `recorder.PastEventf` method wasn't actually working as advertised.
It was supposed to accept a timestamp, which would be used when
generating the event. However, as the
[source code](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/client-go/tools/record/event.go#L316)
shows, this `timestamp` was never actually used.

In other words, `PastEventf` is identical to `Eventf`.

We have two options: one would be to fix `PastEventf` so that it works
as advertised. The other would be to delete `PastEventf` and only
support `Eventf`.

Ultimately, I could only find one use of `PastEventf` in the code base,
so I propose we just delete `PastEventf` and convert all uses to
`Eventf`.
2019-12-30 12:00:23 -05:00
Kevin Klues
b373121a14 Make CPUManagerCheckpointV2 type an alias of CPUManagerCheckpoint
This change is to prevent problems when we remove the V1->V2 migration
code in the future. Without this, the checksums of all checkpoints would
be hashed with the name CPUManagerCheckpointV2 embedded inside of them,
which is undesirable. We want the checkpoints to be hashed with the name
CPUManagerCheckpoint instead.
2019-12-28 19:29:13 +01:00
Kevin Klues
5faf8f4c52 Lock checksum calculation for v1 CPUManager state to pre 1.18 logic
The updated CPUManager from PR #84462 implements logic to migrate the
CPUManager checkpoint file from an old format to a new one. To do so, it
defines the following types:

```
type CPUManagerCheckpoint = CPUManagerCheckpointV2
type CPUManagerCheckpointV1 struct {  ...  }
type CPUManagerCheckpointV2 struct {  ...  }
```

This replaces the old definition of just:

```
type CPUManagerCheckpoint struct {  ...  }
```

Code was put in place to ensure proper migration from checkpoints in V1
format to checkpoints in V2 format. However (and this is a big however),
all of the unit tests were performed on V1 checkpoints that were
generated using the type name `CPUManagerCheckpointV1` and not the
original type name of `CPUManagerCheckpoint`. As such, the checksum in
the checkpoint file uses the `CPUManagerCheckpointV1` type to calculate
its checksum and not the original type name of `CPUManagerCheckpoint`.

This causes problems in the real world since all pre-1.18 checkpoint
files will have been generated with the original type name of
`CPUManagerCheckpoint`. When verifying the checksum of the checkpoint
file across an upgrade to 1.18, the checksum is calculated assuming
a type name of `CPUManagerCheckpointV1` (which is incorrect) and the
file is seen to be corrupt.

This patch ensures that all V1 checksums are verified against a type
name of `CPUManagerCheckpoint` instead of ``CPUManagerCheckpointV1`.
It also locks the algorithm used to calculate the checksum in place,
since it wil never change in the future (for pre-1.18 checkpoint
files at least).
2019-12-28 14:17:55 +01:00
danielqsj
19fe9f8d94 replace grpc.WithDialer which is deprecated 2019-12-26 17:46:59 +08:00
SataQiu
2497a1209b bump k8s.io/utils version 2019-12-21 14:54:44 +08:00
Kubernetes Prow Robot
03e90b80ce
Merge pull request #86167 from yiyang5055/change-CounterVec-to-Counter
change CounterVec to use Counter in the Kubelet's Pod Lifecycle Event…
2019-12-19 11:33:56 -08:00
whypro
f4bd4e2e96 Return error instead of panic when cpu manager starts failed. 2019-12-19 21:56:23 +08:00
chenyaqi01
c5002a348e kubenet: replace gateway with cni result 2019-12-19 18:32:25 +08:00
Jacek Kaniuk
4303be3d9f Revert pull request #85879 "hollow-node use remote CRI" 2019-12-19 10:52:35 +01:00
sshukun
12a5bdec00 Fix go-lint issues in package pkg/kubelet/checkpointmanager/testing/example_checkpoint_formats/v1 2019-12-19 12:53:33 +09:00
Kubernetes Prow Robot
814fc34cde
Merge pull request #85879 from gongguan/cri-kubemark
hollow-node use remote CRI
2019-12-18 06:01:57 -08:00
louisgong
e8e1cc9ee0 extract PreInitRuntimeService from NewMainKubelet 2019-12-18 11:48:29 +08:00
Kubernetes Prow Robot
40df9f82d0
Merge pull request #82492 from gnufied/fix-uncertain-mounts
Fix uncertain mounts
2019-12-17 14:49:57 -08:00
Kubernetes Prow Robot
a1fc96f41e
Merge pull request #84462 from klueska/upstream-cpu-manager-update-state-semantics
Update CPUManager stored state semantics
2019-12-17 12:00:12 -08:00
Kevin Klues
9818b4522e Add klueska as an approver in pkg/kubelet/cm/OWNERS 2019-12-17 10:40:23 +01:00
Kubernetes Prow Robot
0633e2cd34
Merge pull request #86303 from langyenan/misspell
fix misspelling in comment
2019-12-16 21:39:49 -08:00
Kubernetes Prow Robot
a931227952
Merge pull request #83504 from lyft/remove-all-terminated-containers
cri_stats_provider: do not consider exited containers when calculating cpu usage
2019-12-16 17:53:39 -08:00
Jordan Liggitt
a65d8aeb76 Add UID precondition to kubelet pod status patch updates 2019-12-16 14:27:32 -05:00
ianlang
c9418412d1 fix misspelling in comment 2019-12-16 17:27:08 +08:00
RainbowMango
c394d821fd Deal with auto-generated files:
- Update bazel by hack/update-bazel.sh
2019-12-16 10:27:02 +08:00
RainbowMango
ecf5f7d749 Deprecated metrics under /metrics/resource/v1alpha1 2019-12-16 10:27:02 +08:00
RainbowMango
0db7074e1a Add new endpoint for resource metrics. 2019-12-16 10:26:54 +08:00
Kubernetes Prow Robot
69410eca4b
Merge pull request #86256 from liggitt/testapi
Remove use of testapi package
2019-12-13 12:55:50 -08:00
Jordan Liggitt
5d5b444c4d Remove use of testapi codecs, selflink, resourcepath functions 2019-12-13 11:56:29 -05:00
Kubernetes Prow Robot
7e01fe12bf
Merge pull request #86228 from ahg-g/ahg-r1
Deprecate scheduler's FailureReason
2019-12-12 18:33:32 -08:00
Kubernetes Prow Robot
6db550d1db
Merge pull request #85789 from ZP-AlwaysWin/dev-1202
Remove unnecessary nil check in if statement in nodelease controller
2019-12-12 18:32:54 -08:00
Abdullah Gharaibeh
70a2bccfd6 deprecate scheduler's FailureReason 2019-12-12 18:54:52 -05:00
David Ashpole
fca84c02bb add dashpole as kubelet approver 2019-12-12 11:10:24 -08:00
Kubernetes Prow Robot
010291d4dc
Merge pull request #84951 from yutedz/status-mgr-sync-static
Sync the status of static Pods
2019-12-11 19:40:32 -08:00
Hemant Kumar
ca532c6fb2 Ensure that error is returned on NodePublish 2019-12-11 22:10:09 -05:00
Kevin Klues
f553286156 Pass initial set of runtime containers to the CPUManager at startup
These information associatedd with these containers is used to migrate
the CPUManager state from it's old format to its new (i.e. keyed off of
podUID and containerName instead of containerID).
2019-12-11 23:02:51 +01:00
Kevin Klues
6441e1ef43 Move CPUManager Checkpoint restoration to Start() instead of New() 2019-12-11 23:02:51 +01:00
Kevin Klues
69f8053850 Update top-level CPUManager to adhere to new state semantics
For now, we just pass 'nil' as the set of 'initialContainers' for
migrating from old state semantics to new ones. In a subsequent commit
will we pull this information from higher layers so that we can pass it
down at this stage properly.
2019-12-11 23:02:51 +01:00
Kevin Klues
185e790f71 Update CPUManager policies to adhere to new state semantics 2019-12-11 23:02:51 +01:00
Kevin Klues
7c760fea38 Change CPUManager state to key off of podUID and containerName
Previously, the state was keyed off of containerID intead of podUID and
containerName. Unfortunately, this is no longer possible as we move to a
to model where we we allocate CPUs to containers at pod adit time rather
than container start time.

This patch is the first step towards full migration to the new
semantics. Only the unit tests in cpumanager/state are passing. In
subsequent commits we will update the CPUManager itself to use these new
semantics.

This patch also includes code to do migration from the old checkpoint format
to the new one, assuming the existence of a ContainerMap with the proper
mapping of (containerID)->(podUID, containerName). A subsequent commit
will update code in higher layers to make sure that this ContainerMap is
made available to this state logic.
2019-12-11 23:02:51 +01:00
Kevin Klues
9191a949ae Extend makePod() helper in CPUManager to take PodUID and ContainerName 2019-12-11 23:02:51 +01:00
Kevin Klues
7a15d3a4d7 Fix bug in parsing int to string in CPUManager tests 2019-12-11 23:02:51 +01:00
Kevin Klues
765aae93f8 Move containerMap out of static policy and into top-level CPUManager 2019-12-11 23:02:51 +01:00
Kevin Klues
1d995c98ef Update CPUmanager containerMap to allow removal by containerRef 2019-12-11 23:02:47 +01:00
Kevin Klues
0639bd0942 Change CPUManager containerMap to key off of (podUID, containerName)
Previously it keyed off of a pointer to the actual pod / container,
which was unnecessary, and hard to work with (especially on the
retrieval side).
2019-12-11 23:02:11 +01:00
Kevin Klues
3881e50cce Update CPUmanager containerMap to also return a containerRef 2019-12-11 23:01:01 +01:00
Kevin Klues
347d5f57ac Move CPUManager ContainerMap to its own package 2019-12-11 22:59:00 +01:00
yiyang5055
0f410d625a change CounterVec to use Counter in the Kubelet's Pod Lifecycle Event Generator 2019-12-11 23:51:28 +08:00
Kubernetes Prow Robot
9ddbc90039
Merge pull request #84191 from langyenan/getTypedVersion
invoke getTypedVersion() instead of direct runtime call
2019-12-10 16:04:19 -08:00
Kubernetes Prow Robot
c7a65ca0c3
Merge pull request #85446 from RainbowMango/pr_remove_RawRegister
Remove the derprecated API RawRegister from stability framework
2019-12-10 12:16:20 -08:00
Kubernetes Prow Robot
ff8cf507dc
Merge pull request #83841 from RainbowMango/pr_hide_kubelet_deprecated_metrics
Turn off kubelet deprecated metrics
2019-12-09 11:30:02 -08:00
Kubernetes Prow Robot
fcc35b0468
Merge pull request #85899 from gongguan/slim_down_lister
slim down some lister expansions
2019-12-09 07:20:17 -08:00
Kubernetes Prow Robot
398e2bcc73
Merge pull request #85874 from sambdavidson/ttlFunc
Kubelet cert TTL via GaugeFunc
2019-12-09 07:20:02 -08:00
ianlang
babdcd0d14 invoke getTypedVersion() instead of direct runtime call 2019-12-09 15:31:45 +08:00
Kubernetes Prow Robot
95878329d4
Merge pull request #86009 from rphillips/fixes/at_most_one_ref
kubelet: guarantee at most only one cinfo per containerID
2019-12-06 17:06:15 -08:00
Kubernetes Prow Robot
e624d1b7bf
Merge pull request #85001 from bmoix/fix-golint-kubelet-httpgetter
kubelet: rename HTTPGetter interface
2019-12-06 17:05:53 -08:00
louisgong
7f5076d8ee slim down some lister expansions 2019-12-07 08:27:06 +08:00
Samuel Davidson
aba0b31526 Changed Kubelet client and serving cert TTL/Expiry certs to use gaugefunc for calculating time remaining. 2019-12-06 15:52:03 -08:00
Kubernetes Prow Robot
c9f690d418
Merge pull request #85170 from timyinshi/logSymlink
modify dockerID to containerID
2019-12-06 14:27:35 -08:00
Ryan Phillips
4762985fb6 kubelet: guarantee at most only one cinfo per containerID
The trailing for loop removed within this PR can include active and
inactive references. This modification will gauarantee at most only one
reference per container is returned.
2019-12-06 14:11:08 -06:00
Valentyn Boginskey
6b8b8491bb
Raise verbosity of kubelet_node_status messages
In standalone kubelet scenarios, `initialNode` gets called in a loop via
`syncPod` -> `GetNode` -> `initialNode`. This causes excessive log spam
from the controller attach/detach messages.
2019-12-06 10:38:18 -05:00
Noah Kantrowitz
0ac25f51fc
Tiny typo in a comment. 2019-12-06 01:32:09 -08:00
louisgong
0dd468039d inject remoteRuntime to kubelet dependency 2019-12-06 14:12:08 +08:00
Kubernetes Prow Robot
060e0de56d
Merge pull request #85945 from obitech/kubelet_refactor_lenient_path
Refactor kubelet component config lenient path decoding
2019-12-05 13:51:03 -08:00
Kubernetes Prow Robot
ad5d4c4705
Merge pull request #85706 from yutedz/per-node-dev
Remove nodes slice in loop of takeByTopology
2019-12-05 13:50:30 -08:00
obitech
bf92350b11 Refactor kubelet component config lenient path decoding
Use NewLenientSchemeAndCodec function provided in k8s.io/component-base/codec
instead of private package function.
2019-12-05 19:23:48 +08:00
Ted Yu
36784331eb Sync the status of static Pods 2019-12-04 13:28:42 -08:00
Hemant Kumar
4b8e552a88 Use typed errors for special casing volume progress
Use typed errors rather than operation status for
indicating operation progress
2019-12-04 14:48:30 -05:00
Adelina Tuvenie
bc7d254317 Fix Cpu Requests priority Windows.
For Windows, CPU Requests ( Shares, Count and Maximum ) are mutually exclusive, however
Kubernetes sends them all anyway in the pod spec.
When using dockershim this is not an issue, as Docker checks for this specific situation
here: 1bd184a4c2/daemon/daemon_windows.go (L87-L106)

However, when using CRI-Containerd this pods fail to spawn with an error from hcsshim.

This PR intends to filter these values before they are sent to the CRI and not rely on the
runtime for it.

Related to: https://github.com/kubernetes/kubernetes/issues/84804
2019-12-04 19:32:26 +02:00
louisgong
b469404d97 hollow-node use remote CRI 2019-12-04 17:07:04 +08:00
Kubernetes Prow Robot
205570eb75
Merge pull request #84614 from rphillips/fixes/add_cert_rotation_failure_metric
kubelet: add certificate rotation error metric
2019-12-03 11:40:57 -08:00
Kubernetes Prow Robot
1e2b6176aa
Merge pull request #83289 from beautytiger/dev-190929-sctp
fix unit test in hostport_manager_test.go
2019-12-02 21:42:57 -08:00
Kubernetes Prow Robot
57b6b287d4
Merge pull request #85688 from yutedz/pods-to-rm
Reduce unnecessary Set in updateAllocatedDevices
2019-12-02 17:07:26 -08:00
Kubernetes Prow Robot
833f585104
Merge pull request #85760 from yutedz/chkpt-write-err
Log error when writing checkpoint fails
2019-12-02 10:27:06 -08:00
Hemant Kumar
309c6f863a Handle the case of remounts correctly 2019-12-02 12:09:38 -05:00
Hemant Kumar
5feea93163 Rename MarkVolumeMountedOpts to MarkVolumeOpts
Also remove VolumeNotMounted state
2019-12-02 12:09:38 -05:00
Hemant Kumar
cdbd3ba5c2 Change interface of SetUp function 2019-12-02 12:09:38 -05:00
Hemant Kumar
0c52b6606e Refactor NodeStage function
Timeout operations should result in
Fix unit tests for uncertainDeviceGlobalMounts
2019-12-02 12:09:38 -05:00
Hemant Kumar
27a70a9260 Update generated files 2019-12-02 12:09:38 -05:00
Hemant Kumar
50dbcb3e00 Make sure PodExistsInVolume does not uses uncertain volumes 2019-12-02 12:01:40 -05:00
Hemant Kumar
34a6007dfe Add code to mark volume as uncertain
Update bazel files
Add tests for volume mounts in uncertain state
2019-12-02 12:01:40 -05:00
Hemant Kumar
a795f3de88 Add code for introducing uncertain state of mounts
Add a comment about volumestate
2019-12-02 11:57:40 -05:00
ZP-AlwaysWin
8c2aed4ff5 Optimize:remove unnecessary judgment 2019-12-02 14:17:48 +08:00
Ted Yu
84a9803741 Log error when writing checkpoint fails 2019-11-29 19:47:17 -08:00
Ted Yu
6415fa765e Remove nodes slice in loop of takeByTopology 2019-11-29 12:12:22 -08:00
Kubernetes Prow Robot
80eed952f0
Merge pull request #84854 from BSWANG/fix-hugetlb-cgroup
fix kubelet failed to start on setting hugetlb limits
2019-11-27 12:29:03 -08:00
Ted Yu
86f3bc25e1 Reduce unnecessary Set in updateAllocatedDevices 2019-11-27 08:48:06 -08:00
Kubernetes Prow Robot
b84fad5e6f
Merge pull request #84401 from xiaoanyunfei/bugfix/inspect-docker-image
ignore image err when docker image has been cleaned up
2019-11-25 19:11:10 -08:00
Kubernetes Prow Robot
cec566d77a
Merge pull request #85451 from flix-tech/ruben.serradas
Fix golint issues in pkg/kubelet/events/event.go
2019-11-25 16:43:10 -08:00
Ian Bull
a232971d73 Add public documentation for kubelet/apis/config
The `kubelet/apis/config` package had golint failures. This change-set
removes the `kubelet/apis/config` package from the `.golint_failures`
and fixes the golint errors. In particular, this change-set adds
documentation to the public types in the package.

This change-set works towards issue#68026
2019-11-20 22:52:53 -08:00
Dan Williams
5652819292 kubelet/network: add sig-network-approvers to OWNERS 2019-11-19 23:05:51 -06:00
Ruben
55c83e3397 Fix golint issues in pkg/kubelet/events/event.go
Change the single const statement in favor of multiple const event lists.
This way we don't need to put the name of the constant in the comment
and it's clearer that the comment refers to the whole list.
2019-11-19 13:15:08 +01:00
RainbowMango
214228f024 Remove the derprecated API RawRegister from stability framework 2019-11-19 18:56:09 +08:00
David Zhu
21f7060c8f Plumb test state through to fake volume host creation for error handling 2019-11-18 14:45:01 -08:00
Kubernetes Prow Robot
09d142a7ab
Merge pull request #80854 from aojea/hostportv6
Add IPv6 support to kubenet hostport
2019-11-16 04:35:41 -08:00
Travis Rhoden
0c5c3d8bb9
Remove pkg/util/mount (moved out of tree)
This patch removes pkg/util/mount completely, and replaces it with the
mount package now located at k8s.io/utils/mount. The code found at
k8s.io/utils/mount was moved there from pkg/util/mount, so the code is
identical, just no longer in-tree to k/k.
2019-11-15 08:29:12 -07:00
Kubernetes Prow Robot
4e45328e65
Merge pull request #83123 from aramase/dualstack-downward-api
Dualstack downward api
2019-11-14 22:13:42 -08:00
Kubernetes Prow Robot
3202bc1044
Merge pull request #83896 from mars1024/modify/cni_log
modify error output in cniNetworkPlugin
2019-11-14 20:52:02 -08:00
Kubernetes Prow Robot
372ebd24f5
Merge pull request #83098 from ddebroy/disable-intree
CSI Migration phase 2: disable probing of in-tree plugins
2019-11-14 20:51:42 -08:00
Kubernetes Prow Robot
e24f5ab4e4
Merge pull request #84747 from mkimuram/refactor-mapper
Refactor mapper/unmapper of block volume
2019-11-14 17:50:15 -08:00
Deep Debroy
129f15328b Disable in-tree plugins migrated to CSI
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-11-14 17:28:21 -08:00
Kubernetes Prow Robot
30e6238795
Merge pull request #85147 from yutedz/devmgr-rm-contents
Continue removing file in ManagerImpl#removeContents
2019-11-14 16:38:28 -08:00
Masaki Kimura
f363a03f0b Refactor BlockVolumeMapper and BlockVolumeUnmapper interface
- Rename MapDevice to MapPodDevice in BlockVolumeMapper
- Add UnmapPodDevice in BlockVolumeUnmapper (This will be used by csi driver later)
- Add CustomBlockVolumeMapper and CustomBlockVolumeUnmapper interface
- Move SetUpDevice and MapPodDevice to CustomBlockVolumeMapper
- Move TearDownDevice and UnmapPodDevice to CustomBlockVolumeUnmapper
- Implement CustomBlockVolumeMapper only in local and csi plugin
- Implement CustomBlockVolumeUnmapper only in fc, iscsi, rbd, and csi plugin
- Change MapPodDevice to return path and SetUpDevice not to return path
2019-11-14 22:01:11 +00:00
Kubernetes Prow Robot
42273a4dbf
Merge pull request #84472 from gab-satchi/windows-build-label
Adds Windows build information as a label on the node
2019-11-13 21:46:19 -08:00
Kubernetes Prow Robot
565566f4b2
Merge pull request #85153 from codenrhoden/mount-no-exec-int
Retire mount.Exec for k8s.io/utils/exec
2019-11-13 17:28:32 -08:00
Kubernetes Prow Robot
d3593c07de
Merge pull request #83057 from bclau/windows/containerd
Windows: Fixes termination-file mounting support for containerd
2019-11-13 17:27:36 -08:00
Travis Rhoden
367f879131
Retire mount.Exec for k8s.io/utils/exec
This patch removes mount.Exec entirely and instead uses the common
utility from k8s.io/utils/exec.

The fake exec implementation found in k8s.io/utils/exec differs a bit
than mount.Exec, with the ability to pre-script expected calls to
Command.CombinedOutput(), so tests that previously relied on a callback
mechanism to produce specific output have been updated to use that
mechanism.
2019-11-13 14:09:57 -07:00
Kubernetes Prow Robot
a08b09d52f
Merge pull request #84279 from matthyx/kuberuntime-startupprobe
Add startupProbe result handling to kuberuntime
2019-11-13 13:01:53 -08:00
Kubernetes Prow Robot
43ccfced1d
Merge pull request #84998 from wojtek-t/fix_owner_refs
Ensure that Node lease has OwnerReference set
2019-11-13 09:26:59 -08:00
Kubernetes Prow Robot
5689961ed3
Merge pull request #84649 from benmoss/windows_network_not_initialized
Skip GetPodNetworkStatus when CNI not yet initialized
2019-11-13 09:25:59 -08:00
Kubernetes Prow Robot
c10d29ba88
Merge pull request #84356 from verb/pid-ga
Promote PodProcessNamespaceSharing feature to GA
2019-11-13 09:25:42 -08:00
Ted Yu
fb046f7787 Continue removing file in ManagerImpl#removeContents 2019-11-13 06:00:34 -08:00
RainbowMango
30bf1f47dd Hide kubelet metrics that have been deprecated in 1.14 2019-11-13 19:17:38 +08:00
Claudiu Belu
d4d7f58362 Windows: Fixes termination-file mounting for containerd
If Containerd is used on Windows, then we can also mount individual
files into containers (e.g.: termination-log files), which was not
possible with Docker.

Checks if the container runtime is containerd, and if it is, then also
mount the termination-log file.
2019-11-12 23:33:55 -08:00
Matthias Bertschy
66595d54a0 Add startupProbe result handling to kuberuntime 2019-11-13 08:12:54 +01:00
root
e9edfbc539 modify dockerID to containerID 2019-11-13 10:43:55 +08:00
Gab Satch
f8e90eb5b0 Replaces modifying node object with returning a map of labels
- Adds label to update flow so can be picked up by an existing node
2019-11-12 16:50:43 -05:00
Kubernetes Prow Robot
ed10b5b17f
Merge pull request #85047 from yutedz/dev-mgr-err-handling
Handle error return from allocatePodResources
2019-11-12 11:51:27 -08:00
Kubernetes Prow Robot
c580a12c8e
Merge pull request #83568 from bertinatto/volume_limits_ga
Promote volume limits to GA
2019-11-12 11:50:22 -08:00
Kubernetes Prow Robot
402e551ca2
Merge pull request #85135 from wojtek-t/delete_unnecessary_conversions_1
Eliminate couple unnecessary conversions
2019-11-12 09:07:01 -08:00
wojtekt
067d173266 Eliminate couple unnecessary conversions 2019-11-12 15:00:09 +01:00
Kubernetes Prow Robot
897ce3073c
Merge pull request #84533 from davidz627/fix/deprecatedPath
Remove plugin watching of deprecated directory and CSI v0 support in accordance with deprecation policy
2019-11-12 04:48:20 -08:00
Fabio Bertinatto
affcd0128b Promote volume limits to GA 2019-11-12 09:43:53 +01:00
wojtekt
07200a0764 Ensure that Node lease has OwnerReference set 2019-11-12 09:11:59 +01:00
David Zhu
802fe12803 Remove plugin watching of deprecated directory {kubelet_root_dir}/plugins and support for CSI V0 in accordance with deprecation announcement in https://v1-13.docs.kubernetes.io/docs/setup/release/notes/ 2019-11-11 11:42:58 -08:00
Kubernetes Prow Robot
ec86baf00b
Merge pull request #84987 from RainbowMango/pr_migrate_custom_collector_kubelet_part2
migrate kubelet custom metrics to stability framework part 2
2019-11-10 19:44:04 -08:00
Kubernetes Prow Robot
b3dde20411
Merge pull request #84907 from RainbowMango/pr_migrate_custom_collector_kubelet
migrate kubelet custom metrics to stability framework part 1
2019-11-10 19:43:56 -08:00
Kubernetes Prow Robot
9646bd9736
Merge pull request #83664 from RainbowMango/pr_refactor_kubelet_ut_with_metrics_testutil
Refactor kubelet ut with metrics testutil
2019-11-10 19:43:42 -08:00
Kubernetes Prow Robot
0155d18fbc
Merge pull request #84485 from tallclair/mirror-owner
Mirror owner
2019-11-09 20:19:39 -08:00
Ted Yu
db0f616974 Handle error return from allocatePodResources 2019-11-09 16:25:15 -08:00
Kubernetes Prow Robot
92c4d68a5b
Merge pull request #84331 from zouyee/cadprocess
Enable cAdvisor ProcessMetrics collecting
2019-11-08 18:43:40 -08:00
Kubernetes Prow Robot
9cf309ed59
Merge pull request #82049 from andrewsykim/ga-node-instance-type-label
Promote Node Instance Type Label to GA
2019-11-08 13:47:58 -08:00
Kubernetes Prow Robot
8b123b1f4f
Merge pull request #81423 from codenrhoden/mount-testing-pkg
Refactor mount fakes
2019-11-08 12:24:52 -08:00
Tim Allclair
dca464d80a Add error detail 2019-11-08 09:59:04 -08:00
Bernat Moix
fc8ea98890 kubelet: rename HTTPGetter interface 2019-11-08 18:18:59 +01:00
Kubernetes Prow Robot
ff4718ea15
Merge pull request #84983 from krzysied/docker_fake_client_fix3
Fixing docker fake client - InspectExec
2019-11-08 09:00:50 -08:00
Kubernetes Prow Robot
ae15368355
Merge pull request #84351 from wojtek-t/promote_node_lease_to_GA
Promote node lease to GA
2019-11-08 09:00:15 -08:00
Andrew Sy Kim
17d8928dc9 kubelet: add unit tests for backfilling stable os/arch/zone/region/instance-type labels
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-08 10:43:50 -05:00
Andrew Sy Kim
7ddedf5034 kubelet: apply both beta and stable instance-type label
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-08 10:29:45 -05:00
Travis Rhoden
1fd8921546
Move mount/fake.go to mount/fake_mount.go
This patch moves fake.go to mount_fake.go, and follows to principle of
always returning a discrete type rather than an Interface. All callers
of "FakeMounter" are changed to instead use "NewFakeMounter()". The
FakeMounter "Log" struct member is changed to not be exported, and
instead only access through a new "GetLog()" method.
2019-11-08 08:07:41 -07:00
RainbowMango
159f56bf9b Deal with auto-generated files.
Update bazel by hack/update-bazel.sh
2019-11-08 20:21:48 +08:00
RainbowMango
2e8dcf7809 Migrate custom collector and mark metrics with ALPHA. 2019-11-08 20:19:37 +08:00
Krzysztof Siedlecki
d46daf891c fixing docker fake client InspectExec 2019-11-08 12:43:16 +01:00
Kubernetes Prow Robot
3ee195f0e9
Merge pull request #81431 from andrewsykim/ga-node-topology
Promote Node Zone/Region Topology Labels to GA
2019-11-07 22:00:20 -08:00
Andrew Sy Kim
4c194d52da kubelet: set both deprecated Beta and GA labels for zone/region topology from the cloud provider
Signed-off-by: Andrew Sy Kim <kiman@vmware.com>
2019-11-07 21:22:04 -05:00
Kubernetes Prow Robot
715b6afc95
Merge pull request #84711 from chendotjs/kubelet-fixip
Refactor: use existing function to  simplify check for IPv6 in kubelet
2019-11-07 17:38:50 -08:00
RainbowMango
e4a128a4f7 Deal with auto-generated files.
Update bazel by hack/update-bazel.sh
2019-11-08 09:16:57 +08:00
RainbowMango
ee4394a306 Migrate custom collector for kubelet 2019-11-08 09:16:57 +08:00
Kubernetes Prow Robot
f7d0e9b3f1
Merge pull request #84393 from wuyafang/remove_promhttp_from_kubelet
remove reference to promhttp in kubelet
2019-11-07 13:27:42 -08:00
mattjmcnaughton
d30319711e
Fix golint failures for pkg/kubelet/config/...
Address the final golint failure by adding a comment explaining our
blank import.
2019-11-07 09:36:22 -05:00
mrobson
e401ee9158 Errors from cgroup destroy and pid kills are swallowed. Log a warning when that happens. 2019-11-07 07:47:57 -05:00
Kubernetes Prow Robot
73b2c82b28
Merge pull request #83592 from jianzzha/opt-reserved-cpus
added --reserved-cpus kubelet command option
2019-11-06 22:14:42 -08:00
Kubernetes Prow Robot
695c3061dd
Merge pull request #82809 from liggitt/go-1.13-no-modules
update to use go1.13.4
2019-11-06 17:02:43 -08:00
Kubernetes Prow Robot
08e5781b41
Merge pull request #84525 from klueska/upstream-fix-hint-generation-after-kubelet-restart
Fix bug in TopologyManager hint generation after kubelet restart
2019-11-06 15:33:50 -08:00
Jordan Liggitt
297570e06a hack/update-vendor.sh 2019-11-06 17:42:34 -05:00
Kubernetes Prow Robot
46472773cb
Merge pull request #84836 from yuxiaobo96/k8s-checks
Correct spelling mistakes
2019-11-06 12:21:11 -08:00
Kubernetes Prow Robot
43b102a83c
Merge pull request #84807 from clarklee92/ModifyTheStatusCode
Modify the status code number to HTTP status semantics
2019-11-06 12:20:46 -08:00
Kubernetes Prow Robot
b09b962d96
Merge pull request #84746 from Huang-Wei/move-sched-constrants
Move out const strings in pkg/scheduler/api/well_known_labels.go
2019-11-06 12:20:06 -08:00
Kevin Klues
4d4d4bdd61 Ensure devicemanager TopologyHints are regenerated after kubelet restart
This patch also includes test to make sure the newly added logic works
as expected.
2019-11-06 15:01:34 +00:00
Jianzhu Zhang
89dfd24483 added --reserved-cpus kubelet command option 2019-11-06 07:33:52 -05:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
bingshen.wbs
47642a0bad fix kubelet failed to start on setting hugetlb limits in non-exist cgroup dir
cause by kubelet startup be interrupted on setting list of cgroups
In the 'cgroupManagerImpl.Exists' not check&recreate the hugetlb cgroup dir. Then setting the limits in non-exist cgroup dir will cause kubelet start failed.

Signed-off-by: bingshen.wbs <bingshen.wbs@alibaba-inc.com>
2019-11-06 16:39:55 +08:00
Wei Huang
019d7497a5
bazel files 2019-11-05 20:57:21 -08:00
Wei Huang
dd74205bcf
Move out const strings in pkg/scheduler/api/well_known_labels.go 2019-11-05 20:56:21 -08:00
Kubernetes Prow Robot
0c0408c790
Merge pull request #76407 from yanghaichao12/dev0411
change directory permissions from 0755 to 0750
2019-11-05 19:30:59 -08:00
Ryan Phillips
8e50c55e6b kubelet: add certificate rotation error metric 2019-11-05 16:51:40 -06:00
clarklee92
f86f5ee14e Modify the status code number to HTTP status semantics
Signed-off-by: clarklee92 <clarklee1992@hotmail.com>
2019-11-06 01:18:37 +08:00
Kevin Klues
9dc116eb08 Ensure CPUManager TopologyHints are regenerated after kubelet restart
This patch also includes test to make sure the newly added logic works
as expected.
2019-11-05 15:48:51 +00:00
Kevin Klues
a338c8f7fd Add some more comments to GetTopologyHints() in the devicemanager 2019-11-05 13:06:23 +00:00
Kevin Klues
58f3554ebe Sync all CPU and device state before generating TopologyHints for them
This ensures that we have the most up-to-date state when generating
topology hints for a container. Without this, it's possible that some
resources will be seen as allocated, when they are actually free.
2019-11-05 13:00:20 +00:00
Kevin Klues
d9adf20360 Abstract removeStaleState from reconcileState in CPUManager
This will become especially important as we move to a model where
exclusive CPUs are assigned at pod admission time rather than at pod
creation time.

Having this function will allow us to do garbage collection on these
CPUs anytime we are about to allocate CPUs to a new set of containers,
in addition to reclaiming state periodically in the reconcileState()
loop.
2019-11-05 12:45:11 +00:00
Bruce Ma
fe50e904eb restrict max string length in log
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-11-05 18:09:55 +08:00
wojtekt
ffad401b4e Promote NodeLease feature to GA 2019-11-05 09:01:12 +01:00
Kubernetes Prow Robot
590cbef0f6
Merge pull request #84721 from klueska/pr/81586-klueska
Base Infrastructure for adding Merge() API to TopologyManager Policies
2019-11-04 19:40:54 -08:00
Kubernetes Prow Robot
8ff16f35f8
Merge pull request #84007 from wojtek-t/reduce_node_update_frequency
Reduce node update frequency
2019-11-04 15:28:43 -08:00
Kubernetes Prow Robot
e948a67292
Merge pull request #84415 from langyenan/fix-evict-admit
reject pods when under disk pressure
2019-11-04 13:44:24 -08:00
Ashley Kasim
7d4f555449 correctly handle resetting cpuacct in a live container 2019-11-04 13:06:43 -08:00
Kubernetes Prow Robot
0ed6635173
Merge pull request #84534 from sambdavidson/serverRotMetric
Add a kubelet serving cert age metric
2019-11-04 10:31:42 -08:00
Kevin Klues
b5f52e6072 Modularize TopologyManager policy Merge() tests
These changes make it so that a set of common test cases can be used for
all merge strategies, with specific test cases being able to be
specified on a policy-by-policy basis.
2019-11-04 18:43:07 +01:00
Kevin Klues
7ea1fc9be4 Move TopologyManager TestPolicyMerge() to shared test file 2019-11-04 18:43:07 +01:00
Kevin Klues
d7d7bfcda0 Abstract TopologyManager Policy Merge() tests into their own function 2019-11-04 18:43:07 +01:00
Adrian Chiris
dee22d1fbc Fix comments in TopologyManager 2019-11-04 18:43:07 +01:00
Adrian Chiris
5f7db54d3c Move function from top-level TopologyManager to best-effort policy
This is in preparation for removing the special-case of the
SingleNumaNode policy in mergeProvidersHints() in favor of a custom
merging strategy with much less overhead.
2019-11-04 18:43:07 +01:00
Adrian Chiris
d95464645c Add Merge() API to TopologyManager Policy abstraction
This abstraction moves the responsibility of merging topology hints to
the individual policies themselves. As part of this, it removes the
CanAdmitPodResult() API from the policy abstraction, and rolls it into a
second return value from Merge()
2019-11-04 18:43:07 +01:00
Adrian Chiris
78d7856288 Globalize a few TopologyManager functions
This is in preparation for a larger refactoring effort that will add a
'Merge()'  API to the TopologyManager policy API.
2019-11-04 18:43:07 +01:00
Adrian Chiris
e72847676f Pass a list of NUMA nodes to the various TopologyManager policies
This is in preparation for a larger refactoring effort that will add a
'Merge()'  API to the TopologyManager policy API.
2019-11-04 18:43:07 +01:00
Adrian Chiris
6fd8a6eb69 Make restricted TopologyManager policy inherit from best-effort policy
These policies only differ on whether they admit the pod or not when a
TopologyHint is preferred or not. As such, the restricted policy should
simply inherit whatever it can from the best effort policy and only
overwrite what is necessary.

This does not matter for now, but will become important when we add a
new 'Merge()' abstraction to a Policy later on.
2019-11-04 18:43:07 +01:00
Adrian Chiris
3391daeb00 Break TopologyManager.calculateAffinity() into more modular functions
This modularization is in preparation for a larger refactoring effort
that will add a 'Merge()'  API to the TopologyManager policy API.
2019-11-04 18:43:07 +01:00
Adrian Chiris
b17706b149 Added LessThan() and IsEqual() methods for TopologyHints 2019-11-04 18:43:07 +01:00
chendotjs
5381c9afe1 simplify check for IPv6 in kubelet. 2019-11-04 22:01:51 +08:00
yanghaichao12
5cbafba457 change directory permissions from 0755 to 0750 2019-11-04 17:04:37 +08:00
Kubernetes Prow Robot
08410cbf06
Merge pull request #84365 from codenrhoden/rm-mount-container
Remove Alpha feature MountContainers
2019-11-03 21:29:41 -08:00
Samuel Davidson
3e817d17a5 Updated usage of certificate.Manager to use new rotation metric 2019-11-01 13:32:09 -07:00
Kubernetes Prow Robot
002dbf6a4c
Merge pull request #83777 from lmdaly/fix-single-numa-node-with-best-effort-pods
Fixed bug in TopologyManager with SingleNUMANode Policy
2019-11-01 04:53:23 -07:00
Kubernetes Prow Robot
ed5b038313
Merge pull request #84218 from cofyc/fix74552
Support local filesystem volume with block source reconstruction and add related e2e tests
2019-10-31 21:53:36 -07:00
Kubernetes Prow Robot
b1ac4cda11
Merge pull request #84253 from yutedz/kube-solve-check
Move CheckLimitsForResolvConf to Kubelet#syncLoop
2019-10-31 18:04:54 -07:00
Ben Moss
ce41faa2eb Skip GetPodNetworkStatus when CNI not yet initialized
Without this scheduling a pod on Windows results in a panic from
`addToNetwork` when it tries to read `NetworkConfig` and `CNIConfig` off
the nil network
2019-10-31 17:51:04 -04:00
Lee Verberne
cbbe7d1bb9 Remove checks for PodShareProcessNamespace feature gate 2019-10-31 17:15:23 +00:00
Kubernetes Prow Robot
3383d7ca66
Merge pull request #83204 from obitech/kubelet_strict_serializer
Enable strict serializer in kubelet
2019-10-31 09:11:37 -07:00
Kubernetes Prow Robot
17a57f99d5
Merge pull request #81344 from zouyee/cpm
fix cpumanager reconcileState without sourceready
2019-10-30 23:33:36 -07:00
Tim Allclair
bbb939357e Fix rebase issue 2019-10-30 17:50:13 -07:00
Tim Allclair
9f7394ac63 Update generated files 2019-10-29 16:14:34 -07:00
Tim Allclair
f827863128 Inject owner references into mirror pods 2019-10-29 16:14:06 -07:00
Gab Satch
e852cd40f0 golint changes 2019-10-29 08:25:11 -04:00
Kubernetes Prow Robot
b8f03a12dd
Merge pull request #84294 from denkensk/remove-predicate-nodeinfo-kubelet
Remove predicates.NodeInfo dependency from kubelet
2019-10-28 17:48:56 -07:00
Gab Satch
79dafaa760 bazel and gofmt fixes
Signed-off-by: Ben Moss <bmoss@pivotal.io>
2019-10-28 17:02:15 -04:00
Ashley Kasim
4b339e6e4e fix syntax error in test 2019-10-28 13:31:00 -07:00
gab-satchi
b4ba8cf188 Adds Windows build information as a label on the node 2019-10-28 14:02:26 -04:00
ianlang
22d8e054bc unit test: TestAdmitUnderNodeConditions 2019-10-28 11:37:18 +08:00
Yecheng Fu
36a54399a6 support local volume with block source reconstruction 2019-10-28 10:34:57 +08:00
ianlang
372bf95a4f reject pods when under disk pressure 2019-10-27 23:27:00 +08:00
sunxiaofei03
fdbf5ef0b8 ignore image err when docker image has been cleaned up 2019-10-27 23:02:47 +08:00
Kubernetes Prow Robot
24ae4d6718
Merge pull request #84173 from cofyc/fix83693
Support local volume block mode reconstruction
2019-10-25 19:23:23 -07:00
wuyafang
78d24f59dd remove reference to promhttp in kubelet 2019-10-26 09:10:33 +08:00
Kubernetes Prow Robot
cbf1e2d360
Merge pull request #82794 from ingvagabund/fake-clientset-enforce-exact-much-for-get
Require exact match when calling Get method within fake clientset
2019-10-25 09:53:39 -07:00
Anish Ramasekar
af4d18ccf9
add status.podIPs in downward api
add host file write for podIPs

update tests

remove import alias

update type check

update type check

remove import alias

update open api spec

add tests

update test

add tests

address review comments

update imports

remove todo and import alias
2019-10-25 09:18:49 -07:00
Travis Rhoden
2e054a4f4c
Remove Alpha feature Mount Containers
The alpha feature for mount containers is unused, and is
superseded by CSI. By removing it, we can remove a lot of unnecessary
code, and also clean up the mount library even more before moving it out
of tree.
2019-10-25 09:25:13 -06:00
Kubernetes Prow Robot
aebc8eae9d
Merge pull request #83713 from RainbowMango/pr_refactor_kubelet_collector_test
Refactor kubelet collector test
2019-10-24 22:55:38 -07:00
zouyee
cc35d588a7 Enable cAdvisor ProcessMetrics collecting
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-10-25 12:19:38 +08:00
obitech
bba15d358c Add strict deserialization for kubelet component config
CodecFactory is started with EnableStrict that throws an error when deserializing
a Kubelet component config that is malformed (e.g. unknown or duplicate keys).

When strict decoding a v1beta1 config fails, non-strict decoding is used and a warning is emitted.
For this, NewSchemeAndCodecs is now a variadic function that can take multiple
arguments for augmenting the returned codec factory. Strict decoding is
then explicitely enabled when decoding a kubelet config.
Additionally, decoding a RemoteConfigSource needs to be non-strict
to avoid an accidental error when it contains newer API fields that are not
yet known to the Kubelet.

DecodeKubeletConfiguration returns a wrapped error instead of a simple string
so its type can be tested.

Add unit tests for unhappy paths when loading a component config

Add keys for test cases struct fields, remove nil field initialization

Co-Authored-By: Jordan Liggitt <jordan@liggitt.net>
2019-10-24 19:37:35 +02:00
Kubernetes Prow Robot
f6644d4366
Merge pull request #78938 from nolancon/socket-mask-unit-test
Clean-up and additional test cases for socket-mask unit test.
2019-10-24 09:49:12 -07:00
Alex Wang
b1a3fb4988 change kubelte nodeInfo to nodeLister 2019-10-24 22:46:59 +08:00
Jan Chaloupka
d32c76fc03 Require exact match when calling Get method within fake clientset
`Get` method within the fake clientset returns an object that would not be normally returned when using the real clientset. Reproducer:

```go
package main

import (
	v1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/kubernetes/fake"
)

func main () {
	cm := &v1.ConfigMap{
		ObjectMeta: metav1.ObjectMeta{Namespace: metav1.NamespaceSystem, Name: "cm"},
		}

	client := fake.NewSimpleClientset(cm)
	obj, err := client.CoreV1().ConfigMaps("").Get("", metav1.GetOptions{})
	if err != nil {
		panic(err)
	}
	fmt.Printf("obj: %#v\n", obj)
}
```

stored under `test.go` of `github.com/kubernetes/kubernetes` (master HEAD) root directory and ran:

```sh
$ go run test.go
obj: &v1.ConfigMap{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"cm", GenerateName:"", Namespace:"kube-system", SelfLink:"", UID:"", ResourceVersion:"", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:"", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, Data:map[string]string(nil), BinaryData:map[string][]uint8(nil)}
```

As you can see fake clientset with a "test" configmap is created. When getting the object through the clientset back, I intentionally set the object name to an empty string. I would expect to get an error saying config map "" was not found. However, I get "test" configmap instead.

Reason for that is inside implementation of `filterByNamespaceAndName` private function:
```go
func filterByNamespaceAndName(objs []runtime.Object, ns, name string) ([]runtime.Object, error) {
	var res []runtime.Object

	for _, obj := range objs {
		acc, err := meta.Accessor(obj)
		if err != nil {
			return nil, err
		}
		if ns != "" && acc.GetNamespace() != ns {
			continue
		}
		if name != "" && acc.GetName() != name {
			continue
		}
		res = append(res, obj)
	}

	return res, nil
}
```

When `name` is empty, `name != "" && acc.GetName() != name` condition is false and thus `obj` is consider as a fit.

[1] https://github.com/kubernetes/client-go/blob/master/testing/fixture.go#L481-L493
2019-10-24 14:41:48 +02:00
Ted Yu
ae9e93d784 Move CheckLimitsForResolvConf to Kubelet#syncLoop 2019-10-23 17:16:23 -07:00
Kubernetes Prow Robot
037751e7ad
Merge pull request #83986 from qingsenLi/k8s-191016
Fix Typos in pkg/kubelet/dockershim/docker_service.go
2019-10-23 15:53:50 -07:00
Kubernetes Prow Robot
41a4133318
Merge pull request #83931 from cheftako/context2
This adds context from for cloud calls for Kubelet.
2019-10-23 06:44:21 -07:00
Yecheng Fu
46b1e264dc support local volume block mode reconstruction 2019-10-23 19:32:15 +08:00
Kubernetes Prow Robot
6d314f860e
Merge pull request #84156 from wawa0210/win-performance-counter
Fix windows performance counter error on Non-English environemnt
2019-10-22 20:10:24 -07:00
Kubernetes Prow Robot
a005925a71
Merge pull request #84048 from jsafrane/kubelet-volumemode-checks
Check PV volumeMode in kubelet even when block feature is off
2019-10-22 20:10:13 -07:00
Jan Safranek
c9fc26d85e Fix volumeMode retrieval when BlockVolume feature is off
API served does not need to default volumeMode to Filesystem.
2019-10-22 10:17:14 +02:00
xiaozhang
685c8f93d9 fix windows performance counter father information failed on Non-English environment 2019-10-21 19:49:13 +08:00
Clayton Coleman
3c44e11cfa
kubelet: Record preemptions similarly to evictions
A preemption is a disruption event that should have a metric so that
the rate of preemption can be assessed. Nodes that are under heavy
preemption may have conflicting workloads or otherwise need attention.
A sudden burst of preemption on a cluster in steady state could
indicate pathological conditions within the scheduler or workload
controllers.
2019-10-19 19:07:37 -04:00
draveness
1163a1d51e feat: update taint nodes by condition to GA 2019-10-19 09:17:41 +08:00
nolancon
b0a85177d2 Clean-up and additional test cases for socket-mask unit test. 2019-10-18 04:16:06 +01:00
Jan Safranek
acf129443c Check PV volumeMode in kubelet even when block feature is off 2019-10-17 15:26:48 +02:00
Kubernetes Prow Robot
c63ec82490
Merge pull request #75190 from deads2k/kubelet-timeout
set backup value to ensure connections against kubelets eventually close
2019-10-16 22:24:38 -07:00
Kubernetes Prow Robot
cb19b56831
Merge pull request #83419 from deads2k/insecure-backend-proxy
Insecure backend proxy
2019-10-16 13:58:38 -07:00
David Eads
ff689ce3de set backup value to ensure connections against kubelets eventually close 2019-10-16 13:39:14 -04:00
David Eads
867ee1d5ff add insecurebackendproxy 2019-10-16 11:43:17 -04:00
wojtekt
dcf8200d28 Bump default NodeStatusReportFrequency to 5m 2019-10-16 16:37:22 +02:00
qingsenLi
8d3daa8260 fix errors 2019-10-16 22:11:47 +08:00
walter
d9e57861e5 This adds context from for cloud calls for Kubelet.
It continues the propogation started in #59287.
2019-10-14 22:01:22 -07:00
Bruce Ma
213c378562 modify error output in cniNetworkPlugin
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-10-14 20:17:27 +08:00
Bob Killen
2e52875917
Prune inactive owners from pkg/kubelet/* network related OWNERS files. 2019-10-13 08:51:00 -04:00
Kubernetes Prow Robot
0599ca2bcf
Merge pull request #81594 from jfbai/remove-duplicated-log
Remove duplicated log.
2019-10-11 19:38:38 -07:00
Kubernetes Prow Robot
017842d49d
Merge pull request #83492 from ConnorDoyle/topo-align-all-qos
Topology manager aligns pods of all QoS classes.
2019-10-11 03:03:40 -07:00
Louise Daly
a353247d44 Fixed bug in TopologyManager with SingleNUMANode Policy
This patch fixes an issue where best-effort pods were not admitted
to the node if the single-numa-node policy was set.

This was because the Admit policy in single-numa-node policy does
not admit any pod where the hint is anything but single NUMA node. The 'best hint' in this case is {<set bits for num. Numa Nodes on machine>, true}
So on a machine with 2 NUMA nodes the best hint for a best-effort pod is {11,true} as best-effort pods have no Topology preferences.

The single-numa-node policy fails any pod with a not preferred hint OR a hint where > 1 bits are set, thus the above example resulting in termintaed pods with a Topology Affinity Error.

This is a short term fix for the single-numa-node policy, as there will be code refactoring for the 1.17 release.
2019-10-11 07:00:37 +01:00
Kubernetes Prow Robot
4561b67971
Merge pull request #83697 from klueska/fix-single-numa-with-one-provider
Fixed bug in TopologyManager with SingleNUMANode Policy
2019-10-10 19:00:33 -07:00
RainbowMango
633bb52b49 Deal with auto-generated files.
Update bazel by hack/update-bazel.sh
2019-10-11 09:26:58 +08:00
RainbowMango
3b07393ea8 Refactor UT with testutil from k/k. 2019-10-11 09:25:17 +08:00
Kubernetes Prow Robot
3db6d3abcf
Merge pull request #83551 from dims/move-external-facing-kubelet-apis-to-staging
Move external facing kubelet apis to staging
2019-10-10 13:41:36 -07:00
Connor Doyle
a598369e3c Gofmt. 2019-10-10 12:16:21 -07:00
Connor Doyle
a9203ebdcf Topology manager aligns pods of all QoS classes. 2019-10-10 12:16:21 -07:00
Zida
bc56cf45a5 Fix comment typos in prober 2019-10-10 14:53:08 +08:00
SataQiu
23a8be6e5f remove direct references to prometheus/testutil from kubelet/metrics 2019-10-10 12:56:28 +08:00
Kevin Klues
5501f542cd Fixed bug in TopologyManager with SingleNUMANode Policy
This patch fixes an issue in the TopologyManager that wouldn't allow
pods to be admitted if pods were launched with the SingleNUMANode policy
and any of the hint providers had no NUMA preferences.

This is due to 2 factors:

1) Any hint provider that passes back a `nil` as its hints, has its hint
automatically transformed into a single {11 true} hint before merging

2) We added a special casing for the SingleNumaNodePolicy() in the
TopologyManager that essentially turns these hints into a
{11 false} anytime a {11 true} is seen.

The current patch reworks this logic so the that TopologyManager can
tell the difference between a "don't care" hint and a true "{11 true}"
hint returned by the hint provider. Only true "{11 true}" hints will be
converted by the special casing for the SingleNumaNodePolicy(), while
"don't care" hints will not.

This is a short term fix for this issue until we do a larger refactoring
of this code for the 1.17 release.
2019-10-09 17:41:08 -07:00
Guangming Wang
97e2576750 hostport return error when claim SCTP type port
revert last changes, just modify typos in unit test, and remove failed assert

sub count of sctp port when assert of len compare
2019-10-09 20:02:04 +08:00
Kubernetes Prow Robot
4b002b3baa
Merge pull request #82123 from xiaoanyunfei/cleanup/take-effect-stateofworld-hashmap
replace iteration with hashmap in *state_of_world
2019-10-09 02:17:50 -07:00
Kubernetes Prow Robot
5ce75a8734
Merge pull request #83625 from mrobson/log-cgroups
Add podCgroup to process kill events to allow for correlation
2019-10-09 00:56:01 -07:00
RainbowMango
6099d49046 Deal with auto-generated files.
- Update bazel by hack/update-bazel.sh
2019-10-09 15:12:21 +08:00
RainbowMango
debe2f7b43 Refactor TestRunningPodAndContainerCount with metrics testutil 2019-10-09 15:09:23 +08:00
Kubernetes Prow Robot
4cff1c3ea1
Merge pull request #81280 from yqwang-ms/yqwang/exitmsglost
Fix Container exit message lost due to FallbackToLogsOnError is not compatible with ContainerCannotRun
2019-10-08 15:41:51 -07:00
Kubernetes Prow Robot
cc8bfd1cdd
Merge pull request #78720 from goodluckbot/fix-kubelet-runtime-error-log-level
Fix log level for runtime error in kubelet.go
2019-10-08 10:57:10 -07:00
mrobson
ad3dcb9fa0 Add podCgroup to process kill events to allow for correlation 2019-10-08 13:12:48 -04:00
Kubernetes Prow Robot
d70b2db1f2
Merge pull request #83296 from yutedz/kill-cgrp-proc
Only kill process where killing failed during previous iterations
2019-10-08 07:19:13 -07:00
Kubernetes Prow Robot
edc4ff3b73
Merge pull request #83499 from SataQiu/metrics-kubelet
Eliminate direct references to prometheus from kubelet
2019-10-08 05:25:11 -07:00
Kubernetes Prow Robot
3f8f0a32fa
Merge pull request #83527 from odinuge/runc-rc9
Bump dependency opencontainers/runc@v1.0.0-rc9
2019-10-08 03:45:44 -07:00
Kubernetes Prow Robot
8098bae921
Merge pull request #83451 from jsafrane/block-reconstruct
Fix block volume reconstruction
2019-10-08 03:45:18 -07:00
Kubernetes Prow Robot
72cd1c14ef
Merge pull request #83325 from yutedz/static-mirror-pod
Check whether mirror pod is ciritical in managerImpl#evictPod
2019-10-07 22:15:40 -07:00
Kubernetes Prow Robot
39ba488be3
Merge pull request #83069 from fcgravalos/remove_trailing_dots_from_searches
remove trailing dots from the parsed searches from host resolv.conf
2019-10-07 11:27:11 -07:00
Kubernetes Prow Robot
7c4ba5909f
Merge pull request #82968 from uzuku/fix-golint-failures
Fix golint failures of pkg/kubelet/status/...
2019-10-07 07:47:08 -07:00
Davanum Srinivas
f29d2272c8
fix gofmt and golint failures
Change-Id: I6535b506f50558b31663a13cd270b15023afa2c6
2019-10-06 18:43:17 -04:00
Kubernetes Prow Robot
48b90db9c3
Merge pull request #83495 from tanjunchen/fix-typo
remove the repeat word in documents
2019-10-06 15:05:08 -07:00
Davanum Srinivas
6ecc0f83af
update bazel BUILD files
Change-Id: Ia3917cec1453c0b22a958faf8c22bccd79242d14
2019-10-06 15:29:23 -04:00
Davanum Srinivas
d30c489c54
Move pkg/kubelet/pluginregistration and deviceplugin
Change-Id: I06adcb43bd278b430ffad2010869e1524c8cc4ff
2019-10-06 15:28:38 -04:00
tanjunchen
de3cf23414 remove the repeat word in documents 2019-10-06 23:32:01 +08:00
Odin Ugedal
b9cfb19321
Rename cgroupsystemd.Manager to LegacyManager 2019-10-05 14:22:35 +02:00
Kubernetes Prow Robot
d60bda1971
Merge pull request #83043 from ConnorDoyle/cleanup-cpumanger-topo-hints
Delegate topology hint gen to CPU manager policy
2019-10-05 00:59:39 -07:00
Ashley Kasim
3be31530d5 cri_stats_provider: do not consider exited containers when calculating cpu usage 2019-10-04 09:07:53 -07:00
Jan Safranek
44a006e0d0 Fix volume map path during reconstruction 2019-10-04 15:49:49 +02:00
SataQiu
77f42c8108 eliminate direct references to prometheus 2019-10-04 21:33:34 +08:00
Fernando Crespo Gravalos
c959b5ef8a don't add extra variable for searches 2019-10-04 12:23:07 +02:00
Fernando Crespo Gravalos
9dac0c2d02 improve explanatory comment about trailing dots in searches 2019-10-04 11:40:40 +02:00
Kevin Klues
d2b53af7d7 Add klueska as reviewer for CPUManager and devicemanager 2019-10-03 13:01:41 -07:00
Ted Yu
0939f90103 Check whether mirror pod is ciritical in managerImpl#evictPod 2019-10-01 11:12:18 -07:00
Kubernetes Prow Robot
40d4ddc7e5
Merge pull request #83192 from liggitt/improve-token-request-error
Improve error message for projected tokens when API is not enabled
2019-10-01 09:35:34 -07:00
Kubernetes Prow Robot
c9f8b8b525
Merge pull request #82374 from xcelsion/fix-dup-containerport-between-address-families
Fixed issue with duplicate containerPorts in different address families
2019-09-30 17:55:32 -07:00
Ted Yu
6dbb533e3c Only kill process where killing failed during previous iterations 2019-09-29 19:53:43 -07:00
RainbowMango
f57bb81e95 Update bazel by hack/update-bazel.sh 2019-09-29 11:52:30 +08:00
RainbowMango
3b89ade154 Remove direct reference to Prometheus 2019-09-29 11:41:28 +08:00
Kubernetes Prow Robot
be1574b741
Merge pull request #83196 from zouyee/cmq
using online file instead to fix NUMA nodes init
2019-09-27 22:51:39 -07:00
Connor Doyle
389853894d Delegate topology hint gen to CPU manager policy
- The previous implementation depended on a fixed set of policies.
2019-09-27 22:29:02 -07:00
Kubernetes Prow Robot
67d750bb28
Merge pull request #81916 from hwdef/fix-typo-pkg
fix typo in pkg
2019-09-26 08:35:24 -07:00
zouyee
b1f6974f7b using online instead to fix kubelet service failed with wrong number of possible NUMA nodes
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-09-26 21:48:50 +08:00
Jordan Liggitt
e70a9c6c18 Improve error message for projected tokens when API is not enabled 2019-09-26 09:10:07 -04:00
Kubernetes Prow Robot
b72d550672
Merge pull request #78563 from qingsenLi/k8s-190531
Delete the redundant define test
2019-09-26 01:25:10 -07:00
Fernando Crespo Gravalos
0b850c5d82 add comment explaining why we remove trailing dots in searches 2019-09-26 10:05:58 +02:00
Kubernetes Prow Robot
8ad1aba7f5
Merge pull request #82465 from hprateek43/MoveGetPodPriority
Move GetPodPriority from /scheduler/util to /api/pod
2019-09-25 11:06:00 -07:00
Kubernetes Prow Robot
327f53ba57
Merge pull request #83064 from liggitt/propagate-context
Propagate context to remote authorize/authenticate webhook calls
2019-09-25 09:32:01 -07:00
Sho SHIMIZU
91b9d42109 Fix typo
s/namespcae/namespace
2019-09-25 16:38:03 +09:00
zouyee
594fc0f4b9 fix cpumanager reconcileState without sourceready
Signed-off-by: Zou Nengren <zouyee1989@gmail.com>
2019-09-25 10:39:06 +08:00
Harsh Singh
6a9ef7f04f Move GetPodPriority from /scheduler/util to /api/pod 2019-09-24 22:02:13 +05:30
Jordan Liggitt
92eb072989 Propagate context to Authorize() calls 2019-09-24 11:14:54 -04:00
Fernando Crespo Gravalos
a215a88d91 remove trailing dots from the parsed searches from host resolv.conf 2019-09-24 16:35:01 +02:00
Kubernetes Prow Robot
4e63af2324
Merge pull request #83033 from ConnorDoyle/rename-socketmask
Rename package socketmask to bitmask.
2019-09-24 00:26:02 -07:00
Kubernetes Prow Robot
f243640e22
Merge pull request #83036 from liyanhui1228/win_portforward
Use ipv4 in wincat port forward
2019-09-23 19:01:26 -07:00
Kubernetes Prow Robot
50196ce088
Merge pull request #82300 from lyft/cri-stats-nanocores-overflow-fix
pkg/kubelet: fix uint64 overflow when elapsed UsageCoreNanoSeconds exceeds 18446744073
2019-09-23 17:31:38 -07:00
Angela Li
4301bbff08 Use ipv4 in wincat port forward 2019-09-23 17:10:01 -07:00
Connor Doyle
e35301c19f Rename package socketmask to bitmask.
- As discussed in reviews and other public channels,
  this abstraction is used to represent numa nodes, not sockets.
- There is nothing inherently related to sockets in this package anyway.
2019-09-23 17:08:45 -07:00
danielqsj
c2a4906152 Bump k8s.io/klog to v1.0.0 2019-09-23 16:51:43 +08:00
Uzuku
5a2e6bd000 Fix golint failures of pkg/kubelet/status/... 2019-09-21 23:43:37 +08:00
Kubernetes Prow Robot
a2760c9c13
Merge pull request #78110 from praseodym/fix-golint-pkg/kubelet/qos
Fix golint failures of pkg/kubelet/qos
2019-09-20 09:41:46 -07:00
Kubernetes Prow Robot
53b3c8968e
Merge pull request #82164 from yuxiaobo96/k8s-fix2
delete extra comma
2019-09-19 21:22:59 -07:00
Kubernetes Prow Robot
605687dec7
Merge pull request #71653 from liucimin/update_kubelet_cni_lib
No timeout when Kubelet Calling cni plugin
2019-09-19 18:00:59 -07:00
Kubernetes Prow Robot
3d897f21fc
Merge pull request #82594 from yutedz/oper-gen-plugin-err
Check the error return from AddPlugin
2019-09-19 14:20:58 -07:00
Kubernetes Prow Robot
d05183be41
Merge pull request #82858 from hwdef/del-unused-var
delete unused var
2019-09-19 11:05:49 -07:00
liucimin
ddb1c6a127 fix cni timeout 2019-09-19 22:56:03 +08:00
hwdef
4e7ef9ad36 delete unused var 2019-09-19 18:04:13 +08:00