Commit Graph

13804 Commits (9fab05fe59fb4e02deb0f839ae2ae79954bbda4c)

Author SHA1 Message Date
k8s-merge-robot 9fab05fe59 Merge pull request #29743 from timothysc/wait_race_fix
Automatic merge from submit-queue

Fix race condition found in JitterUntil.

This was caused by the recent addition of "sliding"

manifested in: https://github.com/kubernetes/kubernetes/issues/26782
2016-07-28 22:35:21 -07:00
k8s-merge-robot 7abc3de621 Merge pull request #29694 from jsafrane/dynprov2-apionly
Automatic merge from submit-queue

Add API for StorageClasses

This is the API objects only required for dynamic provisioning picked apart from the controller logic.

Entire feature is here: https://github.com/kubernetes/kubernetes/pull/29006
2016-07-28 22:00:05 -07:00
k8s-merge-robot 821ff657f9 Merge pull request #27199 from derekwaynecarr/disk_eviction
Automatic merge from submit-queue

Initial support for pod eviction based on disk

This PR adds the following:

1. node reports disk pressure condition based on configured thresholds
1. scheduler does not place pods on nodes reporting disk pressure
1. kubelet will not admit any pod when it reports disk pressure
1. kubelet ranks pods for eviction when low on disk
1. kubelet evicts greediest pod

Follow-on PRs will need to handle:

1. integrate with new image gc PR (https://github.com/kubernetes/kubernetes/pull/27199)
1. container gc policy should always run (will not be launched from eviction, tbd who does that)
  1. this means kill pod is fine for all eviction code paths since container gc will remove dead container
1. min reclaim support will just poll summary provider (derek will do follow-on)
1. need to know if imagefs is same device as rootfs from summary (derek follow-on)

/cc @vishh @kubernetes/sig-node
2016-07-28 20:18:54 -07:00
k8s-merge-robot 15c0c2c901 Merge pull request #29532 from anish/iscsi_iface
Automatic merge from submit-queue

Check iscsi iface file for transport name

When checking for tcp vs hardware transports, check actual iscsi iface file to see if we are using tcp as a transport, rather than relying on just the transport name of 'default'.

This fixes the open-iscsi software iscsi initiator for non-default interfaces.
fixes #27131
2016-07-28 19:42:09 -07:00
k8s-merge-robot 96996985a0 Merge pull request #29737 from andreykurilin/fix_kubectl_help_cmd
Automatic merge from submit-queue

Fix kubectl help command

PR 48d47b1027 broke `kubectl help` command due
to wrong check `help for help cmd` .

Fixes #29736
2016-07-28 19:07:55 -07:00
k8s-merge-robot 306678f941 Merge pull request #29468 from caesarxuchao/no-omitempty-listitems
Automatic merge from submit-queue

remove the omitempty tag from CertificateSigningRequestList.Items

As a general rule, `Items` should be a required field in all lists. In a followup PR, I'll update the api-convention.md and add a check in the schema registration path to enforce the rule. I need to fix this bug to unblock other work.

@kubernetes/api-review-team cc @bgrant0607-cc
2016-07-28 18:33:11 -07:00
k8s-merge-robot 7aa592bfa3 Merge pull request #29553 from yujuhong/docker-shim
Automatic merge from submit-queue

Add a docker-shim package

Add a new docker integration with kubelet using the new runtime API.
This change adds the package with the skeleton and implements some of the basic operations.


This PR only implements a small sets of functions. The rest of the functions will be implemented
in the followup PRs to keep the changes readable, and the reviewers sane.

Note: The first commit is from #28396, only the second commit is for review. 

/cc @kubernetes/sig-node @feiskyer @Random-Liu
2016-07-28 17:58:56 -07:00
k8s-merge-robot 27af240d4f Merge pull request #29539 from wojtek-t/optimize_pod_affinity_3
Automatic merge from submit-queue

Optimize PodAffinity priority function
2016-07-28 16:59:30 -07:00
childsb f5bd7d471e API Changes for StorageClass 2016-07-28 19:01:01 -04:00
k8s-merge-robot aba7ae0d90 Merge pull request #29655 from smarterclayton/petset_client
Automatic merge from submit-queue

Add Apps() and PetSet client to client/unversioned

Also add a test fake
2016-07-28 13:54:16 -07:00
derekwaynecarr d37710f87b Allow cAdvisor to collect fs stats before building resource ranking funcs 2016-07-28 16:20:09 -04:00
k8s-merge-robot b6b44b2d90 Merge pull request #29652 from lojies/shorthandconfigmaps
Automatic merge from submit-queue

add shorthand cm for configmaps

add shorthand 'cm' for configmaps.
2016-07-28 13:16:57 -07:00
derekwaynecarr 0de1e62b30 modify fsStats to fsStatsType to avoid confusion with cadvisor types 2016-07-28 16:01:38 -04:00
derekwaynecarr c3324b88a0 Eviction manager observes and acts on disk pressure 2016-07-28 16:01:38 -04:00
k8s-merge-robot 61524b9e15 Merge pull request #29526 from vishh/logfilelen
Automatic merge from submit-queue

Restrict log sym link to 256 characters

This fix can potentially cause conflicts in log file names. The current model of exporting log data is fundamentally broken. This PR does not attempt to fix all of the issues.
2016-07-28 12:10:51 -07:00
k8s-merge-robot eae90a3631 Merge pull request #26332 from resouer/util-debt
Automatic merge from submit-queue

Refactor util clock into it's own pkg

Continue my work ref #15634
2016-07-28 11:37:06 -07:00
Vishnu Kannan acc74fbaa9 restrict log sym link filename to 255 characters
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2016-07-28 10:23:17 -07:00
Timothy St. Clair 842f15c3c6 Fix race condition found in JitterUntil. 2016-07-28 11:41:02 -05:00
k8s-merge-robot 7e1e51844f Merge pull request #29618 from aveshagarwal/master-rhbz-1357825
Automatic merge from submit-queue

Fix kubelet to not accept negative eviction (hard, soft) thresholds

@kubernetes/rh-cluster-infra @derekwaynecarr
2016-07-28 08:10:02 -07:00
Wojciech Tyczynski 898a6444e3 Return pointer for Affinity in api helper 2016-07-28 16:57:28 +02:00
Andrey Kurilin b2f8ee4f12 Fix kubectl help command
PR 48d47b1027 broke `kubectl help` command due
to wrong check `help for help cmd` .

Fixed issue #29736
2016-07-28 17:47:03 +03:00
k8s-merge-robot cdca508dba Merge pull request #29599 from matttproud/refactor/simplify/nodecontroller
Automatic merge from submit-queue

pkg/controller/node/nodecontroller: simplify mutex

Similar to #29598, we can rely on the zero-value construction behavior
to embed `sync.Mutex` into parent structs.

/CC: @saad-ali
2016-07-28 07:06:06 -07:00
k8s-merge-robot 42000793a6 Merge pull request #29588 from smarterclayton/init_container_quota
Automatic merge from submit-queue

Init container quota is inaccurate

Usage charged should be max of greater of init container or all regular
containers. Also, need to validate init container inputs

@derekwaynecarr
2016-07-28 06:34:20 -07:00
k8s-merge-robot 62e7c57acc Merge pull request #29598 from matttproud/refactor/simplify/goroutinemap
Automatic merge from submit-queue

pkg/util/goroutinemap: apply idiomatic Go cleanups

Package goroutinemap can be structurally simplified to be more
idiomatic, concise, and free of error potential.  No structural changes
are made.

It is unconventional declare `sync.Mutex` directly as a pointerized
field in a parent structure.  The `sync.Mutex` operates on pointer
receivers of itself; and by relying on that, the types that contain
those fields can be safely constructed using
https://golang.org/ref/spec#The_zero_value semantic.

The duration constants are already of type `time.Duration`, so
re-declaring that is redundant.

/CC: @saad-ali
2016-07-28 04:44:26 -07:00
k8s-merge-robot 2817674715 Merge pull request #29557 from deads2k/make-prefx-configurable
Automatic merge from submit-queue

make the resource prefix in etcd configurable for cohabitation

This looks big, its not as bad as it seems.

When you have different resources cohabiting, the resource name used for the etcd directory needs to be configurable.  HPA in two different groups worked fine before.  Now we're looking at something like RC<->RS.  They normally store into two different etcd directories.  This code allows them to be configured to store into the same location.

To maintain consistency across all resources, I allowed the `StorageFactory` to indicate which `ResourcePrefix` should be used inside `RESTOptions` which already contains storage information.

@lavalamp affects cohabitation.
@smarterclayton @mfojtik prereq for our rc<->rs and d<->dc story.
2016-07-28 03:01:28 -07:00
k8s-merge-robot 2480ef5f1d Merge pull request #28178 from mikedanese/cni-reload
Automatic merge from submit-queue

periodically reload the cni plugin configuration

Might fix #28787
2016-07-28 02:27:43 -07:00
k8s-merge-robot 5c6c8eb9a6 Merge pull request #29531 from AdoHe/rolling_update_panic
Automatic merge from submit-queue

fix kubectl rolling update empty file cause panic issue

 ```release-note
Fix issue with kubectl panicing when passed files that do not exist.
```

Fix #29398 
@pwittrock @justinsb ptal. This just fix on the cmd layer, I am thinking whether we should return err from marshal&unmarshal if the reader is empty.
2016-07-28 01:54:56 -07:00
k8s-merge-robot 685fc92f65 Merge pull request #29492 from Random-Liu/bumpup-cadvisor-version
Automatic merge from submit-queue

Bump cadvisor dependencies to latest head. 

Fixes #28619 
Fixes #28997 

This is another try of https://github.com/kubernetes/kubernetes/pull/29153.

To update cadvisor godeps, we did:
* Bump up docker version to v1.11.2 for both cadvisor [https://github.com/google/cadvisor/pull/1388] and k8s.
* Bump up cadvisor `go-systemd` version to be the same with k8s [https://github.com/google/cadvisor/pull/1390]. Or else, a package `github.com/coreos/pkg/dlopen` will be removed by Godep, because it is used by new `go-systemd` in k8s, but not used by old `go-systemd` in cadvisor.
* Bump up runc version to be the same with docker v1.11.2 just in case.
* Add `github.com/Azure/go-ansiterm` dependency which is needed by docker v1.11.2.
* Change `pkg/util/term/`, because `SetWinsSize` is removed from windows platform in docker v1.11.2. [The first commit]

@vishh 
/cc @ncdc for the `pkg/util/term` change.
2016-07-28 01:19:42 -07:00
Harry Zhang cb14b35bde Refactor util clock into it's own pkg 2016-07-28 02:29:04 -04:00
k8s-merge-robot 1c72ba6810 Merge pull request #29520 from hongchaodeng/serr
Automatic merge from submit-queue

storage error: precondition failure should return invalid object error

In introducing the preconditions by @caesarxuchao , if check preconditions failed, it returns resource version conflict error. This is the wrong error to return, and instead it should return invalid object error. We need to separate these two types of errors.
See the implementation in etcd3 [https://github.com/kubernetes/kubernetes/blob/master/pkg/storage/etcd3/store.go#L467].

Also renaming "ErrCodeResourceVersionConflicts" to "ErrCodeVersionConflicts" for simpler reading.
2016-07-27 22:12:11 -07:00
k8s-merge-robot 5427e8aa02 Merge pull request #29544 from lixiaobing10051267/masterFuncNote
Automatic merge from submit-queue

Func note is copied same as other one
2016-07-27 21:07:03 -07:00
k8s-merge-robot 40a6d68efb Merge pull request #29541 from lixiaobing10051267/masterTimeOut2
Automatic merge from submit-queue

Log information wrong while wait.ForeverTestTimeout
2016-07-27 21:06:52 -07:00
k8s-merge-robot 1ae9b73cd3 Merge pull request #29673 from pmorie/mount-collision
Automatic merge from submit-queue

Fix mount collision timeout issue

Short- or medium-term workaround for #29555.  The root issue being fixed here is that the recent attach/detach work in the kubelet uses a unique volume name as a key that tracks the work that has to be done for each volume in a pod to attach/mount/umount/detach.  However, the non-attachable volume plugins do not report unique names for themselves, which causes collisions when a single secret or configmap is mounted multiple times in a pod.

This is still a WIP -- I need to add a couple E2E tests that ensure that tests break in the future if there is a regression -- but posting for early review.

cc @kubernetes/sig-storage 

Ultimately, I would like to refine this a bit further.  A couple things I would like to change:

1.  `GetUniqueVolumeName` should be a property ONLY of attachable volumes
2.  I would like to see the kubelet apparatus for attach/mount/umount/detach handle non-attachable volumes specifically to avoid things like the `WaitForControllerAttach` call that has to be done for those volume types now
2016-07-27 21:06:47 -07:00
k8s-merge-robot 1f9c41dc3a Merge pull request #29495 from xiangpengzhao/fix-defer-fclose
Automatic merge from submit-queue

defer file.Close() in resource_printer.go
2016-07-27 19:19:34 -07:00
Yu-Ju Hong 03d11bcf4e Add a dockershim package
Add a new docker integration with kubelet using the new runtime API.
This change adds the package with some skeletons, and implements some
of the basic operations.
2016-07-27 18:30:25 -07:00
k8s-merge-robot e008087e0a Merge pull request #29457 from derekwaynecarr/service-node-port-quota-fix
Automatic merge from submit-queue

Quota was not counting services with multiple nodeports properly

```release-note
If a service of type node port declares multiple ports, quota on "services.nodeports" will charge for each port in the service.
```

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

/cc @kubernetes/rh-cluster-infra @sdminonne
2016-07-27 18:09:40 -07:00
Lantao Liu 01a5ddd782 Not to use SetWinsize in windows 2016-07-27 17:22:30 -07:00
k8s-merge-robot 75c93b4063 Merge pull request #29439 from matttproud/cleanups_volumeflocker
Automatic merge from submit-queue

volume/flocker: plug time.Ticker resource leak

This commit ensures that `flockerMounter.updateDatasetPrimary` does not leak
running `time.Ticker` instances.  Upon termination of the consuming routine, we
stop the tickers.

```release-note
* flockerMounter.updateDatasetPrimary no longer leaks running time.Ticker instances.
  Upon termination of the consuming routine, we stop the tickers.
```
2016-07-27 17:18:34 -07:00
k8s-merge-robot ab7d039c81 Merge pull request #29388 from ronnielai/image-gc-check
Automatic merge from submit-queue

Avoiding trying to gc images with no tags which are still in use

#29325
2016-07-27 16:44:50 -07:00
k8s-merge-robot 3301f6d14f Merge pull request #29356 from smarterclayton/init_containers
Automatic merge from submit-queue

LimitRanger and PodSecurityPolicy need to check more on init containers

Container limits not applied to init containers. HostPorts not checked on podsecuritypolicy

@pweil- @derekwaynecarr
2016-07-27 16:09:34 -07:00
Paul Morie c884297990 Fix collisions issues / timeouts for mounts
For non-attachable volumes, do not call GetVolumeName on the plugin and instead
generate a unique name based on the identity of the pod and the name of the volume
within the pod.
2016-07-27 17:53:50 -04:00
Yu-Ju Hong 0ac247c6a7 Add kuberuntime.go 2016-07-27 14:34:30 -07:00
k8s-merge-robot e86b3f266c Merge pull request #29641 from ivan4th/fix-configmap-race
Automatic merge from submit-queue

Fix wrapped volume race

**EDIT:** now covers configmap, secret, downwardapi & git_repo volume plugins.

Fixes #29297.

wrappedVolumeSpec used by configMapVolumeMounter and
configMapVolumeUnmounter contained a pointer to api.Volume which was
being patched by NewWrapperMounter/NewWrapperUnmounter, causing race
condition during configmap volume mounts.

See https://github.com/kubernetes/kubernetes/issues/29297#issuecomment-235403806 for complete explanation.
The subtle bug was introduced by #18445, it also can affect other volume plugins utilizing `wrappedVolumeSpec` technique, if this PR is correct/accepted will make more PRs for secrets etc. Although tmpfs variety of inner `emptyDir` volume appears to be less susceptible to this race, there's chance it can fail too.

The errors produced by this race look like this:
```Jul 19 17:05:21 ubuntu1604 kubelet[17097]: I0719 17:05:21.854303   17097 reconciler.go:253] MountVolume operation started for volume "kubernetes.io/configmap/foo-files"
 (spec.Name: "files") to pod "11786582-4dbf-11e6-9fc9-64cca009c636" (UID: "11786582-4dbf-11e6-9fc9-64cca009c636").
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: I0719 17:05:21.854842   17097 reconciler.go:253] MountVolume operation started for volume "kubernetes.io/configmap/bar-file
s" (spec.Name: "files") to pod "117d2c22-4dbf-11e6-9fc9-64cca009c636" (UID: "117d2c22-4dbf-11e6-9fc9-64cca009c636").
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.860796   17097 configmap.go:171] Error creating atomic writer: stat /var/lib/kubelet/pods/117d2c22-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.861070   17097 goroutinemap.go:155] Operation for "kubernetes.io/configmap/bar-files" failed. No retries permitted until 2016-07-19 17:07:21.861036886 +0200 CEST (durationBeforeRetry 2m0s). error: MountVolume.SetUp failed for volume "kubernetes.io/configmap/bar-files" (spec.Name: "files") pod "117d2c22-4dbf-11e6-9fc9-64cca009c636" (UID: "117d2c22-4dbf-11e6-9fc9-64cca009c636") with: stat /var/lib/kubelet/pods/117d2c22-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.861271   17097 configmap.go:171] Error creating atomic writer: stat /var/lib/kubelet/pods/11786582-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory
Jul 19 17:05:21 ubuntu1604 kubelet[17097]: E0719 17:05:21.862284   17097 goroutinemap.go:155] Operation for "kubernetes.io/configmap/foo-files" failed. No retries permitted until 2016-07-19 17:07:21.862275753 +0200 CEST (durationBeforeRetry 2m0s). error: MountVolume.SetUp failed for volume "kubernetes.io/configmap/foo-files" (spec.Name: "files") pod "11786582-4dbf-11e6-9fc9-64cca009c636" (UID: "11786582-4dbf-11e6-9fc9-64cca009c636") with: stat /var/lib/kubelet/pods/11786582-4dbf-11e6-9fc9-64cca009c636/volumes/kubernetes.io~configmap/files: no such file or directory```

Note "Error creating atomic writer" errors.
This problem can be reproduced by making kubelet mount multiple config map volumes in parallel.
2016-07-27 14:24:14 -07:00
Clayton Coleman 958d78cb10
Init container quota is inaccurate
Usage charged should be max of greater of init container or all regular
containers. Also, need to validate init container inputs
2016-07-27 15:44:18 -04:00
Ron Lai 64981aaf46 Avoiding trying to gc images with no tags which are still in use 2016-07-27 10:31:47 -07:00
Mike Danese 792868c743 periodically reload the cni plugin config
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-07-27 10:07:52 -07:00
Avesh Agarwal cb7766de19 Fix kubelet to not accept negative eviction (hard, soft) thresholds
and add unit tests
2016-07-27 10:56:31 -04:00
Clayton Coleman d67187856f
No PetSet client in client/unversioned
Also add fakes
2016-07-27 10:08:58 -04:00
deads2k aa3db4d995 make the resource prefix in etcd configurable for cohabitation 2016-07-27 07:51:40 -04:00
k8s-merge-robot 5b7f7e7bd3 Merge pull request #29365 from lixiaobing10051267/masterLen
Automatic merge from submit-queue

len(vmList) output format not correct

len(vmList) output format not correct, not "%s", is "%d".
2016-07-27 02:41:58 -07:00