Commit Graph

8604 Commits

Author SHA1 Message Date
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
Kubernetes Prow Robot
4097a99fd7
Merge pull request #82800 from Random-Liu/fix-routes
Only set ipv4/ipv6 routes when there is corresponding CIDR.
2019-09-18 19:14:59 -07:00
Kubernetes Prow Robot
cfa3e2c499
Merge pull request #82508 from aanm/fix-get-pod-ip-panic
dockershim/network: fix panic for cni plugins in IPv4/IPv6 dual-stack mode
2019-09-17 19:43:32 -07:00
Kubernetes Prow Robot
67d928acdc
Merge pull request #82096 from logicalhan/version-deletion
remove pkg/version and some of redundant copies of it
2019-09-17 14:27:16 -07:00
Lantao Liu
032c97daee Only set ipv4/ipv6 routes when there is corresponding CIDR.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-17 11:05:17 -07:00
Dan Winship
3948f16ff4 Add iptables.Monitor, use it from kubelet and kube-proxy
Kubelet and kube-proxy both had loops to ensure that their iptables
rules didn't get deleted, by repeatedly recreating them. But on
systems with lots of iptables rules (ie, thousands of services), this
can be very slow (and thus might end up holding the iptables lock for
several seconds, blocking other operations, etc).

The specific threat that they need to worry about is
firewall-management commands that flush *all* dynamic iptables rules.
So add a new iptables.Monitor() function that handles this by creating
iptables-flush canaries and only triggering a full rule reload after
noticing that someone has deleted those chains.
2019-09-17 10:19:26 -04:00
Han Kang
866ea74326 remove pkg/version and some of redundant copies of it
Change-Id: Ia58367c1b1274bfb49c8a4784051463abaf795de
2019-09-16 16:24:35 -07:00
Dan Winship
b6c3d5416a Drop iptables firewalld monitoring support
The firewalld monitoring code was not well tested (and not easily
testable), would never be triggered on most platforms, and was only
being taken advantage of from one place (kube-proxy), which didn't
need it anyway since it already has its own resync loop.

Since the firewalld monitoring was the only consumer of pkg/util/dbus,
we can also now delete that.
2019-09-15 15:35:40 -04:00
Niels van Oosterom
ef39312fa5 Fixed an issue where duplicate containerPorts where not allowed across different address families 2019-09-13 14:44:53 +02:00
David Zhu
f15cc60957 Update golang scientific notation using hack/update-gofmt.sh 2019-09-12 18:05:49 -07:00
Kubernetes Prow Robot
579e0c74c1
Merge pull request #82514 from dims/limit-exec-probe-bytes-read
Exec probes should not be unbounded
2019-09-11 21:24:35 -07:00
Kubernetes Prow Robot
3f2f5dd36f
Merge pull request #82370 from zhuangqh/kubelet-tdt-containerLogs
kubelet: refactor server containerLogs test to table driven test
2019-09-11 18:28:00 -07:00
Kubernetes Prow Robot
07cc813956
Merge pull request #81793 from lmdaly/topology-manager-owners
Added OWNERS file for Topology Manager
2019-09-11 18:26:52 -07:00
Kubernetes Prow Robot
93d549cfdf
Merge pull request #82342 from carlosedp/nocgo
Bump gonvml module and remove CGO dependency.
2019-09-11 15:26:38 -07:00
Kubernetes Prow Robot
252a7ecbe4
Merge pull request #82233 from SataQiu/fix-golint-kubelet
Fix golint failures of pkg/kubelet
2019-09-11 10:41:19 -07:00
Kubernetes Prow Robot
3f4e30a80e
Merge pull request #82113 from kebe7jun/fix/log-format-and-typo
Fix sync pod log format
2019-09-11 10:39:14 -07:00
Ted Yu
156c5cb3d3 Check the error return from AddPlugin 2019-09-11 10:38:28 -07:00
Davanum Srinivas
5706a13bd6
Exec probes should not be unbounded
In 1f270ef4e2, we added 10KB as the read
limit for http probes. we should do the same for exec probes as well.

Change-Id: If154c5c4e669829ab94839c56260a894a6714f0f
2019-09-11 10:15:35 -04:00
Davanum Srinivas
1b79c1f6b3
Add 16MB limit to dockershim ExecSync
Change-Id: Ia86cfdb9bdaf994d30216621f78aebc6c555cf4a
2019-09-11 09:52:28 -04:00
Tim Allclair
20fc22f461
Add LimitWriter util 2019-09-11 09:52:28 -04:00
Louise Daly
fbccf25e29 Added OWNERS file for Topology Manager 2019-09-11 06:40:24 +01:00
Kubernetes Prow Robot
349143ec35
Merge pull request #81530 from tedyu/dsow-pop-pod-vol
Fixing contradictory log messages when AddPodToVolume encounters error
2019-09-10 22:11:22 -07:00
Kubernetes Prow Robot
e972912fe4
Merge pull request #74881 from qingsenLi/k8s190304-fix-syntactic
fix syntactic error in kuberuntime_manager.go
2019-09-10 14:28:48 -07:00
André Martins
a5365d5be1 dockershim/network: fix panic for cni plugins in IPv4/IPv6 dual-stack mode
```
 k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni.(*cniNetworkPlugin).GetPodNetworkStatus(0xc000a04370, 0xc000b89a62, 0xb, 0xc000b89a49, 0x18, 0x42edffb, 0x6, 0xc000cfa340, 0x40, 0xc000ced7d0, ...)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/dockershim/network/cni/cni_others.go:78 +0x420
 k8s.io/kubernetes/pkg/kubelet/dockershim/network.(*PluginManager).GetPodNetworkStatus(0xc000a51880, 0xc000b89a62, 0xb, 0xc000b89a49, 0x18, 0x42edffb, 0x6, 0xc000cfa340, 0x40, 0x0, ...)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/dockershim/network/plugins.go:391 +0x1f9
 k8s.io/kubernetes/pkg/kubelet/dockershim.(*dockerService).getIPsFromPlugin(0xc00029b600, 0xc000c25cb0, 0x40, 0x78c0000, 0x7982100, 0x0, 0x0)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go:335 +0x1c3
 k8s.io/kubernetes/pkg/kubelet/dockershim.(*dockerService).getIPs(0xc00029b600, 0xc000b66cc0, 0x40, 0xc000c25cb0, 0x30bd171a, 0xed508364b, 0x0)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go:373 +0xe3
 k8s.io/kubernetes/pkg/kubelet/dockershim.(*dockerService).PodSandboxStatus(0xc00029b600, 0x4ad8b20, 0xc000c25c80, 0xc000cde1c0, 0xc00029b600, 0xc000c25c80, 0xc0005f5bd0)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubelet/dockershim/docker_sandbox.go:439 +0x133
 k8s.io/kubernetes/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2._RuntimeService_PodSandboxStatus_Handler(0x42c4e00, 0xc00029b600, 0x4ad8b20, 0xc000c25c80, 0xc000c126c0, 0x0, 0x4ad8b20, 0xc000c25c80, 0xc000cb2d20, 0x42)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/k8s.io/cri-api/pkg/apis/runtime/v1alpha2/api.pb.go:7663 +0x23e
 k8s.io/kubernetes/vendor/google.golang.org/grpc.(*Server).processUnaryRPC(0xc000a4f760, 0x4b45280, 0xc000b02d80, 0xc000847c00, 0xc000a61b00, 0x78c97c0, 0x0, 0x0, 0x0)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/google.golang.org/grpc/server.go:995 +0x466
 k8s.io/kubernetes/vendor/google.golang.org/grpc.(*Server).handleStream(0xc000a4f760, 0x4b45280, 0xc000b02d80, 0xc000847c00, 0x0)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/google.golang.org/grpc/server.go:1275 +0xda6
 k8s.io/kubernetes/vendor/google.golang.org/grpc.(*Server).serveStreams.func1.1(0xc000a8e9c0, 0xc000a4f760, 0x4b45280, 0xc000b02d80, 0xc000847c00)
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/google.golang.org/grpc/server.go:710 +0x9f
 created by k8s.io/kubernetes/vendor/google.golang.org/grpc.(*Server).serveStreams.func1
         /workspace/anago-v1.16.0-beta.1.787+48ca054daba9e6/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/google.golang.org/grpc/server.go:708 +0xa1
```

Fixes: dba434c4ba ("kubenet for ipv6 dualstack")
Signed-off-by: André Martins <aanm90@gmail.com>
2019-09-10 21:06:19 +02:00
zhuangqh
057caf7fcf kubelet: refactor server containerLogs test to table driven test
Signed-off-by: zhuangqh <zhuangqhc@gmail.com>
2019-09-09 10:04:45 +08:00
Ted Yu
253797acab Avoid conflicting log message when AddPodToVolume encounters error 2019-09-05 09:38:56 +08:00
Paul Fisher
d32aa6af1d Add comment for testing 100+ CPU usage 2019-09-04 11:49:15 -07:00
Carlos de Paula
8cd98fbd60 Bump gonvml module and remove CGO dependency.
Signed-off-by: Carlos de Paula <me@carlosedp.com>
2019-09-04 15:27:57 -03:00
Bruce Ma
f9169d29cb skip recording inputs & outputs in fake script plugin when CNI_COMMAND=VERSION
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-09-04 22:50:13 +08:00
Paul Fisher
f798cee51e pkg/kubelet: fix uint64 overflow when elapsed UsageCoreNanoSeconds exceeds 18446744073 2019-09-03 15:54:26 -07:00
Kubernetes Prow Robot
542f3c65a0
Merge pull request #78547 from MikeSpreitzer/fix-76699
Make iptables and ipvs modes of kube-proxy MASQUERADE --random-fully if possible
2019-09-03 14:34:58 -07:00
SataQiu
6d6b0be36b fix golint failures of pkg/kubelet 2019-09-02 17:47:08 +08:00
Mike Spreitzer
d86d1defa1 Made IPVS and iptables modes of kube-proxy fully randomize masquerading if possible
Work around Linux kernel bug that sometimes causes multiple flows to
get mapped to the same IP:PORT and consequently some suffer packet
drops.

Also made the same update in kubelet.

Also added cross-pointers between the two bodies of code, in comments.

Some day we should eliminate the duplicate code.  But today is not
that day.
2019-09-01 22:07:30 -04:00
Kubernetes Prow Robot
7d40536c81
Merge pull request #82024 from codenrhoden/mv-hostutil
Move HostUtil to pkg/volume/util/hostutil
2019-08-30 19:21:49 -07:00
Kubernetes Prow Robot
c86da8e2c1
Merge pull request #82048 from cheftako/kas-np4
Add support for konnectivity service to the etcd3 client.
2019-08-30 16:15:28 -07:00
Kubernetes Prow Robot
887edd2273
Merge pull request #82099 from lmdaly/single-numa-node-policy
Topology Manager Policy: single-numa-node
2019-08-30 11:21:26 -07:00
Walter Fender
edbb0fa2fe Add support for konnectivity service to the etcd3 client.
If konnectivity service is enabled, the etcd client will now use it.
This did require moving a few methods to break circular dependencies.

Factored in feedback from lavalamp and wenjiaswe.
2019-08-30 10:31:53 -07:00
Travis Rhoden
935c23f2ad
Move HostUtil to pkg/volume/util/hostutil
This patch moves the HostUtil functionality from the util/mount package
to the volume/util/hostutil package.

All `*NewHostUtil*` calls are changed to return concrete types instead
of interfaces.

All callers are changed to use the `*NewHostUtil*` methods instead of
directly instantiating the concrete types.
2019-08-30 10:14:42 -06:00
Kubernetes Prow Robot
9165f7bf56
Merge pull request #82104 from klueska/upstream-fix-cpu-manager-topology-bug
Fix bug in CPUManager with setting topology for policies
2019-08-30 08:00:44 -07:00
Kubernetes Prow Robot
f442b6ef32
Merge pull request #82090 from liggitt/webhook-http2
Use http/1.1 for apiserver->webhook clients
2019-08-30 06:26:54 -07:00
Antonio Ojea
cc7257b462
Kubenet can't fail fast on teardown 2019-08-30 10:19:10 +02:00
yuxiaobo
065343933d delete extra comma 2019-08-30 16:03:33 +08:00
Antonio Ojea
c1e3d375d4
Add IPv6 support to kubenet hostport 2019-08-30 09:59:43 +02:00
Louise Daly
8ad1b5ba3b Single-numa-node Topology Manager bug fix
Added one off fix for single-numa-node policy to correctly
reject pod admission on a resource allocation that spans
NUMA nodes

Co-authored-by: Kevin Klues <kklues@nvidia.com>
2019-08-30 07:17:56 +01:00
Louise Daly
f6c085f60e Added Single NUMA Node Policy which ensure resource are
aligned on a single NUMA node

Co-authored-by: Kevin Klues <kklues@nvidia.com>
2019-08-30 07:17:17 +01:00
Kevin Klues
5ed80dadcf Update CanAdmitPodResult() in TopologyManager to take a TopologyHint
Previously it only took a bool, which limited the logic it could perform
to determine if a pod should be admitted or not based on the merged hint
from the policy.
2019-08-30 07:17:17 +01:00
Kubernetes Prow Robot
7d6f8d8f69
Merge pull request #80570 from klueska/upstream-add-topology-manager-to-devicemanager
Add support for Topology Manager to Device Manager
2019-08-29 21:21:44 -07:00
Kubernetes Prow Robot
3ebe6a6a5f
Merge pull request #77807 from matthyx/startupProbe
Add startupProbe to health checks
2019-08-29 21:21:30 -07:00
Kubernetes Prow Robot
7da563f0f8
Merge pull request #81573 from irajdeep/irajdeep/change_runningPod_runningContainer_metrics
Convert kubelet metrics(running_pod_count and running_container_count) from non-standard prometheus collectors to standard gauges
2019-08-29 18:08:42 -07:00
Matthias Bertschy
a042a4b0ee startupProbe: make update 2019-08-30 00:42:43 +02:00
Matthias Bertschy
1a08ea5984 startupProbe: Test changes 2019-08-30 00:40:26 +02:00
Matthias Bertschy
323f99ea8c startupProbe: Kubelet changes 2019-08-30 00:40:26 +02:00
Kubernetes Prow Robot
a9e5c4d6e4
Merge pull request #81968 from mtaufen/node-csr-hash
derive node CSR hashes from public keys
2019-08-29 13:31:41 -07:00
Kubernetes Prow Robot
da986c56ab
Merge pull request #73944 from xiaoanyunfei/cleanup/rm_unuse_judge
rm unnecessary judgement
2019-08-29 13:30:57 -07:00
Kevin Klues
eb0216e54e Update semantics to set Preferred field in TopologyHint generation
We now only set Preferred to true if resources can be allocated with a
size equal to the minimimum _possible_ mask when all resources are
available.
2019-08-29 14:32:10 -05:00
Kevin Klues
e0e8b3e4fd Update CPUManager topology helpers to accept multiple ids 2019-08-29 13:22:54 -05:00
Rajdeep Das
c02d49d775 Update running_pod_count and running_container_count metric
As already mentioned in this issue https://github.com/kubernetes/kubernetes/issues/79286, some metrics like
"running_pod_count" and "running_container_count" uses non-standard prometheus metrics, this change converts them to be
standard prometheus gauges

Minor refactor in kubelet/pleg/generic.go and added some test for ruuning container and running pod metrics

Fixed issues related to github CI pipeline failure

* Updated bazel for new deps
* Add comment for exported metrics variables,RuuningContainerCount and RunningPodCount
* Specify keys explicitly in Guage metric instantation

Fix go lint errors

Replace "+=1" with "++", as reported by go lint

Set container state as a label for the metrics "running_container_count"

As per the metrics name "running_container_count" it should "ideally" be showing
the number of containers in "running" state , but it was showing all the container count, irrespective of the state it is in.
This commit adds a new label "container_running_state" to the metrics "running_container_count", which doesn't change the base metrics but adds the
option to query the metrics with "container_state" such as "running"/"unknown/...

remove unused methods reported by staticcheck

Remove variables while instantiating gauge(vec) which are default set to nil

Convert kubelet metrics(running_pod_count and running_container_count) to standard gauges and added label to running_container_count metrics.

Currently kubelet metrics(running_pod_count and running_container_count) use non-standard prometheus collectors , this change
converts them to standard prometheus gauges. Also this adds a new label(container_state) to running_container_count which does a breakdown of
containers tracked by kubelet based on the containers' state(running/unknown/created/exited).

Set statbility explicitly for running_pod_count and running_container_count and reformat test

register metrics explicitly in test , so that they don't become no-op
2019-08-29 17:23:04 +02:00
Kevin Klues
dcc9f66311 Add devicemanager tests for TopologyHint consumption 2019-08-29 08:22:50 -05:00
Kevin Klues
cc567afaf0 Consume TopologyHints in the devicemanager 2019-08-29 08:22:50 -05:00
Kevin Klues
a3320f80d9 Add devicemanager tests for TopologyHint generation 2019-08-29 07:45:43 -05:00
Kevin Klues
d3d7a8f5d4 Generate TopologyHints from the devicemanager 2019-08-29 07:45:43 -05:00
Louise Daly
9a118ceac4 Added stub support for Topology Manager to Device Manager
Co-authored-by: Conor Nolan <conor.nolan@intel.com>
Co-authored-by: Sreemanti Ghosh <sreemanti.ghosh@intel.com>
Co-authored-by: Kevin Klues <kklues@nvidia.com>
2019-08-29 07:45:43 -05:00
Kevin Klues
1c1f19c61c Change Topology.NUMANode in device plugin interface to a repeated field 2019-08-29 07:45:43 -05:00
Kubernetes Prow Robot
7d4d17583b
Merge pull request #81722 from klueska/upstream-add-socket-awreness-to-topologymanager
Add NUMA Node awareness to the TopologyManager
2019-08-29 05:30:58 -07:00
sunxiaofei03
45d41ed9e5 replace iteration with hashmap in *state_of_world 2019-08-29 19:22:25 +08:00
KEBE
8dc401d141 Fix sync pod log format and a func typo. 2019-08-29 14:39:43 +08:00
xieyanker
4b775046d4
remove stateCheckPeriod
If exec logForceCheckPeriod, there is no need to exec stateCheckPeriod
2019-08-29 11:06:45 +08:00
Kubernetes Prow Robot
ca5babc1da
Merge pull request #81534 from logicalhan/kubelet-migration
migrate kubelet's metrics/probes & metrics endpoint to metrics stability framework
2019-08-28 18:26:45 -07:00
Kevin Klues
ddfd9ac0ca Fix bug in CPUManager with setting topology for policies
Also add a check in the unit tests to avoid regressions
2019-08-28 17:32:25 -05:00
Jordan Liggitt
aef05c8dca Plumb NextProtos to TLS client config, honor http/2 client preference 2019-08-28 16:51:56 -04:00
Kubernetes Prow Robot
c6a506bb8c
Merge pull request #78174 from gaorong/oom-event
enrich kubelet system oom event message info
2019-08-28 12:01:13 -07:00
Han Kang
3a50917795 migrate kubelet's metrics/probes & metrics endpoint to metrics stability framework 2019-08-28 11:16:38 -07:00
Kevin Klues
df1b54fc09 Fail fast with TopologyManager on machines with more than 8 NUMA Nodes 2019-08-28 11:04:52 -05:00
Kevin Klues
5660cd3cfb Add NUMA Node awareness to the TopologyManager 2019-08-28 11:04:52 -05:00
Kubernetes Prow Robot
35867b160a
Merge pull request #81951 from klueska/upstream-update-cpu-amanger-numa-mapping
Update the CPUManager to include NUMANodeID in its topology information
2019-08-28 08:55:40 -07:00
Kubernetes Prow Robot
879418a714
Merge pull request #81828 from mars1024/bugfix/delete_lo_network
delete lo network when TearDownPod to avoid CNI cache leak
2019-08-28 03:09:11 -07:00
Kubernetes Prow Robot
de1cfa9bc1
Merge pull request #81787 from lmdaly/topology-manager-rename-strict-policy
Renaming strict policy to restricted policy
2019-08-28 01:38:04 -07:00
Kubernetes Prow Robot
08b67378d3
Merge pull request #81397 from ddebroy/win-socket
Support Kubelet PluginWatcher in Windows
2019-08-28 01:37:12 -07:00
Kubernetes Prow Robot
6cf7f3c342
Merge pull request #80320 from wk8/wk8/gmsa_cleanup
Make container removal fail if platform-specific containers fail
2019-08-27 22:41:29 -07:00
Deep Debroy
1321c9115b Support PluginWatcher in Windows
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2019-08-27 16:24:38 -07:00
Kevin Klues
f4dbd29cdb Rename TopologyHint.SocketAffinity to TopologyHint.NUMANodeAffinity
As part of this, update the logic to use the NUMA information instead of
the Socket information when generating and consuming TopologyHints in
the CPUManager.
2019-08-27 16:51:05 -05:00
Kevin Klues
ecc14fe661 Update CPUManager to include NUMANodeID in CPUTopology
Unfortunately, the NUMA information is not readily available from
cadvisor, so we have to roll the logic to discover it by hand. In the
future, we should remove this custiom code to use the information
provided by cadvisor once it is made available.
2019-08-27 16:51:05 -05:00
Kevin Klues
869962fa48 Cache the discovered topology in the CPUManager instead of MachineInfo 2019-08-27 16:23:07 -05:00
Michael Taufen
9dcf4d4ae2 derive node CSR hashes from public keys
These hashes were previously derived from the private key.
This is not a best practice. After this PR they are derived from public
keys.
2019-08-27 09:41:41 -07:00
Bruce Ma
ec342ec98f delete lo network when TearDownPod to avoid CNI cache leak
Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-08-27 19:26:23 +08:00
hwdef
9b3f577b1d fix typo in pkg 2019-08-26 09:25:39 +08:00
Kubernetes Prow Robot
f105fef3d5
Merge pull request #81429 from huffmanca/resize_block_volume
Enables resizing of block volumes.
2019-08-23 17:59:05 -07:00
Kubernetes Prow Robot
d5f9a81d0f
Merge pull request #79873 from tedyu/kube-runtime
Set runtimeState when RuntimeReady is not set or false
2019-08-23 17:58:37 -07:00
Kubernetes Prow Robot
0e1bad3764
Merge pull request #81747 from Random-Liu/fix-windows-log-follow
Fix windows kubectl log -f.
2019-08-23 06:53:24 -07:00
Kubernetes Prow Robot
10bd85a127
Merge pull request #81663 from jfbai/update-existing-node-lease-with-retry
Update existing node lease with retry.
2019-08-22 22:03:30 -07:00
Hemant Kumar
9dbe0b3ad8 Fix devicePath for raw block expansion
Fix tests
2019-08-22 22:48:46 -04:00
Jianfei Bai
aa173c834f Remove duplicated log. 2019-08-23 10:09:24 +08:00
Jean Rouge
4d4edcb27b Make container removal fail if platform-specific containers fail
https://github.com/kubernetes/kubernetes/pull/74737 introduced a new in-memory
map for the dockershim, that could potentially (in pathological cases) cause
memory leaks - for containers that use GMSA cred specs, get created
successfully, but then never get started nor removed.

This patch addresses this issue by making container removal fail altogether
when platform-specific clean ups fail: this allows clean ups to be retried
later, when the kubelet attempts to remove the container again.

Resolves issue https://github.com/kubernetes/kubernetes/issues/74843.

Signed-off-by: Jean Rouge <rougej+github@gmail.com>
2019-08-22 18:03:48 -07:00
Kubernetes Prow Robot
a3488b4cee
Merge pull request #81206 from tallclair/staticcheck-kubelet-push
Cleanup Kubelet static analysis issues
2019-08-22 15:09:43 -07:00
Kubernetes Prow Robot
37651f1cef
Merge pull request #80368 from danwinship/iptables-checks
iptables feature detection improvements
2019-08-22 13:31:20 -07:00
Christian Huffman
7a4cdf5ab2 Included resizing for CSI-based block volumes.
Perform a no-op when volume is of type raw block

Fix bug with checking volume mounts for readonly
2019-08-22 15:45:57 -04:00
Kubernetes Prow Robot
6b47754740
Merge pull request #81627 from tallclair/copy
Delete duplicate resource.Quantity.Copy()
2019-08-22 11:13:13 -07:00
Kubernetes Prow Robot
2af52db689
Merge pull request #81529 from tedyu/asoww-get-pod
Drop GetPods from ActualStateOfWorld
2019-08-22 08:43:24 -07:00
Kubernetes Prow Robot
53f4e0fa26
Merge pull request #57741 from dixudx/container_hash
Compute container hash based on API content, not go type
2019-08-22 08:42:46 -07:00
Louise Daly
2fb94231d0 Renaming strict policy to restricted policy
Restricted policy will fail admission of guaranteed pods where
all requested resources are not available on a single NUMA Node
2019-08-22 07:57:55 +01:00
Di Xu
739cdc8a8c Omit nil or empty field when calculating hash value 2019-08-22 13:46:52 +08:00
Kubernetes Prow Robot
ebf15029da
Merge pull request #80003 from wongma7/cloudprovider-authoritative-hostname
Fix cloud reported hostname being overridden if nodeIP set
2019-08-21 20:50:32 -07:00
Matthew Wong
fc28045220 Fix cloud reported hostname being overridden if nodeIP set 2019-08-21 19:07:12 -07:00
Lantao Liu
7767ff3bb2 Fix windows kubectl log -f. 2019-08-21 15:44:20 -07:00
Tim Allclair
a2c51674cf Cleanup more static check issues (S1*,ST*) 2019-08-21 10:40:21 -07:00
Tim Allclair
8a495cb5e4 Clean up error messages (ST1005) 2019-08-21 10:40:21 -07:00
Tim Allclair
e06912ca3e Clean up deprecated references 2019-08-21 10:40:21 -07:00
Tim Allclair
6510d26b6a Fix misc static check issues 2019-08-21 10:40:21 -07:00
Tim Allclair
3f510c69f6 Remove dead code from pkg/kubelet/... 2019-08-21 10:40:21 -07:00
Kubernetes Prow Robot
59d29b67d9
Merge pull request #59484 from verb/debug-kubelet-1
Add support for Ephemeral Containers to the kubelet
2019-08-21 00:29:17 -07:00
Jianfei Bai
7773662b6a Update existing node lease with retry. 2019-08-21 11:50:06 +08:00
Kubernetes Prow Robot
8cf05f514c
Merge pull request #79247 from egernst/kubelet-PodOverhead
Kubelet enabling to support pod-overhead
2019-08-20 13:27:15 -07:00
Lee Verberne
cb3976c02b Fix returning logs from ephemeral containers 2019-08-20 17:45:38 +00:00
Kubernetes Prow Robot
ddd45b7986
Merge pull request #80569 from klueska/upstream-get-topology-hints-map
Update GetTopologyHints() for TopologyManager Hint Providers to return a map
2019-08-20 00:15:34 -07:00
Tim Allclair
49f50484b8 Delete duplicate resource.Quantity.Copy() 2019-08-19 17:23:14 -07:00
Kubernetes Prow Robot
29c87cbfff
Merge pull request #80482 from mars1024/bugfix/cni_validation
add CNI config validation to getDefaultCNINetwork
2019-08-19 10:11:31 -07:00
Kubernetes Prow Robot
e319abf274
Merge pull request #81163 from jsafrane/skip-unused-volumes
Skip unused volumes in VolumeManager
2019-08-16 17:02:36 -07:00
Ted Yu
e85e0bafbd Drop GetPods from ActualStateOfWorld 2019-08-16 12:59:23 -07:00
Kubernetes Prow Robot
9b54021c65
Merge pull request #81456 from fredkan/bugfix/error-config-attachable-plugin
Bugfix/error config attachable plugin
2019-08-16 06:44:44 -07:00
Kevin Klues
4fdd52b058 Update GetTopologyHints() API to return a map
At present, there is no way for a hint provider to return distinct hints
for different resource types via a call to GetTopologyHints(). This
means that hint providers that govern multiple resource types (e.g. the
devicemanager) must do some sort of "pre-merge" on the hints it
generates for each resource type before passing them back to the
TopologyManager.

This patch changes the GetTopologyHints() interface to allow a hint
provider to pass back raw hints for each resource type, and allow the
TopologyManager to merge them using a single unified strategy.

This change also allows the TopologyManager to recognize which
resource type a set of hints originated from, should this information
become useful in the future.
2019-08-16 08:06:12 +02:00
Kubernetes Prow Robot
78a73e71a3
Merge pull request #81332 from cwdsuzhou/Aug/rwmutex_watchbaseManager
Use RWMutex in watchBasedManager
2019-08-15 16:18:35 -07:00
fredkan
67aeb09c6a error config attachable plugin 2019-08-15 22:29:18 +08:00
Kubernetes Prow Robot
273e9262bb
Merge pull request #80342 from draveness/feature/remove-critical-pod-annotation
feat: cleanup pod critical pod annotations feature
2019-08-15 07:20:34 -07:00
Kubernetes Prow Robot
f2dd24820a
Merge pull request #73920 from nolancon/topology-manager-cpu-manager
Changes to make CPU Manager a Hint Provider for Topology Manager
2019-08-15 05:44:33 -07:00
fredkan
6524b83d53 error config attachable plugin 2019-08-15 20:41:32 +08:00
Kubernetes Prow Robot
3645041af5
Merge pull request #81377 from sjenning/add-eviction-metrics
kubelet: add eviction counter to kubelet metrics
2019-08-15 02:32:46 -07:00
fredkan
87243f49a4 fix error set csiplugin attachable 2019-08-15 17:08:21 +08:00
Jan Safranek
5b69362ff0 Skip unused volumes in VolumeManager
DesiredStateOfWorldPopulator should skip a volume that is not used in any
pod. "Used" means either mounted (via volumeMounts) or used as raw block
device (via volumeDevices).

Especially when block feature is disabled, a block volume must not get into
DesiredStateOfWorld, because it would be formatted and mounted there.
2019-08-15 10:48:38 +02:00
Jan Safranek
8d580262f9 Refactor makeMountsMap into GetPodVolumeNames
The function will be handy in subsequent patches. Also change custom maps
into sets.String.
2019-08-15 10:48:38 +02:00
Kubernetes Prow Robot
f6a70ef271
Merge pull request #80376 from ehashman/issue-66790-2
Drop deprecated cadvisor metric labels
2019-08-14 09:10:38 -07:00
Kevin Klues
b3f4bed97f Add CPUManager tests for TopologyHint consumption 2019-08-14 06:22:56 +02:00
Kevin Klues
8278d1134c Consume TopologyHints in the CPUManager
Co-Authored-By: Conor Nolan <conor.nolan@intel.com>
2019-08-14 06:22:56 +02:00
Sreemanti Ghosh
7c626a2a00 Add CPUManager tests for TopologyHint generation
Co-Authored-By: Conor Nolan <conor.nolan@intel.com>
Co-Authored-By: Kevin Klues <kklues@nvidia.com>
2019-08-14 06:22:56 +02:00
Kevin Klues
156b3f6af8 Generate TopologyHints from the CPUManager 2019-08-14 06:22:56 +02:00
Kevin Klues
9a6788cb13 Add IterateSocketMasks() function to socketmask abstraction 2019-08-14 06:22:56 +02:00
Eric Ernst
476c1c7a2b kube-eviction: use common resource summation functions
Utilize resource helpers' GetResourceRequestQuantity instead of
duplicating the logic here.

Signed-off-by: Eric Ernst <eric.ernst@intel.com>
2019-08-13 16:23:28 -07:00
Seth Jennings
23b69cf02d kubelet: add eviction counter to metrics 2019-08-13 15:21:38 -05:00
Kubernetes Prow Robot
c505bb9533
Merge pull request #80985 from ethan-daocloud/patch-6
fixup: correct file name in log message
2019-08-13 12:29:42 -07:00
Kubernetes Prow Robot
ac2295a24d
Merge pull request #78587 from kad/socketmask-string
Use go standard library for common bit operations
2019-08-13 00:03:39 -07:00
caiweidong
92851d213a Use RWMutex in watchBasedManager 2019-08-13 13:09:21 +08:00
Kubernetes Prow Robot
76e19a1619
Merge pull request #81204 from codenrhoden/rename-hu-pathexists
Rename HostUtils.ExistsPath to PathExists
2019-08-12 20:12:12 -07:00
Kubernetes Prow Robot
56b5f8b47c
Merge pull request #80519 from ethan-daocloud/patch-1
fix typos in kubelet.go
2019-08-12 20:11:51 -07:00
Yuqi Wang
f82be3d3d0 Fix Container exit message lost due to FallbackToLogsOnError is not compatible with ContainerCannotRun 2019-08-12 16:15:59 +08:00
Kubernetes Prow Robot
46e58df837
Merge pull request #79578 from cezarsa/stable-node-images
kubelet: ensure stable order for images in node status
2019-08-10 08:59:12 -07:00
Kubernetes Prow Robot
c0997e8dc1
Merge pull request #81174 from answer1991/reduce-node-lease-get
reduce kubelet getting node lease
2019-08-10 02:59:26 -07:00
Ted Yu
3865e2b956 Set runtimeState when RuntimeReady is not set or false 2019-08-09 18:52:27 -07:00
Travis Rhoden
14e25b7c04
Rename HostUtils.ExistsPath to PathExists 2019-08-09 12:40:19 -06:00
Travis Rhoden
4574473753
Rename mount.NewOsExec to mount.NewOSExec 2019-08-09 12:30:56 -06:00
Bruce Ma
9903cb3ad3 add validation for CNI config before loading and fix some typo
1. add validation for CNI config before loading
2. make some CNI capabilities constants
3. add Capabilities field to cniNetwork struct

Signed-off-by: Bruce Ma <brucema19901024@gmail.com>
2019-08-09 21:22:23 +08:00
chenjun.cj
acdac6e999 reduce kubelet getting node lease 2019-08-09 19:00:50 +08:00
Kubernetes Prow Robot
d47f9ff132
Merge pull request #81086 from dims/fix-incorrect-readlink-check-for-checking-kernel-pids
[TOB-K8S-027] Fix Incorrect isKernelPid check
2019-08-08 17:58:04 -07:00
draveness
495faa22db feat: cleanup pod critical pod annotations feature 2019-08-09 08:41:23 +08:00
Kubernetes Prow Robot
aecc1e829c
Merge pull request #81083 from dims/fix-docker-daemon-process-name
[TOB-K8S-025] Incorrect docker daemon process name in container manager
2019-08-08 16:12:18 -07:00
Kubernetes Prow Robot
806ced34a4
Merge pull request #80491 from hpandeycodeit/static_pod_priority
Changed IsCriticalPod to return true in case of static pods
2019-08-08 16:11:39 -07:00
Johannes M. Scheuermann
a9cf6cec72 Correct typos in docs and add better explanation for burstrate 2019-08-08 22:11:40 +02:00
Johannes M. Scheuermann
cfb24eeebc Update internal traffic shaping docs 2019-08-08 16:26:21 +02:00
Kubernetes Prow Robot
ef8869466c
Merge pull request #80978 from wojtek-t/selflink_deprecation
Deprecate SelfLink and introduce feature gate to disable its propagation
2019-08-08 03:47:20 -07:00
Himanshu Pandey
c05d506019 changed IsCriticalPod to return true in case of static pods 2019-08-07 15:47:43 -07:00
Kubernetes Prow Robot
4c315aa8d9
Merge pull request #78543 from cheftako/kas-np3
Get network-proxy working with GCE.
2019-08-07 14:44:44 -07:00
Davanum Srinivas
bd925d6611 [TOB-K8S-027] Fix Incorrect isKernelPid check
isKernelPid should explicitly check the error returned from os.Readlink and return true
only if the error value is ENOENT. Without this fix, if Readlink
returned say ENAMETOOLONG or EACESS, we would still count the process as
a kernel process (which is not true).
2019-08-07 11:19:19 -04:00
Davanum Srinivas
bc71c23bee [TOB-K8S-025] Incorrect docker daemon process name in container manager
The container manager used in kubelet checks for docker daemon process either via pidfile
or process name. While the pidfile points to the docker daemon process PID, the
dockerProcessName constant stores a docker cli name ( docker ) instead of docker daemon
name ( dockerd ).
2019-08-07 10:59:37 -04:00
wojtekt
399d09ce4a Fix GetReference function 2019-08-07 16:49:29 +02:00
Conor Nolan
e33af11add Add stub support for TopologyManager to CPUManager
Co-Authored-By: Louise Daly <louise.m.daly@intel.com>
2019-08-07 15:56:05 +02:00
Walter Fender
ebb65c5f4c Get network-proxy working with GCE.
Got the proxy-server coming up in the master.
Added certs and have it comiung up with those certs.
Added a daemonset to run the network-agent.
Adding support for agent running as a sameon set on every node.

Added quick hack to test that proxy server/agent were correctly
tunneling traffic to the kubelet.

Added more WIP for reading network proxy configuration.
Get flags set correctly and fix connection services.
Adding missing ApplyTo
Added ConnectivityService.
Fixed build directives. Added connectivity service configuration.
Fixed log levels.
Fixed minor issues for feature turned off.
Fixed boilerplate and format.
Moved log dialer initialization earlier as per Liggits suggestion.
Fixed a few minor issues in the configuration for GCE.
Fixed scheme allocation
Adding unit test.
Added test for direct connectivity service.

Switching to injecting the Lookup method rather than using a Singleton.
First round of mikedaneses feedback.
Fixed deployment to use yaml and other changes suggested by MikeDanese.

Switched network proxy server/agent which are kebab-case not camelCase.
Picked up DIAL_RSP fix.
Factored in deads2k feedback.
Feedback from mikedanese
Factored in second round of feedback from David.
Fix path in verify.
Factored in anfernee's feedback.
First part of lavalamps feedback.
Factored in more changes from lavalamp and mikedanese.

Renamed network-proxy to konnectivity-server and konnectivity-agent.
Fixed tolerations and config file checking.
Added missing strptr
Finished lavalamps requested rename.
Disambiguating konnectivity service by renaming it egress selector.

Switched feature flag to KUBE_ENABLE_EGRESS_VIA_KONNECTIVITY_SERVICE
2019-08-06 23:09:49 -07:00
Kubernetes Prow Robot
7f1ae0e32d
Merge pull request #80105 from ASankaran/dockershim-linux
Add ImageFSInfo, ContainerStats, and ListContainerStats impl for linux to dockershim
2019-08-06 18:14:51 -07:00
Kubernetes Prow Robot
663796e624
Merge pull request #78345 from obitech/fix_golint_pkg_kubelet_stats_client
Fix golint pkg/kubelet/stats/client.go
2019-08-06 13:14:49 -07:00
Kubernetes Prow Robot
345e58b434
Merge pull request #75071 from mkimuram/issue/74552e2e
Fix volume reconstruction and add e2e tests
2019-08-06 06:05:55 -07:00
Kubernetes Prow Robot
1fcd3d6bac
Merge pull request #80369 from jsafrane/dswp-error
Propagate errors from DSW to pod events
2019-08-05 15:08:16 -07:00
Kubernetes Prow Robot
cea34cc1a5
Merge pull request #75303 from obitech/fix_golint_failures_pkg_kubelet
Fix golint failures in some pkg/kubelet packages
2019-08-05 15:07:50 -07:00
Mark Janssen
e58b4d4324 Fix golint failures of pkg/kubelet/qos 2019-08-05 15:54:15 +02:00
ethan
d21e9a8747
fixup: correct file name in log message 2019-08-05 21:31:38 +08:00
Jan Safranek
c744385804 Add limit of stored errors
There should be a limit so the set of errors does not grow too much in
case of some bug in the populator.
2019-08-05 10:06:44 +02:00
Jianfei Bai
5726b22fbc Move docker specific const to dockershim. 2019-08-05 10:28:08 +08:00
obitech
17d2ba0b3d Re-import api/core/install for init function 2019-08-03 21:07:12 +02:00
obitech
a5bc997aa9 Fixed pull-kubernetes-verify issues 2019-08-03 21:07:12 +02:00
obitech
457972f1a4 Fix suggestions, track removed library in bazel 2019-08-03 21:07:12 +02:00
obitech
898c40a484 Fix golint failures in some pkg/kubelet packages
Fixed:
- pkg/kubelet/pod
- pkg/kubelet/metrics
- pkg/kubelet/configmap
- pkg/kubelet/config
2019-08-03 21:07:12 +02:00
Lee Verberne
b5d592e735 Simplify VisitContainers pattern in volumemanager populator 2019-08-03 14:13:46 +00:00
Kubernetes Prow Robot
c63000ef81
Merge pull request #78793 from mattjmcnaughton/mattjmcnaughton/78629-fix-reserved-cgroup-systemd
Fix reserved cgroup systemd
2019-08-02 17:23:52 -07:00
Lee Verberne
906286c743 Change order kubelet starts containers
This starts ephemeral containers prior to init containers so that
ephemeral containers will still be started when init containers fail to
start.

Also improves tests and comments with review suggestions.
2019-08-02 19:56:38 +00:00
Masaki Kimura
c130b77a48 Move nil check for mapperPlugin earlier in reconstructVolume 2019-08-01 20:36:21 +00:00
Jan Safranek
bab81b809b Don't create mounter when reconstructing block volume
CSI mounter will create a new directory + json for a filesystem volume,
leading to even more orphaned files/directories.
2019-08-01 20:04:10 +00:00
Kubernetes Prow Robot
b91d64bfc1
Merge pull request #74423 from lmdaly/topology-manager-device-plugin-api-change
Device Plugin API change to include Topology Info in Devices
2019-08-01 11:52:31 -07:00
Kubernetes Prow Robot
93e6fb30f0
Merge pull request #74357 from lmdaly/topology-manager-container-manager
Updates to container manager and internal container lifecycle to accommodate TopologyManager
2019-08-01 11:52:17 -07:00
Dan Winship
81cd27a51e iptables: simplify version handling 2019-08-01 12:05:31 -04:00
Kubernetes Prow Robot
e8559f7565
Merge pull request #75229 from andrewsykim/kubelet-node-address-external
kubelet: lookup node address for external provider if none is set
2019-08-01 08:16:16 -07:00
Kubernetes Prow Robot
0775e6b2db
Merge pull request #80591 from danwinship/no-localhost-snat
hostport: Don't masquerade localhost-to-localhost traffic
2019-07-31 22:36:50 -07:00
Kubernetes Prow Robot
1a8844cd03
Merge pull request #80683 from moshe010/rename_files
TopologyManager: Fix rename best-effort policy files
2019-07-31 00:25:00 -07:00
Kubernetes Prow Robot
4f15c017ea
Merge pull request #80657 from rphillips/fixes/log_metrics_add_uid
kubelet: add UID to kubelet_container_log_filesystem_used_bytes metric
2019-07-30 08:53:43 -07:00
Kubernetes Prow Robot
b4f6b0bf50
Merge pull request #79963 from RainbowMango/pr_fix_typo_for_informer
Fix go lint error for cache directory
2019-07-30 05:33:03 -07:00
Kubernetes Prow Robot
4c191fde89
Merge pull request #73829 from alculquicondor/fix/comment
Fix/Add comments on cadvisor implementations
2019-07-30 05:32:51 -07:00
Kubernetes Prow Robot
40b31794ab
Merge pull request #79623 from aaronbbrown/abb-quote-container-in-use
quote container name in container already use error matching
2019-07-30 03:35:31 -07:00
Kubernetes Prow Robot
320bc21dbe
Merge pull request #78762 from klueska/upstream-inherit-cpus-from-init-containers
Proactively remove init Containers in CPUManager static policy
2019-07-30 03:35:18 -07:00
Aldo Culquicondor
a626a2972e Fix/Add comments on cadvisor implementations
Fix lint issues.

Signed-off-by: Aldo Culquicondor <acondor@google.com>
2019-07-29 09:31:35 -04:00
Kubernetes Prow Robot
f18833ee58
Merge pull request #80429 from gaorong/expose-node-lease-renewal-frequency
kubelet: change node-lease-renew-interval to 0.25 of lease-renew-duration
2019-07-29 02:29:56 -07:00
Rong Gao
cda783699b change node-lease-renew-interval to 0.25 of renew-duration
0.25 is a dedicated value to align before default value
of renew-interval but get more heuristic interval
2019-07-29 15:02:11 +08:00
Moshe Levi
3b83c5c7c6 TopologyManager: Fix rename best-effort policy files
PR https://github.com/kubernetes/kubernetes/pull/80301 rename
the preferred policy to best-effort, but the files names are
still policy_preferred.go and policy_preferred_test.go. This
PR fix that.
2019-07-28 19:35:16 +03:00
Kubernetes Prow Robot
23649560c0
Merge pull request #80301 from klueska/upstream-rename-topologymanager-preferred-best-effort
Rename 'preferred' TopologyManager policy to 'best-effort'
2019-07-27 09:25:56 -07:00
RainbowMango
0e0e1f7dab 1. Fix lint errors for the whole directory staging/src/k8s.io/client-go/tools/cache;
2. Remove staging/src/k8s.io/client-go/tools/cache from .golint_failures;
3. Fix some typo from comments.
2019-07-27 15:49:03 +08:00
Ryan Phillips
2bdf975d5b kubelet: add UID to kubelet_container_log_filesystem_used_bytes metric
buildPodRef creates a unique key with the {podName, namespace, UID}
tuple. By omitting the UID in the metric, duplicate metrics can be sent
to prometheus causing 500's on the /metrics endpoint.
2019-07-26 14:59:43 -05:00
Kevin Klues
9f36f1a173 Add tests for proactive init Container removal in the CPUManager static policy 2019-07-26 14:34:51 +02:00