Commit Graph

5813 Commits (13b12e89408869c5b560a81e95bca33267bdb8e1)

Author SHA1 Message Date
Lee Verberne 1ea697044a Update pause container version to 3.1
This updates the version of the pause container used by the kubelet and
various test utilities to 3.1.

This also adds a CHANGELOG.md for build/pause
2018-01-04 11:35:29 +01:00
lcfang 62f29fcb39 fixed the some typo in eviction_manager 2018-01-04 12:23:11 +08:00
Kubernetes Submit Queue e823c473b9
Merge pull request #57524 from mtaufen/kc-status-selflink
Automatic merge from submit-queue (batch tested with PRs 57533, 57524). 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>.

Make ConfigOK status messages more human readable

This makes the ConfigOK status messages for dynamic config more human readable by including the path (e.g. SelfLink) to the object. The messages used to include the UID, but this was kind of useless, because there's no way to GET an object by UID. 

```release-note
NONE
```
2018-01-03 18:56:44 -08:00
Kubernetes Submit Queue adeef3ea84
Merge pull request #57533 from mtaufen/kc-lkg-timer
Automatic merge from submit-queue (batch tested with PRs 57533, 57524). 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>.

periodically check whether assigned kubelet config should become last-known-good

Fixes #57808

Previously, the last-known-good was only updated on Kubelet restart. This has been on my todo list for a while, good to finally have a PR up.

Previously we could have this scenario, which is fixed by this PR:
- lkg is set to local
- we set config A
- config A passes trial period, but nothing caused Kubelet to restart
-  we set config B, which turns out to be invalid
- Kubelet will fall back to local, because lkg was never updated

```release-note
NONE
```
2018-01-03 18:56:38 -08:00
Kubernetes Submit Queue 46eabb7d91
Merge pull request #56534 from allenpetersen/updateGengo
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>.

Update gengo version to include goimports formatter

Update gengo which now uses goimports to format code and organize imports.

Fixes #55542

**Special notes for your reviewer**:
Updates version of k8s.io/gengo
Takes new dependency on golang.org/x/tools/imports and golang.org/x/tools/go/ast/astutil

**Release Notes**:
```release-note
NONE
```
2018-01-03 17:47:05 -08:00
Michael Taufen dd74a39700 Make ConfigOK status messages more human readable by including the API path to the object instead of the UID 2018-01-03 16:05:43 -08:00
Michael Taufen fe17387f1b periodically check whether assigned kubelet config should become last-known-good 2018-01-03 15:28:49 -08:00
Kubernetes Submit Queue cbdfed1ebe
Merge pull request #57770 from mtaufen/fix-kc-flag-defaults
Automatic merge from submit-queue (batch tested with PRs 57572, 57512, 57770). 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>.

More default fixups for Kubelet flags

Similar to #57621, this fixes some other Kubelet flags that were
defaulted wrong.


```release-note
NONE
```
2018-01-03 13:46:35 -08:00
Michael Taufen 300ceadf39 More default fixups for Kubelet flags
Similar to #57621, this fixes some other Kubelet flags that were
defaulted wrong.
2018-01-03 07:13:37 -08:00
Allen Petersen 3d69cea1e5 Update generated files 2018-01-02 22:13:19 -08:00
Di Xu 92c9c9ad30 ignore nonexistent ns net file error when deleting container network 2018-01-03 14:00:35 +08:00
Kubernetes Submit Queue b20c83789f
Merge pull request #57464 from php-coder/verify_run_as_non_root_test
Automatic merge from submit-queue (batch tested with PRs 57746, 57621, 56839, 57464). 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): add more test cases

**What this PR does / why we need it**:
In #56503 we modified `VerifyRunAsNonRoot` function add add one more argument. As [was requested](https://github.com/kubernetes/kubernetes/pull/56503#discussion_r153870821) by @simo5, this change should have a unit test.

This PR adds this test and also some more to cover more execution paths.

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

PTAL @pweil- @liggitt 
CC @simo5
2018-01-02 15:26:47 -08:00
Kubernetes Submit Queue 5aacc8e06d
Merge pull request #57624 from mtaufen/kc-file-arg
Automatic merge from submit-queue (batch tested with PRs 57651, 56411, 56779, 57523, 57624). 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>.

Replace --init-config-dir with --config

Rather than a directory with magic names, just give the Kubelet a file path.
Was originally in #55718, but I'm splitting it out for clarity.

Fixes #57763

```release-note
The alpha `--init-config-dir` flag has been removed. Instead, use the `--config` flag to reference a kubelet configuration file directly.
```
2018-01-02 14:09:51 -08:00
Kubernetes Submit Queue 27d2ffb32f
Merge pull request #49856 from dixudx/polish_UpdateNodeStatus
Automatic merge from submit-queue (batch tested with PRs 49856, 56257, 57027, 57695, 57432). 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>.

Change to pkg/util/node.UpdateNodeStatus

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

> // TODO: Change to pkg/util/node.UpdateNodeStatus.

**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**:
/cc @brendandburns @dchen1107 @lavalamp 

**Release note**:

```release-note
None
```
2018-01-02 13:15:42 -08:00
Christoph Blecker 80e344644e
Regenerate all generated code 2018-01-02 00:21:07 -08:00
stewart-yu cccd18333b fix type error in cteate Memory Threshold Notifier 2018-01-02 15:08:21 +08:00
Kubernetes Submit Queue 4d215fd235
Merge pull request #56611 from tianshapjq/testcase-cgroup_manager_linux.go
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>.

new testcase to cgroup_manager_linux.go

a new test case to adaptName(), for testing "cgroupManagerType != libcontainerSystemd"
2017-12-28 11:11:47 -08:00
Kubernetes Submit Queue a4eb2f96d0
Merge pull request #57610 from vikaschoudhary16/remove-redundant-sleep
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 redundant sleep from ReRegistration unit test case

/kind cleanup
/sig node

**What this PR does / why we need it**:
Once upon a time, there was a race in the device plugin registration logic.  At that time, [list()](5cac9fc984/pkg/kubelet/deviceplugin/manager.go (L206)) and [listAndWatch()](5cac9fc984/pkg/kubelet/deviceplugin/manager.go (L224)) used to be separate functions. Race was there for taking manager.mutex lock from two places. [One, from within the m.addEndpoint()](5cac9fc984/pkg/kubelet/deviceplugin/manager.go (L214)) and the [second, from within m.Devices()](5cac9fc984/pkg/kubelet/deviceplugin/manager.go (L137)).  This race was making `TestDevicePluginReRegistration` flaky as explained below.
 	
```
1.     p1.Register(socketName, testResourceName)
2.  	// Wait for the first callback to be issued.
3.  	<-callbackChan
4.        devices := m.Devices()  
```
* L#1 leads to eventually **asynchronous** invocation of m.addEndpoint(), let say **thread1**.
* L#3 holds the test case execution till the [callback gets invoked](5cac9fc984/pkg/kubelet/deviceplugin/endpoint.go (L108)). This means test case execution waits on channel till the **thread1**  reaches the point where [e.list() call completes in the addEndpoint.](5cac9fc984/pkg/kubelet/deviceplugin/manager.go (L206)) 
* L#4 triggers a new thread. thread1 and this new thread are both racing for m.mutex.Lock(). Former, in the addEndpoint() and later one in the m.Devices(). If m.Devices wins the race, result is the test case failure because endpoint gets added in the manager only after taking mutex.Lock() in the addEndpoint().

To deal with this flake, we added `Sleep` between L#3 and L#4.  `Sleep` was getting some extra time to addEndpoint() and thus making thread1 win the race each time.

Above explained race scenario got fixed and merged sometime back in this PR:
[Deviceplugin refactoring: merge func list and listwatch in endpoint into one](https://github.com/kubernetes/kubernetes/pull/52149)
With the above PR, callback function is invoked from e.run() which makes sure that test case waits on channel till the endpoint is added and devices are updated
Above explained race scenario does not exist now, therefore removing redundant sleeps from the test case.

Tested:
go test -race -count 500 k8s.io/kubernetes/pkg/kubelet/cm/deviceplugin -run TestDevicePluginReRegistration  -timeout 5h

Related #52616 #56026 

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
/cc @vishh @derekwaynecarr @jiayingz @RenaudWasTaken @lichuqiang @ScorpioCPH @tengqm @mindprince @ConnorDoyle @jeremyeder
2017-12-27 14:53:21 -08:00
Kubernetes Submit Queue 933272d2ea
Merge pull request #57494 from stewart-yu/fixFunctionError
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 unstandardized function name new() 

**What this PR does / why we need it**:
fix unstandardized function name, rename new() to newSourceFile()

**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/57495](https://github.com/kubernetes/kubernetes/issues/57495)

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-27 10:33:32 -08:00
vikaschoudhary16 5d10dcd983 Remove redundant sleep from ReRegistration unit test case 2017-12-27 03:02:21 -05:00
Michael Taufen 96f30d49dc Replace --init-config-dir with --config 2017-12-26 19:38:30 -06:00
Davanum Srinivas 39418b175f Fix TestCadvisorListPodStats failure under mac/darwin
GetPodCgroupNameSuffix is not really implemented under darwin
(or windows for that matter). So let's just skip over the check
for CPU and Memory if that is not set.
2017-12-26 19:59:50 -05:00
Kubernetes Submit Queue 18758f502c
Merge pull request #57594 from m1093782566/hairpin
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 incorrect hairpin-mode value and validate it

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

* Fix incorrect hairpin-mode value 

* Add validation

**Which issue(s) this PR fixes**:
Fixes #57609

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-12-26 03:59:59 -08:00
Kubernetes Submit Queue e67294105a
Merge pull request #57274 from vikaschoudhary16/reviewr
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 vikaschoudhary16 as reviewer in pkg/kubelet/cm/deviceplugin

**What this PR does / why we need it**:
Add github user vikaschoudhary16 (me) to the reviewers list for pkg/kubelet/cm/deviceplugin

**Special notes for your reviewer**:
I would like to help with the review load in this package.

```release-note
None
```
/sig node
/cc @vishh @jiayingz @derekwaynecarr @mindprince @RenaudWasTaken @ConnorDoyle
2017-12-25 08:43:10 -08:00
Kubernetes Submit Queue 7dd82519da
Merge pull request #57369 from vikaschoudhary16/revert-to-limits
Automatic merge from submit-queue (batch tested with PRs 57591, 57369). 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>.

Revert back #57278

**What this PR does / why we need it**:
This PR reverts back to behavior of scanning Limits.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Related #
#57276
#57170
**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
/sig node

/cc @vishh @ConnorDoyle @jiayingz
2017-12-24 23:37:37 -08:00
Kubernetes Submit Queue 92e1028ac7
Merge pull request #57591 from vikaschoudhary16/fix-race
Automatic merge from submit-queue (batch tested with PRs 57591, 57369). 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 race in the endpoint.go

**What this PR does / why we need it**:
This PR fixes a race in the endpoint.go

Fixes #56026


-->
```release-note
None
```

/sig node
/cc @RenaudWasTaken @ConnorDoyle @jiayingz @mindprince @ScorpioCPH @resouer @tengqm @vishh
2017-12-24 23:37:34 -08:00
m1093782566 3406af70bc validate --hairpin-mode in kubelet config 2017-12-25 11:37:21 +08:00
m1093782566 035598b94a fix wrong hairpin-mode value 2017-12-25 11:37:16 +08:00
Jeff Grafton efee0704c6 Autogenerate BUILD files 2017-12-23 13:12:11 -08:00
vikaschoudhary16 cc4d2cbe9d Fix a race in the endpoint.go 2017-12-23 03:02:33 -05:00
vikaschoudhary16 8749c5c989 Revert back #57278 2017-12-22 18:55:53 -05:00
Tim Hockin e9dd8a68f6 Revert k8s.gcr.io vanity domain
This reverts commit eba5b6092a.

Fixes https://github.com/kubernetes/kubernetes/issues/57526
2017-12-22 14:36:16 -08:00
Michael Taufen 6ee191ab74 Refactor kubelet config controller bootstrap process
This makes the bootstrap feel much more linear and as a result it is
easier to read.

Also simplifies status reporting for local config.
2017-12-21 15:24:56 -08:00
Kubernetes Submit Queue 2a1cdfffaa
Merge pull request #57221 from mtaufen/kc-event
Automatic merge from submit-queue (batch tested with PRs 57434, 57221, 57417, 57474, 57481). 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>.

Send an event just before the Kubelet restarts to use a new config

**What this PR does / why we need it**:
This PR makes the Kubelet send events for configuration changes. This makes it much easier to see a recent history of configuration changes for the Kubelet. 

**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 #56895

**Special notes for your reviewer**:

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

/cc @dchen1107 @liggitt @dashpole
2017-12-20 17:42:37 -08:00
stewart-yu 3432741b80 [kubelet]fix unstandardized function name, rename new() to newSourceFile() 2017-12-21 09:13:34 +08:00
Michael Taufen d5d7d6d684 Send an event just before the Kubelet restarts to use a new config 2017-12-20 13:02:55 -08:00
Kubernetes Submit Queue 3d652cae03
Merge pull request #57451 from k82cn/rename_func
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>.

Renamed func name according to TODO.

```release-note
None
```
2017-12-20 10:06:15 -08:00
Slava Semushin a91e2dc4d2 security_context_test.go(TestVerifyRunAsNonRoot): add more test cases. 2017-12-20 18:02:52 +01:00
Da K. Ma fe6bfd1dc0 Renamed func name according to TODO. 2017-12-20 18:13:48 +08:00
Rohit Agarwal f52628db60 Deprecate the alpha Accelerators feature gate.
Encourage people to use DevicePlugins instead.
2017-12-19 13:38:56 -08:00
Kubernetes Submit Queue 5b55f614d0
Merge pull request #57260 from davidz627/attachMountLogFix
Automatic merge from submit-queue (batch tested with PRs 55475, 57155, 57260, 57222). 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>.

Improved mount/attach error logging and added attach event.

Fixed kubelet error message to be more descriptive. Added Attach success event for help in debugging.

The attach event is helpful when the node may not have the correct information about attachment status, it allows the user to see whether the Attach was run at all. If there is no success/failure attach message we can infer that there was no attach started at all.

Fixes #57217
2017-12-18 19:45:43 -08:00
Kubernetes Submit Queue dca85f046f
Merge pull request #57309 from CaoShuFeng/hasHostPortConflicts
Automatic merge from submit-queue (batch tested with PRs 54379, 56593, 56685, 54174, 57309). 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 useless function hasHostPortConflicts

`hasHostPortConflicts` is not used anywhere. Delete it.


**Release note**:
```release-note
NONE
```
2017-12-18 14:45:47 -08:00
Kubernetes Submit Queue e5abffca6f
Merge pull request #54174 from thockin/gcr-vanity
Automatic merge from submit-queue (batch tested with PRs 54379, 56593, 56685, 54174, 57309). 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 k8s.gcr.io vanity domain for container images

Related issue: https://github.com/kubernetes/release/issues/281

```release-note
Use "k8s.gcr.io" for container images rather than "gcr.io/google_containers".  This is just a redirect, for now, so should not impact anyone materially.  

Documentation and tools should all convert to the new name. Users should take note of this in case they see this new name in the system.
```
2017-12-18 14:45:45 -08:00
Kubernetes Submit Queue eddb00e7c6
Merge pull request #57247 from dixudx/cm_return_err
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>.

cpumanager: Propagate error up instead panic

**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 #57239

**Special notes for your reviewer**:
/assign @sjenning 
**Release note**:

```release-note
None
```
2017-12-18 10:18:09 -08:00
Tim Hockin eba5b6092a Use k8s.gcr.io vanity domain for container images 2017-12-18 09:18:34 -08:00
Cao Shufeng 0c9bb5a964 remove useless function hasHostPortConflicts
`hasHostPortConflicts` is not used anywhere. Delete it.
2017-12-18 16:14:26 +08:00
Kubernetes Submit Queue 0a55f4105c
Merge pull request #57278 from vikaschoudhary16/limit
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 device manager to scan resources.Requests

**What this PR does / why we need it**:
This PR makes device manager to scan resources.Requests from the container spec. Currently
it scans resources.Limits. For extended resources, it is not mandatory for resources.Limits to be present in the container spec and if Limits are present, validation logic ensures that Limits will always be equal to Requests. 

Fixes #57276 

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
/sig node

/cc @ConnorDoyle @vishh @jiayingz @RenaudWasTaken @tengqm @resouer @mindprince
2017-12-17 23:43:59 -08:00
Di Xu d474b86e05 Propagate error up instead panic 2017-12-18 14:05:06 +08:00
vikaschoudhary16 bf1fb46347 Look for requested resources in the Requests 2017-12-17 22:56:45 -05:00
tianshapjq 7a43f736c4 correct the annotations in container_manager.go 2017-12-18 09:01:36 +08:00
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