Commit Graph

4141 Commits (fb608070408f4d38c0239c9d4bbe2585c7852060)

Author SHA1 Message Date
Kubernetes Submit Queue bc861bf756 Merge pull request #39475 from deads2k/generic-14-apimachinery
Automatic merge from submit-queue (batch tested with PRs 39475, 38666, 39327, 38396, 39613)

Create k8s.io/apimachinery repo

Don't panic.

The diff is quite large, but its all generated change.  The first few commits are where are all the action is.  I built a script to find the fanout from 
```
k8s.io/kubernetes/pkg/apimachinery/registered
k8s.io/kubernetes/pkg/runtime/serializer
k8s.io/kubernetes/pkg/runtime/serializer/yaml
k8s.io/kubernetes/pkg/runtime/serializer/streaming
k8s.io/kubernetes/pkg/runtime/serializer/recognizer/testing 
```

It copied 
```
k8s.io/kubernetes/pkg/api/meta
k8s.io/kubernetes/pkg/apimachinery
k8s.io/kubernetes/pkg/apimachinery/registered
k8s.io/kubernetes/pkg/apis/meta/v1
k8s.io/kubernetes/pkg/apis/meta/v1/unstructured
k8s.io/kubernetes/pkg/conversion
k8s.io/kubernetes/pkg/conversion/queryparams
k8s.io/kubernetes/pkg/genericapiserver/openapi/common - this needs to renamed post-merge.  It's just types
k8s.io/kubernetes/pkg/labels
k8s.io/kubernetes/pkg/runtime
k8s.io/kubernetes/pkg/runtime/schema
k8s.io/kubernetes/pkg/runtime/serializer
k8s.io/kubernetes/pkg/runtime/serializer/json
k8s.io/kubernetes/pkg/runtime/serializer/protobuf
k8s.io/kubernetes/pkg/runtime/serializer/recognizer
k8s.io/kubernetes/pkg/runtime/serializer/recognizer/testing
k8s.io/kubernetes/pkg/runtime/serializer/streaming
k8s.io/kubernetes/pkg/runtime/serializer/versioning
k8s.io/kubernetes/pkg/runtime/serializer/yaml
k8s.io/kubernetes/pkg/selection
k8s.io/kubernetes/pkg/types
k8s.io/kubernetes/pkg/util/diff
k8s.io/kubernetes/pkg/util/errors
k8s.io/kubernetes/pkg/util/framer
k8s.io/kubernetes/pkg/util/json
k8s.io/kubernetes/pkg/util/net
k8s.io/kubernetes/pkg/util/runtime
k8s.io/kubernetes/pkg/util/sets
k8s.io/kubernetes/pkg/util/validation
k8s.io/kubernetes/pkg/util/validation/field
k8s.io/kubernetes/pkg/util/wait
k8s.io/kubernetes/pkg/util/yaml
k8s.io/kubernetes/pkg/watch
k8s.io/kubernetes/third_party/forked/golang/reflect
```

The script does the import rewriting and gofmt.  Then you do a build, codegen, bazel update, and it produces all the updates.

If we agree this is the correct approach.  I'll create a verify script to make sure that no one messes with any files in the "dead" packages above.

@kubernetes/sig-api-machinery-misc @smarterclayton @sttts @lavalamp @caesarxuchao 

`staging/prime-apimachinery.sh && hack/update-codegen.sh && nice make WHAT="federation/cmd/federation-apiserver/ cmd/kube-apiserver" && hack/update-openapi-spec.sh && hack/update-federation-openapi-spec.sh && hack/update-codecgen.sh && hack/update-codegen.sh && hack/update-generated-protobuf.sh && hack/update-bazel.sh`
2017-01-11 09:14:49 -08:00
Paulo Pires f4edaf2b8c
dockertools: disable swap on Linux since it's unsupported.
Refs #39005
2017-01-11 17:07:53 +00:00
Paulo Pires dacc363605
dockertools: fix Windows implementation.
Fixes #39005
Fixes #39714
2017-01-11 17:07:52 +00:00
Kubernetes Submit Queue cd55e1b259 Merge pull request #39714 from feiskyer/fix
Automatic merge from submit-queue (batch tested with PRs 39714, 39646)

dockertools: fix build on OSX

#39005 introduces a build problem on OSX. This PR fixes it.

Refer [here](https://github.com/kubernetes/kubernetes/pull/39005#issuecomment-271781026).
2017-01-11 08:00:47 -08:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Kubernetes Submit Queue 1fbb22e115 Merge pull request #39702 from mikedanese/kubelet-csr
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

kubelet: request client auth certificates from certificate API.

This fixes kubeadm and --experiment-kubelet-bootstrap.

cc @liggitt
2017-01-10 22:24:17 -08:00
Kubernetes Submit Queue 3f9f7471af Merge pull request #38989 from sjenning/set-qos-field
Automatic merge from submit-queue (batch tested with PRs 39684, 39577, 38989, 39534, 39702)

Set PodStatus QOSClass field

This PR continues the work for https://github.com/kubernetes/kubernetes/pull/37968

It converts all local usage of the `qos` package class types to the new API level types (first commit) and sets the pod status QOSClass field in the at pod creation time on the API server in `PrepareForCreate` and in the kubelet in the pod status update path (second commit).  This way the pod QOS class is set even if the pod isn't scheduled yet.

Fixes #33255

@ConnorDoyle @derekwaynecarr @vishh
2017-01-10 22:24:13 -08:00
Pengfei Ni 1f17a47f4e dockertools: fix build on OSX 2017-01-11 14:08:30 +08:00
Kubernetes Submit Queue d3c0914a14 Merge pull request #39005 from brendandburns/windows
Automatic merge from submit-queue (batch tested with PRs 38212, 38792, 39641, 36390, 39005)

Set MemorySwap to zero on Windows

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

@dchen1107 @michmike @kubernetes/sig-node-misc
2017-01-10 19:48:16 -08:00
Kubernetes Submit Queue addc6cae4a Merge pull request #38212 from mikedanese/kubeletauth
Automatic merge from submit-queue (batch tested with PRs 38212, 38792, 39641, 36390, 39005)

Generate a kubelet CA and kube-apiserver cert-pair for kubelet auth.

cc @cjcullen
2017-01-10 19:48:09 -08:00
Mike Danese d2032fd83c kubelet: request client auth certificates from certificate API. 2017-01-10 17:57:39 -08:00
Yu-Ju Hong ec0e99c2ed Check the health of PLEG when updating the node status 2017-01-10 16:34:00 -08:00
Yu-Ju Hong 03106dd1cb kubelet: remove the pleg health check from healthz/
If docker hangs, we don't want kubelet to get killed as well.
2017-01-10 16:32:46 -08:00
Kubernetes Submit Queue 65d6a5c6a8 Merge pull request #39455 from kubernetes/revert-39306-oom_score_adj
Automatic merge from submit-queue (batch tested with PRs 39486, 37288, 39477, 39455, 39542)

Revert "Small improve for GetContainerOOMScoreAdjust"

Reverts kubernetes/kubernetes#39306

This does not help current code healthy, let's revert it to avoid further confusing.
2017-01-10 14:33:17 -08:00
Seth Jennings e2402b781b set qos class field in pod status 2017-01-10 16:31:52 -06:00
Seth Jennings 4c30459e49 switch from local qos types to api types 2017-01-10 10:54:30 -06:00
Marc-Antoine Ross c01c7023a0 Fix 2 `sucessfully` typos 2017-01-10 10:37:45 -05:00
Brendan Burns c050826fea Set MemorySwap to zero on Windows 2017-01-09 23:08:48 -08:00
deads2k 1df5b658f2 switch webhook to clientgo 2017-01-09 16:53:24 -05:00
Kubernetes Submit Queue 0bbb49d2d5 Merge pull request #39479 from fraenkel/podkiller
Automatic merge from submit-queue

Avoid panic when stopping the podKiller

use a mutex instead of a channel

fixes #38857
2017-01-06 16:02:16 -08:00
Kubernetes Submit Queue aa7509989b Merge pull request #39318 from NickrenREN/eviction-manager-start
Automatic merge from submit-queue

remove eviction-manager start return err
2017-01-06 11:55:41 -08:00
Kubernetes Submit Queue 402abd23ef Merge pull request #39493 from sjenning/fix-null-deref
Automatic merge from submit-queue (batch tested with PRs 39493, 39496)

kubelet: fix nil deref in volume type check

An attempt to address memory exhaustion through a build up of terminated pods with memory backed volumes on the node in PR https://github.com/kubernetes/kubernetes/pull/36779 introduced this.

For the `VolumeSpec`, either the `Volume` or `PersistentVolume` field is set, not both.  This results in a situation where there is a nil deref on PVs.  Since PVs are inherently not memory-backend, only local/temporal volumes should be considered.

This needs to go into 1.5 as well.

Fixes #39480

@saad-ali @derekwaynecarr @grosskur @gnufied

```release-note
fixes nil dereference when doing a volume type check on persistent volumes
```
2017-01-06 08:44:18 -08:00
NickrenREN 85e6076fab remove eviction-manager start return err
Start() function will never return err,we do not need the return value
2017-01-06 09:32:16 +08:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Seth Jennings c4e6725236 fix nil deref 2017-01-05 15:36:42 -06:00
Michael Fraenkel fb3a1d6851 Avoid panic when stopping the podKiller
use a mutex instead of a channel
2017-01-05 14:52:24 -05:00
deads2k 4d7fcae85a mechanicals 2017-01-05 11:14:27 -05:00
Harry Zhang 9712fe8455 Revert "Small improve for GetContainerOOMScoreAdjust" 2017-01-05 09:54:11 +08:00
Michael Fraenkel f6c9ab4312 Check if key is a valid after prefix is prepended
- Allow invalid keys to become valid by requiring a prefix
2017-01-04 17:26:44 -05:00
Kubernetes Submit Queue 5ee52e8bce Merge pull request #39384 from deads2k/generic-01-start-staging
Automatic merge from submit-queue

Start moving genericapiserver to staging

This moves `pkg/auth/user` to `staging/k8s.io/genericapiserver/pkg/authentication/user`.  I'll open a separate pull into the upstream gengo to support using `import-boss` on vendored folders to support staging.

After we agree this is the correct approach and see everything build, I'll start moving other packages over which don't have k8s.io/kubernetes deps.

@kubernetes/sig-api-machinery-misc @lavalamp 
@sttts @caesarxuchao ptal
2017-01-04 12:06:34 -08:00
Jess Frazelle db75904b42
fix when os.Remove should be os.RemoveAll
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:34:06 -08:00
Jess Frazelle 7db9c8b454
cleanup fooPodContainerDir in /tmp
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:27:08 -08:00
Jess Frazelle a2dbd456a7
cleanup all /tmp/kubelet_test files
Signed-off-by: Jess Frazelle <acidburn@google.com>
2017-01-04 10:26:24 -08:00
deads2k ca58ec0237 mechanical changes for move 2017-01-04 10:27:05 -05:00
Kubernetes Submit Queue 2cc9650e7e Merge pull request #39306 from hex108/oom_score_adj
Automatic merge from submit-queue (batch tested with PRs 38084, 39306)

Small improve for GetContainerOOMScoreAdjust

In `GetContainerOOMScoreAdjust`, make logic more clear for the case `oomScoreAdjust >= besteffortOOMScoreAdj`. If `besteffortOOMScoreAdj`  is defined to another value(e.g. 996), suppose `oomScoreAdjust` is 999, the function will return 998(which equals 999 - 1) instead of 995(996 -1).
2017-01-04 07:18:07 -08:00
Kubernetes Submit Queue 9b726d6b8f Merge pull request #38687 from ivan4th/remove-dockerlegacyservice-comment-from-kubelet
Automatic merge from submit-queue

Remove DockerLegacyService comment from kubelet
2017-01-03 23:28:22 -08:00
Kubernetes Submit Queue 819535b96a Merge pull request #36245 from fraenkel/env_configmap
Automatic merge from submit-queue (batch tested with PRs 38433, 36245)

Allow pods to define multiple environment variables from a whole ConfigMap

Allow environment variables to be populated from ConfigMaps

- ConfigMaps represent an entire set of EnvVars
- EnvVars can override ConfigMaps


fixes #26299
2017-01-03 23:28:09 -08:00
Kubernetes Submit Queue fe391d7bb0 Merge pull request #37350 from chentao1596/delete-meaningless-judgments
Automatic merge from submit-queue (batch tested with PRs 39280, 37350, 39389, 39390, 39313)

delete meaningless judgments

What this PR does / why we need it:
      Whether "err" is nil or not, "err" can be return, so the judgment "err !=nil " is unnecessary
2017-01-03 18:25:10 -08:00
Kubernetes Submit Queue 9eaf1aa38f Merge pull request #39273 from NickrenREN/kubelet-node-status
Automatic merge from submit-queue (batch tested with PRs 39001, 39104, 35978, 39361, 39273)

delete SetNodeStatus() function and fix some function notes words
2017-01-03 17:18:12 -08:00
CJ Cullen d0997a3d1f Generate a kubelet CA and kube-apiserver cert-pair for kubelet auth.
Plumb through to kubelet/kube-apiserver on gci & cvm.
2017-01-03 14:30:45 -08:00
Andy Goldstein 92a429887a Fix cadvisor_unsupported.go build tags
Make it so cadvisor_unsupported.go is used for linux without cgo or
non-linux/windows OSes.
2017-01-03 13:06:10 -05:00
Kubernetes Submit Queue 1cee8c45d6 Merge pull request #39237 from NickrenREN/pod-manager
Automatic merge from submit-queue (batch tested with PRs 39092, 39126, 37380, 37093, 39237)

Add unit test function to test DeletePod
2017-01-03 09:45:26 -08:00
Michael Fraenkel 2d803afc98 ConfigMaps populate environment variables 2017-01-03 11:02:15 -05:00
Dr. Stefan Schimanski 87dd990bb7 Move pkg/api.{Context,RequestContextMapper} into pkg/genericapiserver/api/request 2017-01-03 14:57:33 +01:00
NickrenREN fd336cde07 drop SetNodeStatus() function and fix some function notes words
drop SetNodeStatus() Since it is never called now. klet.defaultNodeStatusFuncs() is set to klet.setNodeStatusFuncs now and setNodeStatus() function is called by other functions.
2017-01-03 11:26:50 +08:00
NickrenREN 0f35ce1af3 drop NewManager() return err
NewManager will never return err,drop it
2017-01-03 11:24:12 +08:00
NickrenREN 2fa0935c19 Add unit test function to test DeletePod
Add unit test function to test DeletePod() of podManager
2017-01-03 11:08:39 +08:00
Jeff Grafton fae627dd65 Update generated for 2017 2017-01-01 23:11:09 -08:00
Kubernetes Submit Queue f5d9c430e9 Merge pull request #39298 from feiskyer/images
Automatic merge from submit-queue

Kubelet: add image ref to ImageService interfaces

This PR adds image ref (digest or ID, depending on runtime) to PullImage result, and pass image ref in CreateContainer instead of image name. It also

* Adds image ref to CRI's PullImageResponse
* Updates related image puller
* Updates related testing utilities

~~One remaining issue is: it breaks some e2e tests because they [checks image repoTags](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/framework/util.go#L1941) while docker always returns digest in this PR. Should we update e2e test or continue to return repoTags in `containerStatuses.image`?~~

Fixes #38833.
2016-12-30 22:51:18 -08:00
Pengfei Ni 67a5bf8454 Rename imageservice.IsImagePresent to GetImageRef 2016-12-31 08:36:55 +08:00
Pengfei Ni 1de92a91e9 Return repoTags instead of digest in containerStatuses.image 2016-12-30 10:48:49 +08:00
Kubernetes Submit Queue d97f125ddf Merge pull request #39050 from mikedanese/gazel-bump
Automatic merge from submit-queue

bump gazel: pick up some new unit tests
2016-12-29 15:19:18 -08:00
Kubernetes Submit Queue c7063fd6c0 Merge pull request #39300 from feiskyer/kubenet
Automatic merge from submit-queue (batch tested with PRs 39307, 39300)

kubenet: define KubenetPluginName for all platforms

This PR moved KubenetPluginName to a general file for all platforms.

Fixes #39299.

cc/ @yifan-gu @freehan
2016-12-29 13:35:03 -08:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Jun Gong e417fd2faa Small improve for GetContainerOOMScoreAdjust 2016-12-29 21:25:43 +08:00
Pengfei Ni 394aad9d6b rkt: add image ref to ImageService interfaces 2016-12-29 16:53:09 +08:00
Pengfei Ni 9d52b761cc kuberuntime/dockershim: add image ref to ImageService interfaces 2016-12-29 16:53:01 +08:00
Pengfei Ni fafccad384 dockertools: add image ref to ImageService interfaces 2016-12-29 16:52:43 +08:00
Pengfei Ni fcbf39ea54 dockertools: add image ref to ImageService interfaces 2016-12-29 16:31:14 +08:00
Pengfei Ni 37fc81be0e kubelet/images: return image ref in EnsureImageExists 2016-12-29 16:31:14 +08:00
Pengfei Ni ba5a684c4c CRI: add image ref to PullImageResponse 2016-12-29 16:31:14 +08:00
Pengfei Ni cac38615ac kubecontainer: add image ref to ImageService interfaces 2016-12-29 16:31:14 +08:00
Kubernetes Submit Queue 9a428cc5e0 Merge pull request #39184 from feiskyer/dockertools
Automatic merge from submit-queue

dockertools: don't test linux-specific cases on OSX

There are a few test cases in dockertools are linux-specific. This PR moves them to docker_manager_linux_test.go

Fixes #39183.
2016-12-29 00:14:22 -08:00
Pengfei Ni 25dee7dd83 kubenet: define KubenetPluginName for all platforms 2016-12-29 15:39:16 +08:00
Kubernetes Submit Queue f1c8b7581d Merge pull request #36446 from jonboulle/master
Automatic merge from submit-queue (batch tested with PRs 39053, 36446)

CRI: clarify purpose of annotations

Add language to make it explicit that annotations are not to be altered
by runtimes, and should only be used for features that are opaque to the
Kubernetes APIs. Unfortunately there are currently exceptions
introduced in [1][1], but this change makes it clear that they are to be
changed and that no more such semantic-affecting annotations should be
introduced.

In the spirit of the discussion and conclusion in [2][2].

Also captures the link between the annotations returned by various
status queries and those supplied in associated configs.

[1]: https://github.com/kubernetes/kubernetes/pull/34819
[2]: https://github.com/kubernetes/kubernetes/issues/30819#issuecomment-253369441
2016-12-28 19:07:06 -08:00
Kubernetes Submit Queue 281053d666 Merge pull request #38155 from freehan/cleanup-txqueue
Automatic merge from submit-queue (batch tested with PRs 39218, 38155)

clean up logic that configs TX queue length

fix: #25143
2016-12-28 16:10:03 -08:00
Kubernetes Submit Queue 41956a682d Merge pull request #39254 from freehan/cleanup-exec-networkplugin
Automatic merge from submit-queue

Remove 'exec' network plugin - use CNI instead

fixes: #38639
2016-12-28 14:00:48 -08:00
Kubernetes Submit Queue c3771cbaf9 Merge pull request #36922 from rkouj/refactor-operation-executor
Automatic merge from submit-queue

Refactor operation_executor to make it testable

**What this PR does / why we need it**:
To refactor operation_executor to make it unit testable

**Release note**:
`NONE`
2016-12-27 19:01:56 -08:00
rkouj e7e3c55ad7 Add unit tests for MountVolume() of operation executor 2016-12-27 16:07:06 -08:00
rkouj d5f7610b82 Refactor operation_executor to make it unit testable 2016-12-27 15:12:16 -08:00
Minhan Xia ff6cdeb9b8 clean up logic that configs TX queue length 2016-12-27 14:43:47 -08:00
Minhan Xia 5e39b3d9c3 clean up exec network plugin 2016-12-27 14:04:57 -08:00
Jing Xu 3fbf68ef68 Add path exist check in getPodVolumePathListFromDisk
Add the path exist check in the function. If the path does not exist,
return empty list and nil error.
2016-12-27 13:32:13 -08:00
Pengfei Ni 16bcafb775 Update bazel 2016-12-23 11:54:16 +08:00
Pengfei Ni 1a67e0ee7a Do not test linux-specific cases on OSX in dockertools 2016-12-23 10:37:10 +08:00
bprashanth 1743c6b6ab Don't evict static pods 2016-12-22 16:22:14 -08:00
Jonathan Boulle 5d982b4a02 CRI: clarify purpose of annotations
Add language to make it explicit that annotations are not to be altered
by runtimes, and should only be used for features that are opaque to the
Kubernetes APIs. Unfortunately there are currently exceptions
introduced in [1][1], but this change makes it clear that they are to be
changed and that no more such semantic-affecting annotations should be
introduced.

In the spirit of the discussion and conclusion in [2][2].

Also captures the link between the annotations returned by various
status queries and those supplied in associated configs.

[1]: https://github.com/kubernetes/kubernetes/pull/34819
[2]: https://github.com/kubernetes/kubernetes/issues/30819#issuecomment-253369441
2016-12-22 11:40:12 +01:00
Kubernetes Submit Queue ab91500f15 Merge pull request #39068 from NickrenREN/imageManager-start
Automatic merge from submit-queue (batch tested with PRs 39076, 39068)

fix image manager Start() function return
2016-12-22 00:27:30 -08:00
Kubernetes Submit Queue ec897a16ab Merge pull request #39076 from NickrenREN/kubelet-volume-test
Automatic merge from submit-queue

add unit test for ListVolumesForPod

the result  of function ListVolumesForPod() checking
2016-12-22 00:27:18 -08:00
Dawn Chen b03fca9783 Fixed an import cycle issue:
import cycle not allowed in test
package k8s.io/kubernetes/pkg/client/restclient (test)
	imports k8s.io/kubernetes/pkg/api/testapi
	imports k8s.io/kubernetes/pkg/apis/componentconfig/install
	imports k8s.io/kubernetes/pkg/apis/componentconfig/v1alpha1
	imports k8s.io/kubernetes/pkg/kubelet/qos
	imports k8s.io/kubernetes/pkg/kubelet/pod
	imports k8s.io/kubernetes/pkg/client/clientset_generated/clientset
	imports k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/apps/v1beta1
	imports k8s.io/kubernetes/pkg/client/restclient
2016-12-21 16:34:24 -08:00
Dawn Chen 53931fbce4 assign -998 as the oom_score_adj for critical pods. 2016-12-21 16:07:49 -08:00
Kubernetes Submit Queue 60a34fda0a Merge pull request #38673 from resouer/pod-qos-shim
Automatic merge from submit-queue (batch tested with PRs 39079, 38991, 38673)

Support systemd based pod qos in CRI dockershim

This PR makes pod level QoS works for CRI dockershim for systemd based cgroups. And will also fix #36807
- [x] Add cgroupDriver to dockerService and use docker info api to set value for it
- [x] Add a NOTE that detection only works for docker 1.11+, see [CHANGE LOG](https://github.com/docker/docker/blob/master/CHANGELOG.md#1110-2016-04-13)
- [x] Generate cgroupParent in syntax expected by cgroupDriver
- [x] Set cgroupParent to hostConfig for both sandbox and user container
- [x] Check if kubelet conflicts with cgroup driver of docker

cc @derekwaynecarr @vishh
2016-12-21 08:01:45 -08:00
NickrenREN d27aa34b37 ListVolumesForPod checking
add a function to test the function of ListVolumesForPod()
2016-12-21 19:14:22 +08:00
NickrenREN bb5ccb978e fix image manager Start() function return
realImageGCManager's Start()  function will always return nil,we do not need the err return value,drop it.
2016-12-21 14:58:00 +08:00
Kubernetes Submit Queue f1a763e7d7 Merge pull request #38180 from NickrenREN/vmgr-actual-state
Automatic merge from submit-queue (batch tested with PRs 36888, 38180, 38855, 38590)

fix function notes
2016-12-20 20:33:54 -08:00
Kubernetes Submit Queue 1abb8498aa Merge pull request #36888 from linki/patch-1
Automatic merge from submit-queue (batch tested with PRs 36888, 38180, 38855, 38590)

wrong pod reference in error message for volume attach timeout

**What this PR does / why we need it**:
when a disk mount times out you get the following error:

```
Warning		FailedSync	Error syncing pod, skipping: timeout expired waiting for volumes to attach/mount for pod "nginx"/"default". list of unattached/unmounted volumes=[data]
```

where the pod is referenced by "podname"/"namespace", but should be "namespace"/"podname".

**Which issue this PR fixes**
no issue number

**Special notes for your reviewer**:
untested :(
2016-12-20 20:33:52 -08:00
NickrenREN dc7a0bf65e fix function notes
change the function notes according to the implementations of the function AddPodToVolume()
2016-12-21 10:02:20 +08:00
Kubernetes Submit Queue 5b2823adb9 Merge pull request #38191 from sttts/sttts-move-master-options
Automatic merge from submit-queue

Move non-generic apiserver code out of the generic packages
2016-12-17 01:25:45 -08:00
Kubernetes Submit Queue 699964c972 Merge pull request #38836 from bprashanth/kubelet_critical
Automatic merge from submit-queue

Admit critical pods in the kubelet

Haven't verified in a live cluster yet, just unittested, so applying do-not-merge label.
2016-12-16 17:21:46 -08:00
Dr. Stefan Schimanski 3be6b3c045 pkg/apiserver: remove unused code 2016-12-16 17:47:47 +01:00
Robert Rati 91931c138e [scheduling] Moved node affinity from annotations to api fields. #35518 2016-12-16 11:42:43 -05:00
Kubernetes Submit Queue 87444522d0 Merge pull request #32088 from piosz/fluentd-daemon-set
Automatic merge from submit-queue

Migrated fluentd addon to daemon set

fix #23224
supersedes #23306 

``` release-note
Migrated fluentd addon to daemon set
```
2016-12-15 23:04:40 -08:00
bprashanth b7409e0038 Sort critical pods before admission 2016-12-15 18:58:13 -08:00
bprashanth afd676d94c Kubelet admits critical pods even under memory pressure 2016-12-15 18:58:09 -08:00
Harry Zhang b36c5cbbec Enable pod qos for systemd in cri
Check kubelet config with docker config
2016-12-16 10:48:36 +08:00
Mike Danese 8fdec87d19 bazel: fix some unit tests 2016-12-15 18:36:22 -08:00
Kubernetes Submit Queue 1981a654a4 Merge pull request #38711 from wojtek-t/get_with_options_in_kubelet
Automatic merge from submit-queue (batch tested with PRs 38803, 38711)

Use Get from cache in apiserver in kubelet

Ref #37473
2016-12-15 05:56:17 -08:00
Piotr Szczesniak c00e57789d Added upgrade story from manifest pod to ds 2016-12-15 13:48:32 +01:00
Kubernetes Submit Queue f49442d433 Merge pull request #38502 from resouer/fix-wrong-comment
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Wrong comment to describe docker version

The original comment about minimal docker version fo `room_score_adj` is wrong (though the code is right).

Really sorry for misleading :/
2016-12-14 14:21:53 -08:00
Kubernetes Submit Queue d8efc779ed Merge pull request #38154 from caesarxuchao/rename-release_1_5
Automatic merge from submit-queue (batch tested with PRs 38154, 38502)

Rename "release_1_5" clientset to just "clientset"

We used to keep multiple releases in the main repo. Now that [client-go](https://github.com/kubernetes/client-go) does the versioning, there is no need to keep releases in the main repo. This PR renames the "release_1_5" clientset to just "clientset", clientset development will be done in this directory.

@kubernetes/sig-api-machinery @deads2k 

```release-note
The main repository does not keep multiple releases of clientsets anymore. Please find previous releases at https://github.com/kubernetes/client-go
```
2016-12-14 14:21:51 -08:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Harry Zhang 07d1736077 Wrong comment to describe docker version 2016-12-14 08:52:51 +00:00
Kubernetes Submit Queue 6893017b39 Merge pull request #38430 from freehan/cri-docker-network
Automatic merge from submit-queue (batch tested with PRs 38689, 38743, 38734, 38430)

apply sandbox network mode based on network plugin

This allows CRI to use docker's network bridge. Can be combined with noop network plugin. This allows to use docker0 with no further configuration. Good for tools like minikube/hyperkube.
2016-12-13 21:25:36 -08:00
Kubernetes Submit Queue c40404ae9a Merge pull request #38435 from timstclair/remotecmd-refactor
Automatic merge from submit-queue

Refactor remotecommand options parsing

Prerequisite to https://github.com/kubernetes/kubernetes/issues/36187 - This separates the options from the request, so they can be pulled from elsewhere.

/cc @liggitt
2016-12-13 18:12:15 -08:00
Kubernetes Submit Queue 1d3c7ca758 Merge pull request #38348 from euank/doc-our-privilege
Automatic merge from submit-queue (batch tested with PRs 38727, 38726, 38347, 38348)

Add 'privileged' to sandbox to indicate if any container might be privileged in it, document privileged

Right now, the privileged flag is this magic thing which does "whatever Docker does". This documents it to make it a little less magic.

In addition, due to how rkt uses `systemd-nspawn` as an outer layer of isolation in creating the sandbox, it's helpful to know beforehand whether the pod will be privileged so additional security options can be applied earlier / applied at all.

I suspect the same indication will be useful for userns since userns should also occur at the pod layer, but it's possible that will be a separate/additional field.


cc @lucab @jonboulle @yujuhong @feiskyer @kubernetes/sig-node 


```release-note
NONE
```
2016-12-13 17:31:53 -08:00
Kubernetes Submit Queue 63cf217b92 Merge pull request #38347 from euank/remove-extra-hn-check
Automatic merge from submit-queue (batch tested with PRs 38727, 38726, 38347, 38348)

kubelet: remove redundant hostNetwork helper

Trivial cleanup.
2016-12-13 17:31:51 -08:00
Tim St. Clair bc3ade7454
Refactor remotecommand options parsing 2016-12-13 16:09:23 -08:00
Minhan Xia 04c3757a06 apply sandbox network mode based on network plugin 2016-12-13 16:00:23 -08:00
Wojciech Tyczynski 6e336bfab6 Use Get from cache in apiserver in kubelet 2016-12-13 17:14:56 +01:00
Dan Winship c788793868 Port remaining code to pkg/util/version 2016-12-13 08:53:24 -05:00
Ivan Shvedunov b45a8f30c5 Remove DockerLegacyService comment from kubelet
The comment is obsolete as there's no more DockerLegacyService.
2016-12-13 13:46:09 +03:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Kubernetes Submit Queue 22db6c99a7 Merge pull request #38589 from runcom/fix-ImageStatus-comment
Automatic merge from submit-queue

CRI: fix ImageStatus comment

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

GRPC cannot encode `nil` (CRI-O itself panic while trying to encode `nil` for `ImageStatus`). This PR fixes `ImageStatus` comment to say that when the image does not exist the call returns a response having `Image` set to `nil` (instead of saying implementors should return `nil` directly).

/cc @mrunalp @vishh @feiskyer 

**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
```

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-12 17:30:11 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue f12eda8777 Merge pull request #38457 from resouer/fix-cgroup-cri
Automatic merge from submit-queue (batch tested with PRs 38419, 38457, 38607)

Fix pod level QoS does not works on CRI dockershim

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

We did set `CgroupParent ` in `CreateContainer`, but the `HostConfig.Resources` which `CgroupParent` belongs to is override by the following code:

```
hc.CgroupParent = lc.GetCgroupParent()

...

hc.Resources = dockercontainer.Resources{
	Memory:     rOpts.GetMemoryLimitInBytes(),
...
}
```

That's why `HostConfig.CgroupParent` is always empty and pod level QoS does not work.
2016-12-12 12:48:07 -08:00
Kubernetes Submit Queue 12147a3cd6 Merge pull request #38630 from ncdc/fix-threshold-notifier-build-tags
Automatic merge from submit-queue (batch tested with PRs 38453, 36672, 38629, 34966, 38630)

Fix threshold notifier build tags

Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:41:12 -08:00
Andy Goldstein 89ea5ac9c1 Fix threshold notifier build tags
Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:56:07 -05:00
Seth Jennings a40b15d8bd error in setNodeStatus func should not abort node status update 2016-12-12 09:29:24 -06:00
Kubernetes Submit Queue 07312ee4b5 Merge pull request #38527 from derekwaynecarr/reduce-max-wait-time
Automatic merge from submit-queue

Fail kubelet is runtime is unresponsive for 30 seconds

Fixes https://github.com/kubernetes/kubernetes/issues/30534
2016-12-11 20:29:19 -08:00
Antonio Murdaca fba6e0a625
CRI: fix ImageStatus comment
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-12-11 18:43:41 +01:00
Kubernetes Submit Queue b72c006eb3 Merge pull request #34554 from derekwaynecarr/quota-storage-class
Automatic merge from submit-queue (batch tested with PRs 37270, 38309, 37568, 34554)

Ability to quota storage by storage class

Adds the ability to quota storage by storage class.
1. `<storage-class>.storageclass.storage.k8s.io/persistentvolumeclaims` - quota the number of claims with a specific storage class
2. `<storage-class>.storageclass.storage.k8s.io/requests.storage` - quota the cumulative request for storage in a particular storage class.

For example:

```
$ cat quota.yaml
apiVersion: v1
kind: ResourceQuota
metadata:
  name: storage-quota
spec:
  hard:
    requests.storage: 100Gi
    persistentvolumeclaims: 100
    gold.storageclass.storage.k8s.io/requests.storage: 50Gi
    gold.storageclass.storage.k8s.io/persistentvolumeclaims: 5
    silver.storageclass.storage.k8s.io/requests.storage: 75Gi
    silver.storageclass.storage.k8s.io/persistentvolumeclaims: 10
    bronze.storageclass.storage.k8s.io.kubernetes.io/requests.storage: 100Gi
    bronze.storageclass.storage.k8s.io/persistentvolumeclaims: 15
$ kubectl create -f quota.yaml
$ cat pvc-bronze.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  generateName: pvc-bronze-
  annotations:
    volume.beta.kubernetes.io/storage-class: "bronze"
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 8Gi
$ kubectl create -f pvc-bronze.yaml
$ kubectl get quota storage-quota -o yaml
apiVersion: v1
kind: ResourceQuota
...
status:
  hard:
    bronze.storageclass.storage.k8s.io/persistentvolumeclaims: "15"
    bronze.storageclass.storage.k8s.io/requests.storage: 100Gi
    gold.storageclass.storage.k8s.io/persistentvolumeclaims: "5"
    gold.storageclass.storage.k8s.io/requests.storage: 50Gi
    persistentvolumeclaims: "100"
    requests.storage: 100Gi
    silver.storageclass.storage.k8s.io/persistentvolumeclaims: "10"
    silver.storageclass.storage.k8s.io/requests.storage: 75Gi
  used:
    bronze.storageclass.storage.k8s.io/persistentvolumeclaims: "1"
    bronze.storageclass.storage.k8s.io/requests.storage: 8Gi
    gold.storageclass.storage.k8s.io/persistentvolumeclaims: "0"
    gold.storageclass.storage.k8s.io/requests.storage: "0"
    persistentvolumeclaims: "1"
    requests.storage: 8Gi
    silver.storageclass.storage.k8s.io/persistentvolumeclaims: "0"
    silver.storageclass.storage.k8s.io/requests.storage: "0"
```
2016-12-09 14:11:21 -08:00
Derek Carr af6c8a2479 Reduce max container runtime wait time 2016-12-09 16:40:13 -05:00
Kubernetes Submit Queue 43233caaf0 Merge pull request #37871 from Random-Liu/use-patch-in-kubelet
Automatic merge from submit-queue (batch tested with PRs 36692, 37871)

Use PatchStatus to update node status in kubelet.

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

This PR changes kubelet to update node status with `PatchStatus`.

@caesarxuchao @ymqytw told me that there is a limitation of current `CreateTwoWayMergePatch`, it doesn't support primitive type slice which uses strategic merge.
* I checked the node status, the only primitive type slices in NodeStatus are as follows, they are not using strategic merge:
  * [`ContainerImage.Names`](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L2963)
  * [`VolumesInUse`](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/v1/types.go#L2909)
* Volume package is already [using `CreateStrategicMergePath` to generate node status update patch](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/volume/attachdetach/statusupdater/node_status_updater.go#L111), and till now everything is fine. 

@yujuhong @dchen1107 
/cc @kubernetes/sig-node
2016-12-09 11:29:11 -08:00
Derek Carr 459a7a05f1 Ability to quota storage by storage class 2016-12-09 13:26:59 -05:00
Harry Zhang 9170e94e2d Fix cgroupParent is wrongly set in dockershim 2016-12-09 09:22:05 +00:00
Wojciech Tyczynski aa7da5231f Update bazel files 2016-12-09 09:42:02 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Kubernetes Submit Queue e0c6b99e25 Merge pull request #36887 from hex108/pullImage
Automatic merge from submit-queue (batch tested with PRs 38432, 36887, 38415)

Add --image-pull-stuck-timeout option  to kubelet

In this PR, add --image-pull-stuck-time option to specify the stuck timeout for pulling image.

When docker extracts image layer, there is no progress. The progress will exceed 1m if the layer is big or system is busy. It happend in our cluster, so I add above option to specify the timeout. 

Related error log:
<pre>
[... kube_docker_client.go:29] Cancel pulling image "our_registry/demo/test" because of no progress for 1m0s, latest progress "c914ad57d670": Extracting [==================>] 513.5 MB/513.5MB"
[... docker_manager.go:2254] container start failed: ErrImagePull: net/http: request canceled
</pre>
2016-12-08 20:37:55 -08:00
Kubernetes Submit Queue 362dc81d8e Merge pull request #37713 from yujuhong/log_notready_message
Automatic merge from submit-queue (batch tested with PRs 36736, 35956, 35655, 37713, 38316)

Log the condition when node becomes not ready
2016-12-08 19:51:58 -08:00
Jun Gong 036899ec98 Add --image-pull-progress-deadline option to kubelet 2016-12-09 09:28:57 +08:00
Kubernetes Submit Queue bf1afd97fb Merge pull request #38375 from Random-Liu/add-image-cache
Automatic merge from submit-queue (batch tested with PRs 36419, 38330, 37718, 38244, 38375)

Kubelet: Add image cache.

Fixes #38373.

This should be patched into 1.5.1 to solve the customer issue.

@yujuhong 
/cc @kubernetes/sig-node
2016-12-08 17:14:00 -08:00
Random-Liu beba1ebbf8 Use PatchStatus to update node status in kubelet. 2016-12-08 17:13:59 -08:00
Random-Liu 816f867c62 Add image cache. 2016-12-08 14:04:01 -08:00
Euan Kemp bcd939cb08 kuberuntime: set privileged for sandboxes 2016-12-08 13:11:16 -08:00
Euan Kemp 62148a768b CRI: add privileged to sandbox, document better
Adding the `privileged` bool to the sandbox allows runtimes, like rkt,
to make better security choices in some cases.

This also enumerates what "privileged" actually means and how it
interacts with other options (or more accurately, does not).

The documentation closely matches docker's current behavior because, so
far, that's what privileged has meant.
2016-12-08 13:11:16 -08:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
Kubernetes Submit Queue 61242f7408 Merge pull request #35939 from xiangpengzhao/minor-cleanup
Automatic merge from submit-queue

Minor cleanup: fix typos

Fix some typos.
2016-12-08 07:41:08 -08:00
Kubernetes Submit Queue 910912ea3b Merge pull request #37364 from foxyriver/status-code
Automatic merge from submit-queue

use status code const to express http status

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

Using status code const to express http status.

**Special notes for your reviewer**:

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
```
2016-12-07 22:47:46 -08:00
Euan Kemp 15fc470343 kubelet: remove redundant hostNetwork helper
It did the same thing as the helper in kubecontainer
2016-12-07 17:24:24 -08:00
Kubernetes Submit Queue ca049360e2 Merge pull request #38258 from derekwaynecarr/kernel-memcg-flag
Automatic merge from submit-queue (batch tested with PRs 38318, 38258)

kernel memcg notification enabled via experimental flag

Kubelet integrates with kernel memcg notification API if and only if enabled via experimental flag.
2016-12-07 15:00:10 -08:00
Derek Carr 5b2d1c2c25 Enable kernel memcg notification via additional flag 2016-12-07 10:09:41 -05:00
Pengfei Ni 1140d31d9b Kubelet: only check podUID when it is actually set 2016-12-07 16:35:25 +08:00
Kubernetes Submit Queue 97ae7ccb56 Merge pull request #31647 from mikedanese/register-tainted
Automatic merge from submit-queue

add a configuration for kubelet to register as a node with taints

and deprecate --register-schedulable

ref #28687 #29178

cc @dchen1107 @davidopp @roberthbailey
2016-12-06 19:07:54 -08:00
Mike Danese e225625a80 add a configuration for kubelet to register as a node with taints
and deprecate register-schedulable
2016-12-06 10:32:54 -08:00
Bryan Boreham 0cfd09e161 Abandon setting hairpin mode if finding the peer interface fails
Instead of setting it on every bridge-connected interface which may
have unwanted effects on unrelated things installed on the machine.
2016-12-06 14:33:43 +00:00
Kubernetes Submit Queue be5d1724f5 Merge pull request #37420 from zdj6373/kubelet-log
Automatic merge from submit-queue (batch tested with PRs 37208, 37446, 37420)

Kubelet log modification

Keep in line with the other error logs in the function.
After return, the caller records the error log.Delete redundant logs
2016-12-05 04:47:44 -08:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue 5e44666fc1 Merge pull request #34945 from nebril/image-manager-tests-cleanup
Automatic merge from submit-queue

Clean up redundant tests in image_manager_test

There was a lot of overlap between parallel and serialized puller tests,
extracted most of these tests internals to separate functions.
2016-12-02 11:40:59 -08:00
Kubernetes Submit Queue 5960761b9b Merge pull request #36615 from timstclair/cri-attach-tty
Automatic merge from submit-queue

[CRI] Add TTY flag to AttachRequest

Follow up from https://github.com/kubernetes/kubernetes/pull/35661
For https://github.com/kubernetes/kubernetes/issues/29579

- Add TTY to the CRI AttachRequest
- Moves responsibility from the runtime shim to the Kubelet for populating the TTY bool in the request based on the container spec

/cc @euank @feiskyer @kubernetes/sig-node
2016-12-02 07:28:59 -08:00