Commit Graph

5773 Commits (08c127d4eb3349df0428e07e0c58f8b8860ad0a1)

Author SHA1 Message Date
Kubernetes Submit Queue 656cb30bb5
Merge pull request #57733 from stewart-yu/fixtypeErrorInEviction
Automatic merge from submit-queue (batch tested with PRs 57733, 57613, 57953). 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>.

[eviction manager]fix type error

**What this PR does / why we need it**:
It should not  wrong hint messages when create memory threshold notifier failed

**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
```
2018-01-09 21:51:34 -08:00
Kubernetes Submit Queue 2e9a277a3c
Merge pull request #57845 from yujuhong/minor-clean-up
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: bump the minimum supported docker version to 1.11

Drop the 1.10 compatibilty code.

**Release note**:

```release-note
NONE
```
2018-01-09 18:14:27 -08:00
Kubernetes Submit Queue 34d63793fd
Merge pull request #57851 from mtaufen/kc-deprecate-old-security-knobs
Automatic merge from submit-queue (batch tested with PRs 56759, 57851, 56352). 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 old security controls to KubeletFlags and mark them deprecated

Related to @timstclair's comment: https://github.com/kubernetes/kubernetes/pull/53833#issuecomment-355399163


```release-note
NONE
```
2018-01-09 12:40:37 -08:00
Michael Taufen 5caf26fa84 Move some old security controls to KubeletFlags and mark them deprecated 2018-01-09 10:18:36 -08:00
Kubernetes Submit Queue 57888103a5
Merge pull request #57734 from stewart-yu/removeGetBuggyHostportChain
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 duplicate function getBuggyHostportChain

**What this PR does / why we need it**:
remove `TODO remove this after release 1.9, please refer https://github.com/kubernetes/kubernetes/pull/55153`
function `getBuggyHostportChain`  does bad conversion on HostPort from int32 to string, now that `getHostportChain` does right, we remove function `getBuggyHostportChain` .

**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
```
2018-01-08 22:40:22 -08:00
stewart-yu 2fefca4a0b remove unnecessary function getBuggyHostportChain 2018-01-09 10:38:53 +08:00
Kubernetes Submit Queue cc22b10278
Merge pull request #52638 from wackxu/fixbadcom
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 the wrong code comment

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

Fix the wrong code comment


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


**Release note**:

```release-note
NONE
```
2018-01-07 10:22:02 -08:00
Kubernetes Submit Queue bd4d511a40
Merge pull request #57852 from misterikkit/moveScheduler
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 scheduler out of plugin directory

**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)*:
This is but one step toward resolving the referenced issue.
/ref #57579

**Special notes for your reviewer**:

**Release note**:

```release-note
Default scheduler code is moved out of the plugin directory.
plugin/pkg/scheduler -> pkg/scheduler
plugin/cmd/kube-scheduler -> cmd/kube-scheduler
```
/sig scheduling
2018-01-05 22:20:13 -08:00
Jonathan Basseri 85c5862552 Fix scheduler refs in BUILD files.
Update references to moved scheduler code.
2018-01-05 15:05:01 -08:00
Jonathan Basseri 30b89d830b Move scheduler code out of plugin directory.
This moves plugin/pkg/scheduler to pkg/scheduler and
plugin/cmd/kube-scheduler to cmd/kube-scheduler.

Bulk of the work was done with gomvpkg, except for kube-scheduler main
package.
2018-01-05 15:05:01 -08:00
Clayton Coleman 5210e6fefd
Remove dependency on v1 API in base credential provider
Credential provider is useful without the v1 API, move the only
dependency out so that we can more easily move credential provider to a
utility library in the future (other callers besides Kubelet may need to
load pull secrets like Docker).
2018-01-05 17:52:06 -05:00
Kubernetes Submit Queue afbbd394c1
Merge pull request #57517 from verb/paws-bump
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>.

Bump pause container used by kubelet and tests to 3.1

This updates the version of the pause container used by the kubelet and
various test utilities to 3.1.

**What this PR does / why we need it**: The pause container hasn't been rebuilt in quite a while and needs an update to reap zombies (#50865) and for schema2 manifest (#56253).

**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 #50865, Fixes #56253

**Special notes for your reviewer**:

**Release note**:

```release-note
The kubelet uses a new release 3.1 of the pause container with the Docker runtime. This version will clean up orphaned zombie processes that it inherits.
```
2018-01-04 17:06:48 -08:00
Yu-Ju Hong 059fa35a84 dockershim: bump the minimum supported docker version to 1.11
Drop the 1.10 compatibilty code.
2018-01-04 10:22:16 -08:00
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
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
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