Commit Graph

5813 Commits (13b12e89408869c5b560a81e95bca33267bdb8e1)

Author SHA1 Message Date
Kubernetes Submit Queue 94327c5f72
Merge pull request #56754 from dims/remove-hacks-for-mesos
Automatic merge from submit-queue (batch tested with PRs 57127, 57011, 56754, 56601, 56483). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove hacks added for mesos

**What this PR does / why we need it**:

Since Mesos is no longer in your main repository and since we have
things like dynamic kubelet configuration in progress, we should
drop these undocumented, untested, private hooks.

cmd/kubelet/app/server.go::CreateAPIServerClientConfig
CreateAPIServerClientConfig::getRuntime
pkg/kubelet/kubelet_pods.go::getPhase

Also remove stuff from Dependencies struct that were specific to
the Mesos integration (ContainerRuntimeOptions and Options)

Also remove stale references in test/e2e and and test owners file


**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
Drop hacks used for Mesos integration that was already removed from main kubernetes repository
```
2017-12-17 06:25:56 -08:00
Kubernetes Submit Queue 8395775176
Merge pull request #57011 from m1093782566/kubenet-promisc
Automatic merge from submit-queue (batch tested with PRs 57127, 57011, 56754, 56601, 56483). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

check and set promiscuous mode with netlink because netlink already supports it

**What this PR does / why we need it**:

check and set promiscuous mode with netlink because netlink already supports it.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

I wanted to add tests for the changes, however I found upstream CI does not allow UT acquire root privilege :(

**Release note**:

```release-note
NONE
```

/sig network
2017-12-17 06:25:53 -08:00
Kubernetes Submit Queue 380c2b6d0b
Merge pull request #55692 from vikaschoudhary16/dpUT
Automatic merge from submit-queue (batch tested with PRs 56386, 57204, 55692, 57107, 57177). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor TestPodContainerDeviceAllocation for extensiblity/readability

**What this PR does / why we need it**:
This PR refactors and reorganizes TestPodContainerDeviceAllocation(). This PR changes the logic to use array for iterating over test conditions and other refactoring such as moving test pod creation logic to a separate function. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
cc @sjenning @jeremyeder @RenaudWasTaken @vishh @mindprince @jiayingz @ScorpioCPH

/sig node
2017-12-17 04:19:42 -08:00
Kubernetes Submit Queue f7ef915b58
Merge pull request #57141 from andyxning/fix_magic_string_for_runtime_type
Automatic merge from submit-queue (batch tested with PRs 57148, 57123, 57091, 57141, 57131). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix magic string for runtime type

**What this PR does / why we need it**:
This PR correct the magic string about container runtime to the constants.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:
This PR correct the magic string about container runtime to the constants.
**Release note**:

```release-note
None
```
2017-12-16 21:00:48 -08:00
vikaschoudhary16 8c51d235d6 Refactor TestPodContainerDeviceAllocation to make it readable and extensible 2017-12-16 20:32:08 -05:00
Kubernetes Submit Queue ea55d70ee7
Merge pull request #56921 from andyzhangx/flexvolume-windows
Automatic merge from submit-queue (batch tested with PRs 56650, 55813, 56911, 56921, 56871). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

enable flexvolume on Windows node

**What this PR does / why we need it**:
enable flexvolume on Windows node:
current PodVolumeDir is like 
`\var\lib\kubelet\pods\f54c5a74-da63-11e7-b71a-000d3a02c330\volumes\test~hostpath.cmd\flextest`
which is a unix path, with this PR, PodVolumeDir in **windows** kubelet  will be converted into like
`c:\var\lib\kubelet\pods\f54c5a74-da63-11e7-b71a-000d3a02c330\volumes\test~hostpath.cmd\flextest` 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56875

**Special notes for your reviewer**:
Detailed steps about how to use flexvolume on Windows with this PR:
https://github.com/andyzhangx/Demo/tree/master/windows/flexvolume

**Release note**:

```
enable flexvolume on Windows node
```

/sig windows
2017-12-16 12:10:51 -08:00
Kubernetes Submit Queue a902959544
Merge pull request #56911 from WanLinghao/projected_test_fix
Automatic merge from submit-queue (batch tested with PRs 56650, 55813, 56911, 56921, 56871). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix deviceplugin test file create leak file problem

When execute make test, this test file will create a file named "kubelet_internal_checkpoint" in k8s directory and not delete it.

This patch fix this error




**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56365

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2017-12-16 12:10:48 -08:00
Kubernetes Submit Queue d936754269
Merge pull request #56287 from stewart-yu/removeDeprecatedCode
Automatic merge from submit-queue (batch tested with PRs 54902, 56831, 56702, 56287, 56878). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove the kubelet's `--cloud-provider=auto-detect` feature

**What this PR does / why we need it**:
 Set no cloud provider as the default in kubelet, remove deprecated explain and variable.
This PR covers step 3:
 `v1.10 - completely remove the option to use auto-detect`

For more details [https://github.com/kubernetes/kubernetes/issues/50986](https://github.com/kubernetes/kubernetes/issues/50986)

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes [https://github.com/kubernetes/kubernetes/issues/50986](https://github.com/kubernetes/kubernetes/issues/50986)

**Special notes for your reviewer**:

**Release note**:

```release-note
[action required] Remove the kubelet's `--cloud-provider=auto-detect` feature
```
2017-12-16 09:33:42 -08:00
Kubernetes Submit Queue 8415e0c608
Merge pull request #56661 from xiangpengzhao/move-kubelet-constants
Automatic merge from submit-queue (batch tested with PRs 56410, 56707, 56661, 54998, 56722). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move some kubelet constants to a common place

**What this PR does / why we need it**:
More context, see: https://github.com/kubernetes/kubernetes/issues/56516
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56516
[thanks @ixdy for verifying this!]

**Special notes for your reviewer**:
@ixdy how can I verify #56516 against this locally?

/cc @ixdy @mtaufen 

**Release note**:

```release-note
NONE
```
2017-12-16 05:46:35 -08:00
vikaschoudhary16 a71d1680d4 Add vikaschoudhary16 as reviewer in pkg/kubelet/cm/deviceplugin 2017-12-16 08:19:36 -05:00
Andy Xie 81897022db fix magic string for runtime type 2017-12-16 19:19:49 +08:00
Kubernetes Submit Queue fa0a1a3d7a
Merge pull request #56337 from mindprince/container-manager-cleanup
Automatic merge from submit-queue (batch tested with PRs 56337, 56546, 56550, 56633, 56635). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove redundant code in container manager.

- Reuse stub implementations from unsupported implementations.
- Delete test file that didn't contain any tests.

**Release note**:
```release-note
NONE
```

/kind cleanup
/sig node
2017-12-16 01:53:42 -08:00
Kubernetes Submit Queue e8d7835bc6
Merge pull request #56579 from php-coder/rm_unused_member_from_tests
Automatic merge from submit-queue (batch tested with PRs 56579, 55236, 56512, 56549, 56538). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

security_context_test.go(TestVerifyRunAsNonRoot): remove unused variables

**What this PR does / why we need it**:
This PR removed unused member and related variables from the test.

**Special notes for your reviewer**:
It's better to review this PR in the mode that ignore whitespace-related changes: https://github.com/kubernetes/kubernetes/pull/56579/files?w=1

**Release note**:
```release-note
NONE
```

CC @simo5
2017-12-15 21:19:34 -08:00
Kubernetes Submit Queue 3abbd6fb1f
Merge pull request #56298 from pospispa/566-improvements-suggested-by-thockin-during-review-of-PR55824
Automatic merge from submit-queue (batch tested with PRs 56401, 56506, 56551, 56298, 56581). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Addressing Comments from Code Review

**What this PR does / why we need it**: addressing comments from code review: https://github.com/kubernetes/kubernetes/pull/55824#pullrequestreview-78597250

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: N/A


**Special notes for your reviewer**:
@thockin @jsafrane @msau42 PTAL

**Release note**:

```release-note
NONE
```
2017-12-15 20:29:36 -08:00
Kubernetes Submit Queue 50ccec99c5
Merge pull request #56506 from sjenning/show-err-event-create-sandbox-fail
Automatic merge from submit-queue (batch tested with PRs 56401, 56506, 56551, 56298, 56581). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: include runtime error in event on CreatePodSandbox failure

Include the error from the runtime in the event message when CreatePodSandbox fails.  The sandbox creation can fail for many reasons and including the error makes the situation easier to debug.

The event for failed PodSandboxStatus includes this information so there is already precedent for doing this.

xref https://bugzilla.redhat.com/show_bug.cgi?id=1506813

@eparis @derekwaynecarr @dchen1107 @vishh 

/release-note-none
/sig node
2017-12-15 20:29:31 -08:00
David Zhu fffd152e0d Fixed kubelet error message to be more descriptive. Added Attach success event for help in debugging. 2017-12-15 15:36:59 -08:00
Kubernetes Submit Queue 2d57d9b1ea
Merge pull request #56146 from jiulongzaitian/style_code
Automatic merge from submit-queue (batch tested with PRs 57172, 55382, 56147, 56146, 56158). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

delete useless params containerized

Signed-off-by: zhangjie <zhangjie0619@yeah.net>



**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
     delete useless params containerized
```
2017-12-14 12:38:19 -08:00
Kubernetes Submit Queue 578f3db8d5
Merge pull request #55382 from vikaschoudhary16/checkpoint
Automatic merge from submit-queue (batch tested with PRs 57172, 55382, 56147, 56146, 56158). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use file store utility for device plugin checkpointing

Partially address issue #54088
cc @sjenning @jeremyeder @jiayingz @vishh 

/sig node
2017-12-14 12:38:13 -08:00
Kubernetes Submit Queue 7908e96539
Merge pull request #56191 from ConnorDoyle/cpu-manager-panic-state-init-error
Automatic merge from submit-queue (batch tested with PRs 54410, 56184, 56199, 56191, 56231). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

CPU Manager panics on state initialization error.

**What this PR does / why we need it**:

- CPU Manager panics on state initialization error.
- Update unit tests accordingly.
- Minor related cleanup in `state_file.go`.

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```

/kind bug
/sig node
/priority important-soon
Blocks #52031
/assign @balajismaniam 
cc @flyingcougar
2017-12-14 05:33:17 -08:00
Kubernetes Submit Queue e9a9da8aa3
Merge pull request #54410 from intelsdi-x/cpu-reconcile-state
Automatic merge from submit-queue (batch tested with PRs 54410, 56184, 56199, 56191, 56231). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Cpu manager reconcile loop - restore state

**What this PR does / why we need it**:
Cpu manager reconcile loop can add orphaned containers to `State` calling `policy.AddContainer()`
Previous PR: #54409 
e2e tests PR: #53378

Blocked by #56191
2017-12-14 05:33:08 -08:00
Kubernetes Submit Queue d5e3a792eb
Merge pull request #55145 from huangjiuyuan/fix-manager-typo
Automatic merge from submit-queue (batch tested with PRs 52259, 53951, 54385, 54805, 55145). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix a typo in NewManager function

**What this PR does / why we need it**:
Fix a typo in NewManager function

**Special notes for your reviewer**:

**Release note**:

`None`
2017-12-13 21:26:05 -08:00
Kubernetes Submit Queue 65a7ecf147
Merge pull request #57045 from ConnorDoyle/add-connor-containermanager-owners
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add ConnorDoyle as approver in /pkg/kubelet/cm.

**What this PR does / why we need it**:
- Add github user `ConnorDoyle` (me) to the approvers list for `pkg/kubelet/cm`.

**Special notes for your reviewer**:
I would like to help with the review load in this package. I believe I have demonstrated good stewardship of sub-packages in this part of the code base.

```release-note
NONE
```

/sig node
/kind cleanup
/assign @derekwaynecarr
2017-12-13 19:32:53 -08:00
Kubernetes Submit Queue 38e3351312
Merge pull request #56818 from jiayingz/init-container-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Re-uses device plugin resources allocated to init containers.

Implements option 2 mentioned in
https://github.com/kubernetes/kubernetes/issues/56022#issuecomment-348286184



**What this PR does / why we need it**:
This PR implements the option 2 solution discussed in https://github.com/kubernetes/kubernetes/issues/56022#issuecomment-348286184.
This is one of short-term fix we are considering for a 1.9 patch release. The alternative is to disallow requesting device plugin resources in init containers,
as PR https://github.com/kubernetes/kubernetes/pull/56659 is taking.
The long-term fix we want to implement for 1.10 is still open to discussion.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes https://github.com/kubernetes/kubernetes/issues/56022

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2017-12-12 17:25:56 -08:00
Kubernetes Submit Queue 7320a45fc2
Merge pull request #57054 from dims/use_cadvisor_constant_cri_endpoint
Automatic merge from submit-queue (batch tested with PRs 56529, 57054). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet should use the value of the cri container runtime endpoint fr…

…om cadvisor



**What this PR does / why we need it**:
To make cri container runtime endpoint consistent, kubelet (currently using "/var/run/crio.sock" ) should use value of CrioSocket exactly as defined in cadvisor.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #57005

**Special notes for your reviewer**:

**Release note**:

```release-note
Use the same value for cri container runtime endpoint as defined in cadivsor/crio
```
2017-12-12 14:04:14 -08:00
Davanum Srinivas 7b4311e518 kubelet should use the value of the cri container runtime endpoint from cadvisor 2017-12-11 15:37:12 -05:00
Di Xu 4f400e5d2f ignore images in used by running containers when GC 2017-12-11 15:20:55 +08:00
m1093782566 f7611017e9 check and set promiscuous mode with netlink because vishvananda/netlink already supports it 2017-12-11 10:39:57 +08:00
lichuqiang 096cc665ff fix bug in container lifecycle event generation 2017-12-11 10:15:39 +08:00
andyzhangx 5c7a1a2c5d enable flexvolume on Windows 2017-12-07 06:24:20 +00:00
WanLinghao 3e7e4ab397 old test file will create a leak file in current directory.
this patch fix this.
	modified:   pkg/kubelet/cm/deviceplugin/manager_test.go
2017-12-07 11:57:17 +08:00
Connor Doyle 4207b4fd2c Add ConnorDoyle as approver in /pkg/kubelet/cm. 2017-12-06 09:05:59 -06:00
Jiaying Zhang d4244f3ded Re-uses device plugin resources allocated to init containers.
Implements option 2 mentioned in
https://github.com/kubernetes/kubernetes/issues/56022#issuecomment-348286184
2017-12-04 22:01:28 -08:00
David Ashpole 0e38a0e7dd fake docker client can remove containers which have not been started 2017-12-04 14:18:32 -08:00
Davanum Srinivas 7568462ec3 Remove hacks added for mesos
Since Mesos is no longer in your main repository and since we have
things like dynamic kubelet configuration in progress, we should
drop these undocumented, untested, private hooks.

cmd/kubelet/app/server.go::CreateAPIServerClientConfig
CreateAPIServerClientConfig::getRuntime
pkg/kubelet/kubelet_pods.go::getPhase

Also remove stuff from Dependencies struct that were specific to
the Mesos integration (ContainerRuntimeOptions and Options)

Also remove stale references in test/e2e and and test owners file
2017-12-03 13:52:30 -05:00
Vladimir Vivien 7405159558 VolumeHost.GetNodeName method added for CSI fix 2017-12-02 05:54:54 -05:00
xiangpengzhao 8048823d0e Auto generated BUILD files. 2017-12-01 11:24:41 +08:00
xiangpengzhao 1f2262e6b0 Move some kubelet constants to a common place. 2017-12-01 11:24:04 +08:00
Kubernetes Submit Queue 2ca21edd00
Merge pull request #56503 from php-coder/fail_non_root_verification
Automatic merge from submit-queue (batch tested with PRs 56589, 56503). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

MustRunAsNonRoot should reject a pod if it has non-numeric USER

**What this PR does / why we need it**:
This PR modifies kubelet behavior to reject pods with non-numeric USER instead of showing a warning.

**Special notes for your reviewer**:
Related discussion: https://github.com/kubernetes/community/pull/756#discussion_r143694443

**Release note**:
```release-note
kubelet: fix bug where `runAsUser: MustRunAsNonRoot` strategy didn't reject a pod with a non-numeric `USER`.
```

PTAL @pweil- @tallclair @liggitt @Random-Liu
CC @simo5 @adelton
2017-11-30 12:07:48 -08:00
tianshapjq 0cc6a4d937 new testcase to cgroup_manager_linux.go 2017-11-30 14:14:59 +08:00
Slava Semushin 0512f2b448 security_context_test.go(TestVerifyRunAsNonRoot): remove unused variables. 2017-11-29 16:10:07 +01:00
Slava Semushin 445393fdce kubelet: MustRunAsNonRoot should reject a pod if it has non-numeric USER. 2017-11-29 16:00:00 +01:00
pospispa e1312f2c00 Addressing Comments from Code Review
Addressing comments from code review (https://github.com/kubernetes/kubernetes/pull/55824#pullrequestreview-78597250) in order to simplify the code.
2017-11-29 15:50:23 +01:00
Kubernetes Submit Queue 4480204070
Merge pull request #55026 from dashpole/network_mock_docker
Automatic merge from submit-queue (batch tested with PRs 55893, 55906, 55026). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[Test Fix] Mock docker network dependencies and fix filtering bug

This PR only affects the mocked docker runtime, and has no impact on the kubelet.

Issue #53327 

When kubernetes creates a pod using the docker shim, it creates a container which contains the pod's network namespace, and then creates containers which specify that namespace.
The current mocked docker does not mock this interaction, and thus allows a container to be created even when the container whose network it is joining does not exist.
This allows the mocked kubelet to end up in a state where the pod does not exist, but a container in the pod does, and this breaks pod deletion.

This fixes the above by only allowing containers to be started if the container whose network it is trying to join is running.

Additionally, this PR fixes a filtering bug where we were incorrectly comparing docker container statuses.

/assign @shyamjvs 
can you test this to see if it fixes the issue?
/assign @Random-Liu 
for approval after @shyamjvs confirms this works.
2017-11-28 18:24:56 -08:00
David Ashpole 63f7836d39 mock container networking and fix filtering bug 2017-11-28 15:32:18 -08:00
Kubernetes Submit Queue 8226973ae8
Merge pull request #52144 from andyxning/fix_network_value_for_stats_summary
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix network value for stats summary for multiple network interfaces

This PR is part of [Heapster #1788](https://github.com/kubernetes/heapster/pull/1788). 

The original reason is when there are more than one none `lo`, `docker0`, `veth` network interfaces instead of just one `eth0`, the network interface value is only partial and does not correct. For now, summary stats api only gets the eth0 network interface values.

The original issues about this can be find in [Heapster #1058](https://github.com/kubernetes/heapster/issues/1058) and [Cadvisor #1593](https://github.com/google/cadvisor/issues/1593).

```release-note
Fix stats summary network value when multiple network interfaces are available.
```

/cc @DirectXMan12 @piosz @xiangpengzhao @vishh @timstclair
2017-11-28 14:59:08 -08:00
Seth Jennings 5f6699ebc5 kubelet: include runtime error in event on CreatePodSandbox failure 2017-11-28 12:07:11 -06:00
stewart-yu 8dc1c5ea4f auto-generated BUILD file 2017-11-28 09:55:24 +08:00
stewart-yu 50520be649 completely remove the option to use auto-detect 2017-11-28 09:54:28 +08:00
Szymon Scharmach 552e4d3a9d Cpu manager reconclie loop can restore state 2017-11-27 11:22:21 +01:00
vikaschoudhary16 de358fb21f Use file store utility for device plugin check-pointing 2017-11-24 08:41:11 -05:00
Rohit Agarwal 4b216f7cd9 Remove redundant code in container manager.
- Reuse stub implementations from unsupported implementations.
- Delete test file that didn't contain any tests.
2017-11-24 03:15:55 -08:00
pospispa 4d6d9817b0 PVC Being Deleted Checks in kubelet
Kubelet must not start pods that use PVCs that are being
deleted.
2017-11-23 11:41:30 +01:00
Kubernetes Submit Queue 76e2bed9b1
Merge pull request #55810 from abhi/cri_stats
Automatic merge from submit-queue (batch tested with PRs 54843, 55810). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Integrating cadvisor stats to CRI Pod stats collection

For kubernetes-incubator/cri-containerd#341



**What this PR does / why we need it**:
This PR contains changes to update kubelet to consume metrics from both CRI and cadvisor for Pod stats. The corresponding cadvisor changes are here https://github.com/google/cadvisor/pull/1795.
Today CRI stats provides only core metrics such as CPU Usage, Memory Usage, Disk Usage. However the stats exposed by kubelet which is a superset of core metrics and Network, User Defined Metrics are not provided by CRI stats. Hence kubelet stats are extracted from 2 sources , CRI stats and cadvisor stats. 
After the change the summary stats for a CRI based runtime (containerd) is as show here:
https://gist.github.com/abhi/d7351861df6430eb4bc5d711d274ec35

This PR also contains test case change to reflect the stats for cri stats provider. 

**Which issue(s) this PR fixes** :
Fixes # https://github.com/kubernetes-incubator/cri-containerd/issues/341

**Special notes for your reviewer**:
https://docs.google.com/presentation/d/1Os3nyMRBlFuiBLCjPgeaPv6jXylrZW5jiDXJejlA3Wg/edit#slide=id.g27cb4cb6d8_0_0

Godep will be updated to main tree after https://github.com/google/cadvisor/pull/1795 PR is merged.

**Release note**:

```release-note
Kubelet can provide full summary api support except container log stats for CRI container runtime now.
```
cc @Random-Liu
2017-11-23 01:13:18 -08:00
abhi e19f213027 Modifying cri stats test cases
This commit container modification to cri stats test
to verify CPU, Memory, Network stats collected by
cadvisor.

Signed-off-by: abhi <abhi@docker.com>
2017-11-22 22:48:43 -08:00
abhi 84b0e82db4 Integrating cadvisor stats to CRI Pod stats collection
This commit addresses the issue described here
https://github.com/kubernetes-incubator/cri-containerd/issues/341
The changes include using cadvisor stats in addition to CRI stats
for CRI runtimes. As described in the issue above , the CRI stats
currently doesnt provide all the necessary stats for the kubelet.
This commit addreses the need to extract stats from cadvisor which
is not available as CRI stats.

Signed-off-by: abhi <abhi@docker.com>
2017-11-22 22:48:37 -08:00
Kubernetes Submit Queue 1fdc688638
Merge pull request #55450 from feiskyer/seccomp-path
Automatic merge from submit-queue (batch tested with PRs 55952, 49112, 55450, 56178, 56151). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix the wrong localhost seccomp path of CRI

**What this PR does / why we need it**:

Fix the wrong seccomp path comment.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55359

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix CRI localhost seccomp path in format localhost//profileRoot/profileName.
```
2017-11-22 21:48:45 -08:00
Kubernetes Submit Queue 83e46f0a9e
Merge pull request #55902 from yguo0905/annotations
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Expose single annotation/label via downward API

**What this PR does / why we need it**:

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/node/annotations-downward-api.md

Support exposing single annotation via both env and volume downward API using the following syntax:

```
metadata.annotations['key']
metadata.labels['key']
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

#31218

**Special notes for your reviewer**:

This PR takes over the work in https://github.com/kubernetes/kubernetes/pull/41648.

**Release note**:

```
A single value in metadata.annotations/metadata.labels can be passed into the containers via Downward API
```

/assign @thockin @vishh
2017-11-22 18:54:29 -08:00
Kubernetes Submit Queue 7dd41577e3
Merge pull request #55815 from gnufied/implement-node-fs-resize
Automatic merge from submit-queue (batch tested with PRs 55545, 55548, 55815, 56136, 56185). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Implement node fs resize

Implement kubelet side resizing of file system.

xref - https://github.com/kubernetes/features/issues/284 

```release-note
Implement kubelet side file system resizing. Also implement GCE PD resizing
```
2017-11-22 16:52:29 -08:00
Hemant Kumar 2f2a643684 Implement file system resizing support on kubelet start
Update bazel files
Fix operation executor tests
2017-11-22 16:06:10 -05:00
Yang Guo 34a7b3dea8 Create a separate conversion function for the field labels used by downward API 2017-11-22 11:02:20 -08:00
Connor Doyle 4f185e6b7f CPU Manager panics on state initialization error.
- Update unit tests accordingly.
- Minor related cleanup in state_file.go
2017-11-22 10:25:38 -08:00
Jing Xu a66ee2eb3f Add pod-level metric for CPU and memory stats
This PR adds the pod-level metrics for CPU and memory stats. cAdvisor
can get all pod cgroup information so we can add this pod-level CPU and
memory stats information from the corresponding pod cgroup
2017-11-22 09:25:23 -08:00
Kubernetes Submit Queue d09f679459
Merge pull request #55143 from feiskyer/version
Automatic merge from submit-queue (batch tested with PRs 56115, 55143, 56179). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use GetVersion() API instead of ver command

**What this PR does / why we need it**:

Should use GetVersion vs Shelling out to ver.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55083

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-22 02:56:26 -08:00
Kubernetes Submit Queue db7bb9e2ed
Merge pull request #51494 from mtanino/pr/BlockVolumesSupport-volumemanager
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Block volumes Support: CRI, volumemanager and operationexecutor changes

**What this PR does / why we need it**:
This PR contains following items to enable block volumes support feature.
- container runtime interface change
- volumemanager changes
- operationexecuto changes


**Which issue this PR fixes**:
Based on this proposal (kubernetes/community#805) and this feature issue: kubernetes/features#351

**Special notes for your reviewer**:

There are another PRs related to this functionality.
(#50457) API Change
(#53385) VolumeMode PV-PVC Binding change
(#51494) Container runtime interface change, volumemanager changes, operationexecutor changes
(#55112) Block volume: Command line printer update
Plugins
(#51493) Block volumes Support: FC plugin update
(#54752) Block volumes Support: iSCSI plugin update

**Release note**:
```
Adds alpha support for block volume, which allows the users to attach raw block volume to their pod without filesystem on top of the volume.
```
/cc @msau42 @liggitt @jsafrane @saad-ali @erinboyd @screeley44
2017-11-21 19:43:27 -08:00
Kubernetes Submit Queue 3bb6eeeb07
Merge pull request #55340 from jiayingz/metrics
Automatic merge from submit-queue (batch tested with PRs 55340, 55329, 56168, 56170, 56105). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adds device plugin allocation latency metric.

For #53497


**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2017-11-21 18:56:29 -08:00
Pengfei Ni b8469e4a25 Update bazel and remove unused data files 2017-11-22 02:50:08 +00:00
Pengfei Ni 7e21146096 Verify seccomp absolute path in dockershim 2017-11-22 02:49:52 +00:00
Pengfei Ni 2a2a875686 Fix incorrect localhost seccomp profile path 2017-11-22 02:49:23 +00:00
Kubernetes Submit Queue 277d866111
Merge pull request #50984 from timothysc/checkpoint
Automatic merge from submit-queue (batch tested with PRs 55812, 55752, 55447, 55848, 50984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Initial basic bootstrap-checkpoint support

**What this PR does / why we need it**:
Adds initial support for Pod checkpointing to allow for controlled recovery of the control plane during self host failure conditions. 

fixes #49236
xref https://github.com/kubernetes/features/issues/378

**Special notes for your reviewer**:

Proposal is here: https://docs.google.com/document/d/1hhrCa_nv0Sg4O_zJYOnelE8a5ClieyewEsQM6c7-5-o/edit?ts=5988fba8#

1. Controlled tests work, but I have not tested the self hosted api-server recovery, that requires validation and logs.  /cc @luxas 
2. In adding hooks for checkpoint manager much of the tests around basicpodmanager appears to be stub'd.  This has become an anti-pattern in the code and should be avoided.  
3. I need a node-e2e to ensure consistency of behavior. 

**Release note**:
```
Add basic bootstrap checkpointing support to the kubelet for control plane recovery
```

/cc @kubernetes/sig-cluster-lifecycle-misc @kubernetes/sig-node-pr-reviews
2017-11-21 17:57:40 -08:00
Kubernetes Submit Queue 8a5cf788b0
Merge pull request #55848 from MrHohn/custom-pod-dns-api
Automatic merge from submit-queue (batch tested with PRs 55812, 55752, 55447, 55848, 50984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add Custom Pod DNS to Kubernetes API

**What this PR does / why we need it**:
Ref:
- Feature issue: https://github.com/kubernetes/features/issues/504
- Proposal: https://github.com/kubernetes/community/pull/1276

This PR adds the relevant APIs, validation check and the underlying kubelet changes.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #NONE 

**Special notes for your reviewer**:
/sig network 
@kubernetes/sig-network-api-reviews 
/assign @bowei @thockin 

**Release note**:

```release-note
Add DNSConfig field to PodSpec and support "None" mode for DNSPolicy (Alpha).
```
2017-11-21 17:57:37 -08:00
Kubernetes Submit Queue 94a8d81172
Merge pull request #55447 from jingxu97/Nov/podmetric
Automatic merge from submit-queue (batch tested with PRs 55812, 55752, 55447, 55848, 50984). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add Pod-level local ephemeral storage metric in Summary API

This PR adds pod-level ephemeral storage metric into Summary API.
Pod-level ephemeral storage usage is the sum of all containers and local
ephemeral volume including EmptyDir (if not backed up by memory or
hugepages), configueMap, and downwardAPI.
Address issue #55978

**Release note**:
```release-note
Add pod-level local ephemeral storage metric in Summary API. Pod-level ephemeral storage reports the total filesystem usage for the containers and emptyDir volumes in the measured Pod.
```
2017-11-21 17:57:34 -08:00
Kubernetes Submit Queue 03b7d77be4
Merge pull request #54316 from dashpole/disk_request_eviction
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Take disk requests into account during evictions

fixes #54314

This PR is part of the local storage feature, and it makes the eviction manager take disk requests into account during disk evictions.
This uses the same eviction strategy as we do for memory.
Disk requests are only considered when the LocalStorageCapacityIsolation feature gate is enabled.  This is enforced by adding a check for the feature gate in getRequests().
I have added unit testing to ensure that previous behavior is preserved when the feature gate is disabled.
Most of the changes are testing.  Reviewers should focus on changes in **eviction/helpers.go**

/sig node
/assign @jingxu97  @vishh
2017-11-21 14:31:47 -08:00
Jiaying Zhang 048bafdd0b Adds device plugin registration count metric and allocation latency metric. 2017-11-21 13:44:10 -08:00
Kubernetes Submit Queue 5242f01e8c
Merge pull request #55088 from jiayingz/capacity
Automatic merge from submit-queue (batch tested with PRs 56021, 55843, 55088, 56117, 55859). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Extends deviceplugin to gracefully handle full device plugin lifecycle.

**What this PR does / why we need it**:
- Instead of using cm.capacity field to communicate device plugin resource capacity,
this PR changes to use an explicit cm.GetDevicePluginResourceCapacity() function
that returns device plugin resource capacity as well as any inactive device plugin resource.
Kubelet syncNodeStatus call this function during its periodic run to update node status
capacity and allocatable. After this call, device plugin can remove the inactive device
plugin resource from its allDevices field as the update is already pushed to API server.
- Extends device plugin checkpoint data to record registered resources
so that we can finish resource removing even upon kubelet restarts.
- Passes sourcesReady from kubelet to device plugin to avoid removing
inactive pods during grace period of kubelet restart.
- Extends gpu_device_plugin e2e_node test to verify that scheduled pods
can continue to run even after device plugin deletion and kubelet
restarts.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Together with https://github.com/kubernetes/kubernetes/pull/54488, fixes https://github.com/kubernetes/kubernetes/issues/53395

**Special notes for your reviewer**:

**Release note**:

```release-note
Extends deviceplugin to gracefully handle full device plugin lifecycle.
```
2017-11-21 12:16:54 -08:00
David Ashpole 8b3bd5ae60 take disk requests into account during evictions 2017-11-21 10:21:30 -08:00
Kubernetes Submit Queue 164317879b
Merge pull request #55922 from Random-Liu/add-partical-cri-log
Automatic merge from submit-queue (batch tested with PRs 55938, 56055, 53385, 55796, 55922). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add partial CRI container log support.

For https://github.com/kubernetes/kubernetes/issues/44976.

New CRI log format:
```
TIMESTAMP STREAM TAG CONTENT
2016-10-06T00:17:09.669794202Z stdout P log content 1
2016-10-06T00:17:09.669794203Z stdout P log content 2
```

Although unlikely, if in the future we need more metadata in each line, we could extend TAG into multiple tags splitted by `:`.

@yujuhong @feiskyer @crassirostris @mrunalp @abhi @mikebrow 
/cc @kubernetes/sig-node-api-reviews @kubernetes/sig-instrumentation-api-reviews 

**Release note**:

```release-note
A new field is added to CRI container log format to support splitting a long log line into multiple lines.
```
2017-11-21 07:43:53 -08:00
zhangjie 226f8b3c73 delete useless params containerized
Signed-off-by: zhangjie <zhangjie0619@yeah.net>
2017-11-21 18:21:59 +08:00
Jiaying Zhang 1eb4e79453 Extends deviceplugin to gracefully handle full device plugin lifecycle.
- Instead of using cm.capacity field to communicate device plugin resource
capacity, this PR changes to use an explicit cm.GetDevicePluginResourceCapacity()
function that returns device plugin resource capacity as well as any inactive
device plugin resource. Kubelet syncNodeStatus call this function during its
periodic run to update node status capacity and allocatable. After this call,
device plugin can remove the inactive device plugin resource from its allDevices
field as the update is already pushed to API server.
- Extends device plugin checkpoint data to record registered resources
so that we can finish resource removing even upon kubelet restarts.
- Passes sourcesReady from kubelet to device plugin to avoid removing
inactive pods during grace period of kubelet restart.
2017-11-20 23:40:14 -08:00
Kubernetes Submit Queue 9fe2a62b90
Merge pull request #55338 from dashpole/remove_disk_allocatable
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove Ephemeral Storage Allocatable Evictions

Issue #52336

Rationale and docs change: https://github.com/kubernetes/community/pull/1275

cc @kubernetes/sig-node-pr-reviews 
cc @derekwaynecarr @vishh 
/assign @jingxu97 
/assign @dchen1107
2017-11-20 21:43:24 -08:00
Timothy St. Clair 763122ae4b Update generated and dep addition of safefile 2017-11-20 22:24:23 -06:00
Kubernetes Submit Queue 3a03107f45
Merge pull request #55961 from mtaufen/kc-round-trip-test
Automatic merge from submit-queue (batch tested with PRs 54824, 55911, 55730, 55979, 55961). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add kubeletconfig round trip test

I noticed we were missing one of these.

fixes #55959

```release-note
NONE
```
2017-11-20 20:13:40 -08:00
Kubernetes Submit Queue bb0dccf602
Merge pull request #55730 from nqn/niklas/device-move
Automatic merge from submit-queue (batch tested with PRs 54824, 55911, 55730, 55979, 55961). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Device plugin API merge of handler and manager

**What this PR does / why we need it**: We are trying different approaches to make the device plugin implementation simpler and more robust. One option is to merge the notion of the `device_plugin_handler` into the `device_manager`. This is for several reasons:

1) Some calls go directly from handler to manager, adding little value.
2) The separation of concern is not clear between the two components. They have a 1:1 relationship.
3) The separation and abstractions needed are at a different level. Code that can be refactored will most likely live in abstractions which hide details around lock acquisition and check pointing.

In this PR, we will **just** merge the two interfaces. After this, there is several opportunities for simplifying and cleaning up the device plugin.

Fixes #55180

**Special notes for your reviewer**: This is a WIP. May very well get dropped, but keeping up for the sake of early sharing and showing the progress of the code move. 

**Release note**:
```release-note
NONE
```
2017-11-20 20:13:35 -08:00
Timothy St. Clair ed4401c126 Addition of bootstrap checkpointing 2017-11-20 21:54:15 -06:00
Pengfei Ni 82af3c1b0f Use GetVersion() API instead of ver command 2017-11-21 03:05:24 +00:00
Michael Taufen ee5b040e31 Add kubeletconfig round trip test 2017-11-20 16:54:45 -08:00
Lantao Liu de73e4596a Add constants in CRI. 2017-11-21 00:36:01 +00:00
Jing Xu 75ef18c4d3 Add Pod-level local ephemeral storage metric in Summary API
This PR adds pod-level ephemeral storage metric into Summary API.
Pod-level ephemeral storage usage is the sum of all containers and local
ephemeral volume including EmptyDir (if not backed up by memory or
hugepages), configueMap, and downwardAPI.
2017-11-20 16:32:38 -08:00
MrHohn 9f9c721b20 Support Custom Pod DNS in kubelet, gated by feature gate 2017-11-20 16:18:10 -08:00
Kubernetes Submit Queue 849d7f8595
Merge pull request #56003 from BenTheElder/fix-cross-cadvisor
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix cadvisor.New signature for cross build

**What this PR does / why we need it**: fixes the `pkg/kubelet/cadvisor.New` signature on non-linux platforms to match the new one on linux. This should fix the cross build

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #56002

**Special notes for your reviewer**: 

**Release note**:

```release-note
NONE
```

/sig release
2017-11-20 15:02:26 -08:00
Niklas Q. Nielsen b16bfc768d Merging handler into manager API 2017-11-20 21:37:46 +00:00
Kubernetes Submit Queue 563edef707
Merge pull request #55983 from mtaufen/seccomp-is-alpha
Automatic merge from submit-queue (batch tested with PRs 55839, 54495, 55884, 55983, 56069). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

seccomp is an alpha feature and not feature gated

Move SeccompProfileRoot to KubeletFlags and document flag as alpha.

wrt https://github.com/kubernetes/kubernetes/pull/53833#issuecomment-345396575, seccomp is an alpha feature, but this isn't clearly documented anywhere (the annotation just has the word "alpha" in it, and that's your signal that it's alpha). 

Since seccomp was around before feature gates, it doesn't have one.

Thus SeccompProfileRoot should not be part of KubeletConfiguration, and this PR moves it to KubeletFlags, and amends the help text to note the alpha state of the feature.

fixes: #56087

```release-note
NONE
```
2017-11-20 13:08:12 -08:00
Kubernetes Submit Queue 0b1d023aa7
Merge pull request #55884 from mpolednik/dpi-race-fix
Automatic merge from submit-queue (batch tested with PRs 55839, 54495, 55884, 55983, 56069). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

deviceplugin: fix race when multiple plugins are registered

**What this PR does / why we need it**:
When registering multiple device plugins to Kubelet concurrently, there exists a race that crashes the Kubelet.

Consider two plugins: D1 and D2. The call order method is roughly

D1 -> manager.go:register -> endpoint.go:listAndWatch -> device_plugin_handler.go:(*D1).callback
D2 -> manager.go:register -> endpoint.go:listAndWatch -> device_plugin_handler.go:(*D2).callback

The callback function accesses HandlerImpl's allDevices map that maps (resourceName -> DeviceID). If both plugins reach these accesses at the same time, Kubelet crashes with "fatal error: concurrent map read and map write".

This can be solved by making sure handler is locked when allDevices are being updated. The functionality is needed to avoid Kubelet crashes when multiple device plugins are trying to register with Kubelet at the same moment. Occurs frequently when single binary tries to register itself as multiple plugins.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-11-20 13:08:09 -08:00
Mitsuhiro Tanino 9329dd5b91 generated code for Volumemanager change 2017-11-20 14:10:34 -05:00
mtanino 8903e8cd85 BlockVolumesSupport: CRI, VolumeManager and OperationExecutor changes
This patch contains following changes.
- container runtime changes for adding block devices
- volumemanager changes
- operationexecutor changes
2017-11-20 14:10:26 -05:00
Benjamin Elder 1f34863b9e fix cadvisor.New signature for cross build 2017-11-18 15:23:17 -08:00
Kubernetes Submit Queue 869b5ab191
Merge pull request #55841 from ConnorDoyle/cpuman-file-state-for-none-policy
Automatic merge from submit-queue (batch tested with PRs 55841, 55948, 55945). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

CPU Manager: file state for all policies

**What this PR does / why we need it**:

Before this change, the new file-backed state was only enabled for the static CPU manager policy. This patch enables persistent state for all policies.

This PR fixes #55736 and the potential CPU resource leak described in that issue.

**Release note**:

```release-note
NONE
```

/kind bug
/sig node
/assign @balajismaniam
2017-11-18 14:10:12 -08:00
Kubernetes Submit Queue c60b35bcd3
Merge pull request #52977 from yanxuean/improvecgroup
Automatic merge from submit-queue (batch tested with PRs 54837, 55970, 55912, 55898, 52977). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve kubelet cgroup

**What this PR does / why we need it**:
1.Use arg cgroupRoot,not nodeConfig.CgroupRoot
    Using both arg cgroupRoot and nodeConfig.CgroupRoot is confused in function NewQOSContainerManager
2.improve cgroupmanager in qosContainerManager
3. improve arg "cgroupRoot" type in NewQOSContainerManager

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-11-18 13:13:28 -08:00
Kubernetes Submit Queue a74ffbb521
Merge pull request #55912 from MrHohn/kubelet-dns-cleanup
Automatic merge from submit-queue (batch tested with PRs 54837, 55970, 55912, 55898, 52977). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Consolidate DNS codes in kubelet pkg

**What this PR does / why we need it**:
Follow up of https://github.com/kubernetes/kubernetes/pull/55651. Ref https://github.com/kubernetes/kubernetes/pull/55651#discussion_r151042281.

This PRs consolidate DNS related codes in kubelet so that it could be self-contained.

There is no actual code changes again.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Ref https://github.com/kubernetes/kubernetes/issues/55451 

**Special notes for your reviewer**:
cc @bowei @thockin 

**Release note**:

```release-note
NONE
```
2017-11-18 13:13:22 -08:00
Kubernetes Submit Queue 02f803cc02
Merge pull request #52842 from yanxuean/reduntdant-cgroups
Automatic merge from submit-queue (batch tested with PRs 50457, 55558, 53483, 55731, 52842). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

improve the logic setting cgroupparent in RunPodSandbox

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>

**What this PR does / why we need it**:
The setting of cgroupparent is too confused!
The old logic is:
1. set CgroupParent correctly
2. reset CgroupParent incorrectly
3. set CgroupParent again  (refer to #42055 )

The login is too confused, and It is sure that there are many people who drop in trap.
We only need to set it in one place.

kubernetes/pkg/kubelet/dockershim/docker_sandbox.go
```
func (ds *dockerService) makeSandboxDockerConfig(c *runtimeapi.PodSandboxConfig, image string) (*dockertypes.ContainerCreateConfig, error) {
        ....
       // Apply linux-specific options.
	if lc := c.GetLinux(); lc != nil {
		if err := ds.applySandboxLinuxOptions(hc, lc, createConfig, image, securityOptSep); err != nil {
			return nil, err
		}
	}

	// Apply resource options.
        setSandboxResources(hc)      **<-- reset the CgroupParent incorrectly**

       // Apply cgroupsParent derived from the sandbox config.
	if lc := c.GetLinux(); lc != nil {
		// Apply Cgroup options.
		cgroupParent, err := ds.GenerateExpectedCgroupParent(lc.CgroupParent)
		if err != nil {
			return nil, fmt.Errorf("failed to generate cgroup parent in expected syntax for container %q: %v", c.Metadata.Name, err)
		}
		hc.CgroupParent = cgroupParent
	}
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-11-18 11:36:26 -08:00
Kubernetes Submit Queue 786c69dbc9
Merge pull request #55496 from JiangtianLi/jiangtli-fixservercore
Automatic merge from submit-queue (batch tested with PRs 55642, 55897, 55835, 55496, 55313). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix issue #55031 to remove dependence on package lxn/win

**What this PR does / why we need it**:
This PR fixes issue #55031 where kubelet.exe crashes on Windows Server Core. The root cause is that kubelet.exe depends on package lxn/win pdh and kernel32 wrapper for node metrics. However, opengl32.dll is not available in Server Core and lxn/win requires the presence of all win32 DLLs. 

This PR uses a slim win32 package JeffAshton/win_pdh since most win32 APIs needed are PDH API. Also this PR makes own implementation of GetPhysicallyInstalledSystemMemory until golang Windows syscall has it or lxn/win fixes opengl32 issue. Also this PR modifies the way to get Windows version.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55031

**Special notes for your reviewer**:

**Release note**:

```release-note

```
/sig windows
/sig node
2017-11-18 10:46:38 -08:00
Kubernetes Submit Queue ef3b27cbd4
Merge pull request #55642 from dashpole/disable_cadvisor_disk_for_cri
Automatic merge from submit-queue (batch tested with PRs 55642, 55897, 55835, 55496, 55313). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Disable container disk metrics when using the CRI stats integration

Issue: https://github.com/kubernetes/kubernetes/issues/51798

As explained in the issue, runtimes which make use of the CRI Stats API still have the performance overhead of collecting those same stats through cAdvisor.
The CRI Stats API has metrics for CPU, Memory, and Disk.  This PR significantly reduces the added overhead due to collecting these stats in both cAdvisor and in the runtime.
This PR disables container disk metrics, which are very expensive to collect.

This PR does not disable node-level disk stats, as the "Raw" container handler does not currently respect ignoring DiskUsageMetrics.
This PR factors out the logic for determining whether or not to use the CRI stats provider into a helper function, as cAdvisor is instantiated before it is passed to the kubelet as a dependency.

cc @kubernetes/sig-node-pr-reviews @derekwaynecarr  
/kind feature
/sig node

/assign @Random-Liu @derekwaynecarr
2017-11-18 10:46:30 -08:00
David Ashpole 527611ee41 remove disk allocatable evictions 2017-11-18 10:34:59 -08:00
Kubernetes Submit Queue 5e508b37d9
Merge pull request #54606 from miaoyq/filter-out-duplicated-container-stats
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Filter out duplicated container stats

**What this PR does / why we need it**:

**Which issue this PR fixes** *
fixes #53514

**Special notes for your reviewer**:

/cc @Random-Liu 

Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-11-17 23:20:36 -08:00
Andy Xie 64a8edfbcf fix network value for stats summary 2017-11-18 10:17:59 +08:00
Michael Taufen ca8cffef24 seccomp is an alpha feature and not feature gated
Move SeccompProfileRoot to KubeletFlags and document flag as alpha
2017-11-17 17:57:53 -08:00
Yanqiang Miao 11cf3906f9 Add unit test for "filter out duplicated container stats"
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-11-18 09:51:28 +08:00
Yanqiang Miao 3bd315dcb1 Filter out duplicated container stats
Signed-off-by: Yanqiang Miao <miao.yanqiang@zte.com.cn>
2017-11-18 09:51:23 +08:00
Kubernetes Submit Queue 01c74145c7
Merge pull request #55665 from brendandburns/path
Automatic merge from submit-queue (batch tested with PRs 55908, 55829, 55293, 55653, 55665). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

If mountPath is missing, prefix with root dir.

If `mountPath` is not absolute, add the os-specific root directory as a prefix.

Ref: https://github.com/kubernetes/kubernetes/pull/51240
https://groups.google.com/forum/#!topic/kubernetes-sig-storage/k_0Wr2kYkpU

@thockin @saad-ali @andyzhangx 

Note to @thockin I left the validation in place, in seems like it is a net win, since it will give a decent
error message to most people, but the fall-back defaulting is there if it doesn't catch 'c:'

I'm happy to rip out the validation if that is preferable to everyone.  Let me know.

```release-note
If a non-absolute mountPath is passed to the kubelet, prefix it with the appropriate root path.
```
2017-11-17 17:11:16 -08:00
Kubernetes Submit Queue 330bacb7e5
Merge pull request #55908 from mindprince/accelerator-monitoring-api
Automatic merge from submit-queue (batch tested with PRs 55908, 55829, 55293, 55653, 55665). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix accelerator stats API to follow API conventions.

Introduced in #55188

**Release note**:
```release-note
None
```
2017-11-17 17:11:05 -08:00
Michael Taufen 6e49ac382b ColonSeparatedMultimapStringString: allow multiple Set invocations with default override
The first call to Set will clear the map before adding entries;
subsequent calls will simply append to the map.
This makes it possible to override default values with a command-line
option rather than appending to defaults,
while still allowing the distribution of key-value pairs across
multiple flag invocations.

For example: `--flag "a:hello" --flag "b:again" --flag "b:beautiful"
--flag "c:world"` results in `{"a": ["hello"], "b": ["again",
"beautiful"], "c": ["world"]}`
2017-11-17 09:07:47 -08:00
Kubernetes Submit Queue 00fe2cfe6c
Merge pull request #54823 from mtaufen/structure-eviction-thresholds
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Lift embedded structure out of eviction-related KubeletConfiguration fields

- Changes the following KubeletConfiguration fields from `string` to
`map[string]string`:
  - `EvictionHard`
  - `EvictionSoft`
  - `EvictionSoftGracePeriod`
  - `EvictionMinimumReclaim`
- Adds flag parsing shims to maintain Kubelet's public flags API, while
enabling structured input in the file API.
- Also removes `kubeletconfig.ConfigurationMap`, which was an ad-hoc flag
parsing shim living in the kubeletconfig API group, and replaces it
with the `MapStringString` shim introduced in this PR. Flag parsing
shims belong in a common place, not in the kubeletconfig API.
I manually audited these to ensure that this wouldn't cause errors
parsing the command line for syntax that would have previously been
error free (`kubeletconfig.ConfigurationMap` was unique in that it
allowed keys to be provided on the CLI without values. I believe this was
done in `flags.ConfigurationMap` to facilitate the `--node-labels` flag,
which rightfully accepts value-free keys, and that this shim was then
just copied to `kubeletconfig`). Fortunately, the affected fields
(`ExperimentalQOSReserved`, `SystemReserved`, and `KubeReserved`) expect
non-empty strings in the values of the map, and as a result passing the
empty string is already an error. Thus requiring keys shouldn't break
anyone's scripts.
- Updates code and tests accordingly.

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

Other things:
- There is another flag parsing shim, `flags.ConfigurationMap`, from the
shared flag utility. The `NodeLabels` field still uses
`flags.ConfigurationMap`. This PR moves the allocation of the
`map[string]string` for the `NodeLabels` field from
`AddKubeletConfigFlags` to the defaulter for the external
`KubeletConfiguration` type. Flags are layered on top of an internal
object that has undergone conversion from a defaulted external object,
which means that previously the mere registration of flags would have
overwritten any previously-defined defaults for `NodeLabels` (fortunately
there were none).

Related: #53833 (lifting embedded structures out of string fields is part of getting this API to beta)

```release-note
The EvictionHard, EvictionSoft, EvictionSoftGracePeriod, EvictionMinimumReclaim, SystemReserved, and KubeReserved fields in the KubeletConfiguration object (kubeletconfig/v1alpha1) are now of type map[string]string, which facilitates writing JSON and YAML files.
```
2017-11-17 02:57:30 -08:00
Zihong Zheng 386d1b61bd Consolidate DNS codes in kubelet pkg 2017-11-16 21:07:24 -08:00
Michael Taufen 1085b6f730 Lift embedded structure out of eviction-related KubeletConfiguration fields
- Changes the following KubeletConfiguration fields from `string` to
`map[string]string`:
  - `EvictionHard`
  - `EvictionSoft`
  - `EvictionSoftGracePeriod`
  - `EvictionMinimumReclaim`
- Adds flag parsing shims to maintain Kubelet's public flags API, while
enabling structured input in the file API.
- Also removes `kubeletconfig.ConfigurationMap`, which was an ad-hoc flag
parsing shim living in the kubeletconfig API group, and replaces it
with the `MapStringString` shim introduced in this PR. Flag parsing
shims belong in a common place, not in the kubeletconfig API.
I manually audited these to ensure that this wouldn't cause errors
parsing the command line for syntax that would have previously been
error free (`kubeletconfig.ConfigurationMap` was unique in that it
allowed keys to be provided on the CLI without values. I believe this was
done in `flags.ConfigurationMap` to facilitate the `--node-labels` flag,
which rightfully accepts value-free keys, and that this shim was then
just copied to `kubeletconfig`). Fortunately, the affected fields
(`ExperimentalQOSReserved`, `SystemReserved`, and `KubeReserved`) expect
non-empty strings in the values of the map, and as a result passing the
empty string is already an error. Thus requiring keys shouldn't break
anyone's scripts.
- Updates code and tests accordingly.

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

Other things:
- There is another flag parsing shim, `flags.ConfigurationMap`, from the
shared flag utility. The `NodeLabels` field still uses
`flags.ConfigurationMap`. This PR moves the allocation of the
`map[string]string` for the `NodeLabels` field from
`AddKubeletConfigFlags` to the defaulter for the external
`KubeletConfiguration` type. Flags are layered on top of an internal
object that has undergone conversion from a defaulted external object,
which means that previously the mere registration of flags would have
overwritten any previously-defined defaults for `NodeLabels` (fortunately
there were none).
2017-11-16 18:35:13 -08:00
Rohit Agarwal 274bac23ce Fix accelerator stats API to follow API conventions. 2017-11-16 15:20:55 -08:00
Sergey Lanzman 3474747465 Move regexp.MustCompile to global variable 2017-11-16 22:03:12 +02:00
Kubernetes Submit Queue 0eb999c26a
Merge pull request #55562 from mtaufen/eject-non-gated-alpha-fields
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move 'alpha' KubeletConfiguration fields that aren't feature-gated and self-registration fields to KubeletFlags

Some of these fields are marked "alpha" in help text. They cannot be in the KubeletConfiguration object unless they are feature gated or graduated from alpha. 

Others relate to Kubelet self-registration, and given https://github.com/kubernetes/community/pull/911 I think its prudent to wait and see if these really should be in the KubeletConfiguration type.

For now we just leave them all as flags.

```release-note
NONE
```
2017-11-16 10:36:10 -08:00
Martin Polednik 6e3f8f3890 deviceplugin: fix race when multiple plugins are registered
Signed-off-by: Martin Polednik <mpolednik@redhat.com>
2017-11-16 15:20:00 +01:00
Kubernetes Submit Queue 47a2718df3
Merge pull request #55826 from madhanrm/portmap
Automatic merge from submit-queue (batch tested with PRs 55697, 55631, 51905, 55647, 55826). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

GetPodPortMappings should return nil error if checkpoint returns with KeyNotFound error

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55819 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-16 03:57:38 -08:00
Kubernetes Submit Queue 154b30a011
Merge pull request #55631 from mrunalp/parse_last_partial
Automatic merge from submit-queue (batch tested with PRs 55697, 55631, 51905, 55647, 55826). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Parse the last partial line in CRI logs

@Random-Liu @yujuhong @runcom @feiskyer PTAL

Fixes part of https://github.com/kubernetes/kubernetes/issues/44976

This should work while we find a longer term format for CRI logs.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>

**What this PR does / why we need it**:
This PR attempts to parse the last line of  log even if it doesn't have a newline. Today for CRI based log formats such lines are ignored and empty output is returned.

**Which issue(s) this PR fixes** 
Fixes part of #44976

**Special notes for your reviewer**:
Use a CRI runtime like CRI-O and the output will be empty for these commands without this PR.
```
# kubectl create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/configmap/configmap.yaml
# kubectl create -f https://raw.githubusercontent.com/openshift-qe/v3-testfiles/master/configmap/pod-configmap-volume1.yaml 
# kubectl logs dapi-test-pod-1 
very# 
```

**Release Note**:
```release-note
NONE
```
2017-11-16 03:57:26 -08:00
Kubernetes Submit Queue 779105673a
Merge pull request #55188 from mindprince/accelerator-monitoring
Automatic merge from submit-queue (batch tested with PRs 55798, 49579, 54862, 55188, 51990). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add monitoring support for hardware accelerators

Currently only NVIDIA GPU monitoring is implemented.

Feature repo issue: https://github.com/kubernetes/features/issues/369
cAdvisor PR: https://github.com/google/cadvisor/pull/1762

/kind feature
/sig node
/sig instrumentation
/area hw-accelerators

**Release note**:
```release-note
Kubelet now exposes metrics for NVIDIA GPUs attached to the containers.
```
2017-11-16 03:09:21 -08:00
Kubernetes Submit Queue 6e950cc629
Merge pull request #55651 from MrHohn/kubelet-dns-pkg
Automatic merge from submit-queue (batch tested with PRs 55657, 54758, 47584, 55758, 55651). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move DNS related kubelet codes into its own package

**What this PR does / why we need it**:
Ref https://github.com/kubernetes/features/issues/504, this PR rearranges DNS related kubelet codes into its own pacakge and adds an OWNERS file.

Again, there is no functional changes, just that codes are moved around and couple fields (`clusterDomain`, `clusterDNS`, `resolverConfig`) are replaced with a `dnsConfigurer` struct.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #NONE 

**Special notes for your reviewer**:
/assign @bowei @thockin 

**Release note**:

```release-note
NONE
```
2017-11-15 23:57:35 -08:00
Connor Doyle c95ee34234 Use file-backed state for all cpumanager policies
- Add unit test to verify policy name mismatch behavior.
2017-11-15 22:38:11 -08:00
Kubernetes Submit Queue e99544d018
Merge pull request #54409 from intelsdi-x/cpu-enable-state-file
Automatic merge from submit-queue (batch tested with PRs 55764, 55683, 55468, 54409, 55546). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enable file back state in static policy

**What this PR does / why we need it**:
Enables file back `State` in `static policy` and cpu manager + tests.
Upon policy start, state read from file is validated whether it meets the policy assumption. In case of any error, state is cleared.

Previous PR: #54408
Next PR: #54409
2017-11-15 22:16:05 -08:00
Brendan Burns 1b7f028ecb If mountPath is missing, prefix with root dir. 2017-11-16 05:30:53 +00:00
Michael Taufen 523c68ff65 Move ungated 'alpha' KubeletConfiguration fields and self-registration fields to KubeletFlags 2017-11-15 17:47:10 -08:00
Kubernetes Submit Queue 6f35d49079
Merge pull request #52149 from lichuqiang/combineListwatch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deviceplugin refactoring: merge func list and listwatch in endpoint into one

**What this PR does / why we need it**:
merge func list and listwatch in endpoint into one, since we won't call list func individually

**Which issue this PR fixes**
fixes #51993
Part2

**Special notes for your reviewer**:
/cc @jiayingz @RenaudWasTaken @vishh

**Release note**:

```release-note
NONE
```
2017-11-15 16:56:51 -08:00
Madhan Raj Mookkandy 84d87b70b7 Return nil error if checkpoint returns with KeyNotFound error 2017-11-15 14:58:31 -08:00
Kubernetes Submit Queue 7ad180aae0
Merge pull request #55153 from chenchun/fix
Automatic merge from submit-queue (batch tested with PRs 54436, 53148, 55153, 55614, 55484). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix hostport duplicate chain names

Fixes bad conversion from int32 to string. Without this patch, getHostportChain/hostportChainName generates the same chain names for ports 57119/55429/56833 of the same pod.

closes #55771

```release-note
Fixes bad conversion in host port chain name generating func which leads to some unreachable host ports.
```
2017-11-15 12:58:01 -08:00
Kubernetes Submit Queue dca71e0a23
Merge pull request #53148 from rpothier/plugins-ipv6
Automatic merge from submit-queue (batch tested with PRs 54436, 53148, 55153, 55614, 55484). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ip6tables should be set in the noop plugin

**What this PR does / why we need it**:
The noop plugin currently sets the iptables for IPv4.
This updates that to also set the iptables for IPv6 so
IPv6 can have parity with IPv4.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #53147

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-15 12:57:56 -08:00
Kubernetes Submit Queue e568aa7f65
Merge pull request #55648 from mtaufen/kc-rel-paths
Automatic merge from submit-queue (batch tested with PRs 55648, 55274, 54982, 51955, 55639). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Kubelet: Relative paths in local config file

Resolve relative paths against the config file's location.

Issue: #55644
Related comment: https://github.com/kubernetes/kubernetes/pull/53833#issuecomment-344009912

Will add the same behavior for dynamic Kubelet config in a future PR, see issue #55645.

```release-note
Relative paths in the Kubelet's local config files (--init-config-dir) will be resolved relative to the location of the containing files.
```
2017-11-15 12:03:28 -08:00
Zihong Zheng 0bc2e1f62f Move DNS related kubelet codes into its own package 2017-11-15 10:56:44 -08:00
Jiangtian Li 5fe87574d2 Revert get version change due to the overlap in PR #55143 2017-11-15 10:27:19 -08:00
Michael Taufen 816174c69a Kubelet: Relative paths in local config file
Resolve relative paths against the config file's location.
Add a test to help keep the list of filepath fields up to date.

Issue: #55644
Related comment:
https://github.com/kubernetes/kubernetes/pull/53833#issuecomment-344009912

Will add the same behavior for dynamic Kubelet config in a future PR,
see issue #55645.
2017-11-15 09:32:53 -08:00
Kubernetes Submit Queue 54e60aca17
Merge pull request #55735 from jiayingz/deviceplugin-owner
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adds jiayingz@ and vish@ as approvers for pkg/kubelet/cm/deviceplugin/.

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note

```
2017-11-15 09:30:47 -08:00
Kubernetes Submit Queue c339a54b53
Merge pull request #55659 from CaoShuFeng/duplicated_import
Automatic merge from submit-queue (batch tested with PRs 53780, 55663, 55321, 52421, 55659). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove duplicated import

**Release note**:
```release-note
NONE
```
2017-11-15 09:30:40 -08:00
Kubernetes Submit Queue 1ced91f201
Merge pull request #55389 from miaoyq/completet-test-case
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Complete test case for kubeletconfig api validation

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55664

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-11-15 06:41:05 -08:00
Kubernetes Submit Queue 28c483e161
Merge pull request #45551 from danehans/node_v6
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Adds Support for Node Resource IPv6 Addressing

**What this PR does / why we need it**:
This PR adds support for the following:

1. A node resource to be assigned an IPv6 address.
2. Expands IPv4/v6 address validation checks.

**Which issue this PR fixes**:
Fixes Issue #44848 (in combination with PR #45116).

**Special notes for your reviewer**:
This PR is part of a larger effort, Issue #1443 to add IPv6 support to k8s.

**Release note**:
```
NONE
```
2017-11-15 02:42:48 -08:00
Chun Chen c6375c20b7 Add tests to test if legacy chains/rules can be cleaned up 2017-11-15 15:15:04 +08:00
Chun Chen 5d23dd82ab Remove bugy chains as well to clean up old chain/rule 2017-11-15 15:15:04 +08:00
Chun Chen 932cf077ee Fix hostport duplicate chain names
closes #55771
2017-11-15 15:15:03 +08:00
Jiaying Zhang 93916242f7 Adds jiayingz@ and vish@ as approvers for pkg/kubelet/cm/deviceplugin/. 2017-11-14 15:27:02 -08:00
David Ashpole 220edbc6e3 disable container disk metrics when using the CRI stats integration 2017-11-14 11:43:08 -08:00
Michał Stachowski 809ac834a0 Cpu manager file state tests 2017-11-14 18:26:41 +01:00
Szymon Scharmach 7e7301ffaf Enable file state in static policy 2017-11-14 18:25:58 +01:00
Kubernetes Submit Queue b983cee8b8
Merge pull request #55641 from sjenning/remove-corrupt-checkpoints
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

dockershim: remove corrupt checkpoints immediately upon detection

Fixes https://github.com/kubernetes/kubernetes/issues/55620

The current checkpoint abstraction leaks the handling of corrupt checkpoints to the user.

If the user does a `GetCheckpoint()` and the checkpoint is corrupt, the corrupt checkpoint is returned to the user (why??) with an error indicating the corruption.  It is then up to the user to detect the corruption via the error msg and call `RemoveCheckpoint()` to remove the corrupted checkpoint.

The checkpoint abstraction should not expose corruption to the user.  If it is corrupt, it is as good as not found to the user.  The checkpoint code should handle cleanup of corrupt entries and report "not found" to the user.

@derekwaynecarr @eparis @dcbw @freehan
2017-11-14 07:15:57 -08:00
Cao Shufeng 86968e44d0 remove duplicated import 2017-11-14 17:18:17 +08:00
lichuqiang 4fa0fa5ad1 pass devices of previous endpoint into re-registered one to avoid potential orphaned devices upon re-registration 2017-11-14 16:43:19 +08:00
Yanqiang Miao 4afddd4a7d Complete test case for kubeletconfig validation 2017-11-14 11:17:24 +08:00
Seth Jennings a4bc7707d4 dockershim: remove corrupt checkpoints immediately upon detection 2017-11-13 20:34:17 -06:00
Kubernetes Submit Queue 2d64ce5e8e
Merge pull request #53440 from jsafrane/mount-container4-10-03
Automatic merge from submit-queue (batch tested with PRs 54005, 55127, 53850, 55486, 53440). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Containerized mount utilities

This is implementation of https://github.com/kubernetes/community/pull/589

@tallclair @vishh @dchen1107 PTAL
@kubernetes/sig-node-pr-reviews 

**Release note**:
```release-note
Kubelet supports running mount utilities and final mount in a container instead running them on the host.
```
2017-11-13 16:45:33 -08:00