Commit Graph

13741 Commits (12d923ed1583ac5cbec8d98003c7e08de5d1e9fd)

Author SHA1 Message Date
k8s-merge-robot 8677b0c545 Merge pull request #28743 from Clarifai/gpu-impl
Automatic merge from submit-queue

Fix GPU resource validation

This fixes scheduling of pods with GPU resources. The change was never upstreamed during the 1.3 beta period, as it got lost in the noise of other changes in our fork. Ooops. I'll submit a cherry-pick request for 1.3.1 as soon as this lands in master.

Because of defaulting, requests are always set if limits are. Thus, the check can never succeed. Instead, make sure that the two values are equal.

Also, remove a few other error messages and remove unnecessary Sprintf calls.
2016-07-16 11:48:42 -07:00
Davanum Srinivas 2b0ed014b7 Use Go canonical import paths
Add canonical imports only in existing doc.go files.
https://golang.org/doc/go1.4#canonicalimports

Fixes #29014
2016-07-16 13:48:21 -04:00
lixiaobing10051267 97219275b1 Apiserver ServeHTTP() modify 2016-07-16 12:29:11 +08:00
lixiaobing10051267 7ecae85493 Type define note "errNotAcceptable indicates Content-Type is not recognized" wrong 2016-07-16 11:31:52 +08:00
k8s-merge-robot 5e1b75d164 Merge pull request #28990 from xiangpengzhao/fix_duplicated_code
Automatic merge from submit-queue

Delete duplicated code

The code block below is called twice sequentially in func `doTestPlugin`.
.
```go
 	if _, err := os.Stat(path); err != nil {
 		if os.IsNotExist(err) {
 			t.Errorf("SetUp() failed, volume path not created: %s", path)
 		} else {
 			t.Errorf("SetUp() failed: %v", err)
 		}
 	}
```
2016-07-15 19:30:34 -07:00
k8s-merge-robot d6336c4f4b Merge pull request #29024 from yifan-gu/copy_etc_hosts_resolv
Automatic merge from submit-queue

rkt: Copy the /etc/hosts /etc/resolv.conf into pod dir before mounting.

rkt: Copy the /etc/hosts /etc/resolv.conf into pod dir before mounting.
    
This enables the container to modify the /etc/hosts/ /etc/resolv.conf without changing the host's ones.
With this PR, we now match the docker's behavior.

Fix https://github.com/kubernetes/kubernetes/issues/29022

cc @kubernetes/sig-rktnetes @quentin-m
2016-07-15 18:56:48 -07:00
Yifan Gu 56698a6c3e rkt: Copy the /etc/hosts /etc/resolv.conf into pod dir before mounting.
This enables the container to modify the /etc/hosts/ /etc/resolv.conf
without changing the host's ones.

With this PR, we now match the docker's behavior.
2016-07-15 17:40:29 -07:00
Tim Hockin 1f37281dae Scale kube-proxy conntrack limits by cores
For large machines we want more conntrack entries than smaller machines.
2016-07-15 16:36:40 -07:00
k8s-merge-robot e576a2f760 Merge pull request #29017 from thockin/undelete-generated-files
Automatic merge from submit-queue

Undelete generated files

There's been enough people broken by not committing generated code, that we
should undo that until we have a proper client that is `go get` compatible.

This is temporary.

Fixes #28920
2016-07-15 16:27:14 -07:00
k8s-merge-robot d3dbe9c716 Merge pull request #28202 from hongchaodeng/cpa
Automatic merge from submit-queue

Better handle etcd compaction in multi-apiserver

What:
- Change etcd compaction routine to better handle multi-apiserver (HA) scenarios. See the docs in code.
2016-07-15 13:33:58 -07:00
Antonio Murdaca 5faa9b1283
CRI: add LinuxUser to LinuxContainerConfig
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
2016-07-15 22:17:41 +02:00
k8s-merge-robot b6c87904f6 Merge pull request #27853 from dubstack/dubstack-inject-qos-creation2
Automatic merge from submit-queue

[Kubelet] Improving QOS in kubelet by introducing QoS level Cgroups - `--cgroups-per-qos`

This PR is tied to this upstream issue #27204 
Please note that only the last commit is unique to this PR. The first two commits are from previous PR's.

It introduces a new flag in the Kubelet which can be used to specify if the user wants to use the QoS cgroup hierarchy. 

cc @kubernetes/sig-node
2016-07-15 11:54:25 -07:00
Vishnu kannan ea1a459a80 Check if service accounts exist in gcr credential provider
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-15 11:41:02 -07:00
Vishnu kannan ee9cded79a do not query the metadata server to find out if running on GCE. Retry docker registry fetches on GCP
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2016-07-15 11:41:02 -07:00
k8s-merge-robot 6193335bd9 Merge pull request #28985 from caesarxuchao/v1ojbref
Automatic merge from submit-queue

move api.ObjectReference.ObjectKind to pkg/api/ref.go

This is needed to convert k8s components to use versioned clientset.

To let components use versioned client, we need to convert `pkg/client/record` to v1, which depends on `pkg/api/ref.go`, so we need to make a `pkg/api/v1/ref.go`. And this [line](https://github.com/kubernetes/kubernetes/blob/master/pkg/api/ref.go#L44) requires v1.ObjectReference to be a runtime.Object. Moving `api.ObjectReference.ObjectKind` to `pkg/api/ref.go` will make the writing a conversion script easier because all the necessary changes will be restricted in `ref.go`.
2016-07-15 11:14:07 -07:00
Tim Hockin 3384e03920 Commit generated files
There's been enough people broken by not committing generated code, that we
should undo that until we have a proper client that is `go get` compatible.

This is temporary.
2016-07-15 10:27:51 -07:00
Hongchao Deng 54025ce8b3 etcd3/store: Add test for compact conflict 2016-07-15 10:24:50 -07:00
Hongchao Deng 186b4858b4 better handle etcd compaction in multi-apiserver 2016-07-15 10:24:49 -07:00
k8s-merge-robot 529df988e8 Merge pull request #28964 from ncdc/export-isterminal
Automatic merge from submit-queue

Reexport term.IsTerminal

Reexport term.IsTerminal so downstream consumers (e.g. OpenShift) can use it.

@smarterclayton @sttts
2016-07-15 10:06:20 -07:00
Buddha Prakash 5000e74664 Inject top level QoS cgroup creation in the Kubelet 2016-07-15 10:02:22 -07:00
Mike Dame cfbf7da75b Make sure --record=false is acknowledged when passed to commands 2016-07-15 11:24:05 -04:00
k8s-merge-robot 0af6d321e8 Merge pull request #28935 from smarterclayton/avoid_double_encode
Automatic merge from submit-queue

Don't double encode protobuf runtime.Unknown

When using runtime.Object and runtime.RawExtension, passing
runtime.Unknown to protobuf serializer should result in the raw message
being serialized (since all normal protobuf objects are
runtime.Unknown).

Also, avoid setting a content-type when decoding a protobuf object
except when the content appears to be proto.

@wojtek-t
2016-07-15 07:43:09 -07:00
k8s-merge-robot aa16140298 Merge pull request #28926 from ronnielai/pleg
Automatic merge from submit-queue

Including ContainerRemoved in PLEG event reporting
2016-07-15 07:03:19 -07:00
k8s-merge-robot 15b1fe33ee Merge pull request #28915 from ronnielai/gc-threshold
Automatic merge from submit-queue

Support deleting all unused images

#25239
2016-07-15 06:22:56 -07:00
Michail Kargakis f85067b27d api: custom conversions for rc/rs 2016-07-15 14:52:27 +02:00
Michail Kargakis d7038f50b6 unversioned: conversion from new to original label selector 2016-07-15 14:52:27 +02:00
k8s-merge-robot 5844145795 Merge pull request #28815 from smarterclayton/fix_stringer
Automatic merge from submit-queue

Generate a better Stringer method for proto types

This replaces the bad string output generated by golang/proto with gogo/protobuf stringer generation. Makes the output similar to %#v and more debuggable. We have to have a String() method to implement proto.Message, so this is strictly better.

@wojtek-t, @thockin for after your PR merges

Fixes #28756
2016-07-15 05:49:40 -07:00
k8s-merge-robot 423106ccee Merge pull request #28512 from smarterclayton/multirestmapper
Automatic merge from submit-queue

Implement a RESTMappings method

With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.

@deads2k
2016-07-15 05:13:55 -07:00
k8s-merge-robot e7e434b10d Merge pull request #27600 from caesarxuchao/rc-gc
Automatic merge from submit-queue

[GarbageCollector] Let the RC manager set/remove ControllerRef

What's done:
* RC manager sets Controller Ref when creating new pods
* RC manager sets Controller Ref when adopting pods with matching labels but having no controller
* RC manager clears Controller Ref when pod labels change
* RC manager clears pods' Controller Ref when rc's selector changes
* RC manager stops adoption/creating/deleting pods when rc's DeletionTimestamp is set
* RC manager bumps up ObservedGeneration: The [original code](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller_utils.go#L36) will do this.
* Integration tests:
  * verifies that changing RC's selector or Pod's Labels triggers adoption/abandoning
* e2e tests (separated to #27151):
  * verifies GC deletes the pods created by RC if DeleteOptions.OrphanDependents=false, and orphans the pods if DeleteOptions.OrphanDependents=true.

TODO:

- [x] we need to be able to select Pods that have a specific ControllerRef. Then each time we sync the RC, we will iterate through all the Pods that has a controllerRef pointing the RC, event if the labels of the Pod doesn't match the selector of RC anymore. This will prevent a Pod from stuck with a stale controllerRef, which could be caused by the race between abandoner (the goroutine that removes controllerRef) and worker the goroutine that add controllerRef to pods).
- [ ] use controllerRef instead of calling `getPodController`. This might be carried out by the control-plane team.
- [ ] according to the controllerRef proposal (#25256): "For debugging purposes we want to add an adoptionTime annotation prefixed with kubernetes.io/ which will keep the time of last controller ownership transfer." This might be carried out by the control-plane team.

cc @lavalamp @gmarek
2016-07-15 04:40:40 -07:00
Szymon Pyżalski b87ee3dff7 Validation logic applied to edited file
The file that is submitted via edit is now subject to validation
logic as any other file. The validation flags were added to the edit
command.

Fixes: #17542
2016-07-15 13:02:19 +02:00
k8s-merge-robot d347435708 Merge pull request #19837 from mikedanese/kubelet-external
Automatic merge from submit-queue

kubelet external componentconfig
2016-07-15 03:59:50 -07:00
Wojciech Tyczynski f71244975d Revert "[garbage collector] add e2e test" 2016-07-15 10:10:02 +02:00
xiangpengzhao b2ab356ca5 Delete duplicated code. 2016-07-15 03:04:24 -04:00
Chao Xu 3fb678aca3 move api.OjbectReference.ObjectKind() to ref.go 2016-07-14 23:02:05 -07:00
k8s-merge-robot 7be82496eb Merge pull request #28428 from justinsb/aws_region_ap_south
Automatic merge from submit-queue

AWS: Add ap-south-1 to list of known AWS regions

Adding the new ap-south-1 region (Mumbai)
2016-07-14 20:28:53 -07:00
Chao Xu 11a341de67 let RC manager utilize the GC 2016-07-14 19:59:31 -07:00
k8s-merge-robot bea5232790 Merge pull request #28946 from ping035627/ping035627-patch-0714-2
Automatic merge from submit-queue

Modify wrong description about "InsecurePort" in genericapiserver.go

Modify wrong description about "InsecurePort" in genericapiserver.go, avoid misleading.
2016-07-14 19:56:09 -07:00
k8s-merge-robot e182520db6 Merge pull request #28944 from ping035627/ping035627-patch-0715
Automatic merge from submit-queue

Improve fatal error description for init in genericapiserver.go

When api.NewRequestContextFilter return error in the "init" function of genericapiserver.go, there are no handler info, add more information to indicate s.Handler or s.InsecureHandler, I suggest.
2016-07-14 19:56:04 -07:00
k8s-merge-robot c481291320 Merge pull request #28937 from ping035627/ping035627-patch-0714
Automatic merge from submit-queue

Optimise the New function in genericapiserver.go

It needn't the handlerContainer variable in the "New" function when deal s.HandlerContainer, I think, and it seems the codes more concise.
2016-07-14 19:56:00 -07:00
k8s-merge-robot 01e34b72c1 Merge pull request #27151 from caesarxuchao/gc-e2e
Automatic merge from submit-queue

[garbage collector] add e2e test

This PR also includes some changes to plumb controller-manager's `--enable_garbage_collector` from the environment variable.

The e2e test will not be run by the core suite because it's marked `[Feature:GarbageCollector]`.

The corresponding jenkins job configuration PR is https://github.com/kubernetes/test-infra/pull/132.
2016-07-14 19:55:52 -07:00
Michael Taufen e52718bbc6 Clean up API
Move SystemReserved and KubeReserved into KubeletConfiguration struct
Convert int64 to int32 for some external type fields so they match internal ones
tLS* to tls* for JSON field names
Fix dependency on removed options.AutoDetectCloudProvider
Change floats in KubeletConfiguration API to ints
2016-07-14 18:40:11 -07:00
Michael Taufen 9393bd0fa6 Fix unit test build errors
These tests can just use the empty string for the PodInfraContainerImage.
2016-07-14 18:40:11 -07:00
Michael Taufen 2e49f6b64a Make it build!
Update external KubeletConfiguration type
Add defaults for new KubeletConfiguration fields
Modify some defaults to match upstream settings
Add/rename some conversion functions
Updated codegen
Fixed typos
Mike Danese caught that s.NodeLabels wasn't allocated, fix on line 118
of cmd/kubelet/app/options/options.go.
Provide list of valid sources in comment for HostNetworkSources field
2016-07-14 18:38:58 -07:00
Mike Danese e235073c26 f 2016-07-14 18:38:58 -07:00
Mike Danese e070cb617a componentconfig: add external kubelet configuration type 2016-07-14 18:38:58 -07:00
Yu-Ju Hong 007257a5ad kubelet: remove outdated TODOs 2016-07-14 18:28:25 -07:00
Daniel Smith 360f2eb927 Revert "Remove pod mutation for PVs with supplemental GIDs" 2016-07-14 17:47:46 -07:00
PingWang a7cea72e66 modify two wrong description about InsecurePort
Signed-off-by: PingWang <wang.ping5@zte.com.cn>

Update genericapiserver.go

Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-15 08:29:18 +08:00
Ron Lai a58c774c08 Including ContainerRemoved in PLEG event reporting 2016-07-14 16:39:03 -07:00
Anirudh 467333cc40 Create event only if creation of PVC failed. 2016-07-14 11:53:42 -07:00
k8s-merge-robot 4c58621413 Merge pull request #28966 from liggitt/cache-filter
Automatic merge from submit-queue

Fix watch cache filtering

When serving watch events for a particular namespace, the watch cache filters out events from other namespaces by checking the etcd key of the event's object, and making sure it is prefixed with the root key for the namespace being watched.

The prefix check does not ensure the match occurs on a path segment boundary, so a watch on  namespace `test` is delivered watch events for namespace `test1`.

This tightens the check to ensure the prefix match occurs on a path segment boundary.
2016-07-14 11:22:10 -07:00
k8s-merge-robot be3175611c Merge pull request #28691 from wongma7/pv-gid-squash2
Automatic merge from submit-queue

Remove pod mutation for PVs with supplemental GIDs

Continuation of https://github.com/kubernetes/kubernetes/pull/27571 to bring the feature back without pod mutation
2016-07-14 11:22:04 -07:00
Jordan Liggitt 4fcd999c25
Fix watch cache filtering 2016-07-14 13:13:17 -04:00
Clayton Coleman b9845e7cb5
Don't double encode protobuf runtime.Unknown
When using runtime.Object and runtime.RawExtension, passing
runtime.Unknown to protobuf serializer should result in the raw message
being serialized (since all normal protobuf objects are
runtime.Unknown).

Also, avoid setting a content-type when decoding a protobuf object
except when the content appears to be proto.
2016-07-14 13:09:16 -04:00
Clayton Coleman 866e788aba
generate: New Stringers 2016-07-14 12:43:36 -04:00
Clayton Coleman 8c17b48824
Generate gogo stringer instead of proto stringer
Similar to %#v.
2016-07-14 12:43:33 -04:00
Andy Goldstein 792ec603c0 Reexport term.IsTerminal
Reexport term.IsTerminal so downstream consumers (e.g. OpenShift) can use it.
2016-07-14 12:29:38 -04:00
Charlie Drage 13cecd6e4a Warn when missing cloud-provider on kube controller
This commit warns the user / gives better information that when using
--cloud-provider="" on kube-controller, that services such as
LoadBalancer will not work.

However, despite the error, kube-controller will still run as normal.

Fixes https://github.com/kubernetes/kubernetes/issues/12716
Fixes https://github.com/kubernetes/kubernetes/issues/11172
Fixes https://github.com/kubernetes/kubernetes/issues/27085
2016-07-14 11:54:35 -04:00
k8s-merge-robot 03be7117a4 Merge pull request #28882 from gmarek/ratelimiter
Automatic merge from submit-queue

Allow switching rate limiter inside RateLimitedQueue

Ref. #28832
cc @davidopp  

```release-note
Deprecate deleting-pods-burst ControllerManager flag
```
2016-07-14 08:44:35 -07:00
k8s-merge-robot 98d769cf3d Merge pull request #27943 from ivan4th/refactor-printer-arguments
Automatic merge from submit-queue

Refactor Printer arguments

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
Fixes #21260
2016-07-14 08:03:40 -07:00
k8s-merge-robot 50172148e4 Merge pull request #25273 from ncdc/exec-sigwinch
Automatic merge from submit-queue

Support terminal resizing for exec/attach/run

```release-note
Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions
inherit the environment from the primary process, so if the container was created with tty=false,
that means the exec session's TERM variable will default to "dumb". Users can override this by
setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior.
```

Fixes #13585
2016-07-14 07:26:49 -07:00
gmarek f6b1c316e9 Allow switching rate limiter inside RateLimitedQueue 2016-07-14 15:38:14 +02:00
Ivan Shvedunov 5ed881c6c4 Refactor Printer arguments
Fixes #21260
2016-07-14 16:23:02 +03:00
deads2k f6f1ab34aa authorize based on user.Info 2016-07-14 07:48:42 -04:00
k8s-merge-robot ae990defcf Merge pull request #26956 from joe2far/fix-typos
Automatic merge from submit-queue

Fixed several typos
2016-07-14 04:13:15 -07:00
Wojciech Tyczynski 31d09f5290 Merge pull request #28948 from soltysh/issue28941
Fix issue with closing channels in job controller tests
2016-07-14 13:01:50 +02:00
k8s-merge-robot 06939c57aa Merge pull request #20699 from jiangyaoguo/add-AvoidPreviousNode
Automatic merge from submit-queue

Implement alpha version of PreferAvoidPods

This is part of #18853

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/20699)
<!-- Reviewable:end -->
2016-07-14 03:30:25 -07:00
Maciej Szulik fd76f71fd5 Fix issue with closing channels in job controller tests 2016-07-14 12:09:12 +02:00
PingWang 4e9b8b15c5 Improve fatal error description
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-14 15:03:31 +08:00
Wojciech Tyczynski 4b9b1afe76 Revert "Add a customized ssh dialer that will timeout" 2016-07-14 08:48:24 +02:00
PingWang 97b4a6fa42 optimise the New function
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
2016-07-14 11:43:53 +08:00
k8s-merge-robot 8f08cb3391 Merge pull request #28910 from rmmh/body-log
Automatic merge from submit-queue

Log restclient request/response bodies using %#v.

These are now protobufs, so outputting them with %s dumps a large
amount of binary garbage into the log. %#v properly escapes exotic
characters.
2016-07-13 19:24:13 -07:00
k8s-merge-robot 224b039307 Merge pull request #28797 from aaronlevy/insecure-retry
Automatic merge from submit-queue

Retry when apiserver fails to listen on insecure port

The apiserver will already continually retry when it fails to bind to the secure port. However, with the insecure port it does not retry, and any failures cause the apiserver to exit.

This change makes it so the api-server will retry on both insecure/secure ports.

A use-case for this change is for self-hosting the api-server, particularly when you are only running a single copy in your cluster. In some bootstrap and upgrade scenarios - it's necessary to replace/pivot from an existing api-server on the same host -- where you need a new copy running before tearing down the old (which is problematic when the api-server will try to bind to an in-use port and exit).
2016-07-13 18:51:29 -07:00
Ron Lai 4d5b6c5a9e Support deleting all unused images 2016-07-13 18:20:16 -07:00
Clayton Coleman c077bac341
Implement a RESTMappings method
With the introduction of batch/v1 and batch/v2alpha1, any
MultiRESTMapper that has per groupversion mappers (as a naive discovery
client would create) would end up being unable to call RESTMapping() on
batch.Jobs. As we finish up discovery we will need to be able to choose
prioritized RESTMappings based on the service discovery doc.

This change implements RESTMappings(groupversion) which returns all
possible RESTMappings for that kind.  That allows a higher level call to
prioritize the returned mappings by server or client preferred version.
2016-07-13 21:18:53 -04:00
k8s-merge-robot 54c8c82045 Merge pull request #28805 from caesarxuchao/ssh-dial-timeout
Automatic merge from submit-queue

Add a customized ssh dialer that will timeout

Fix https://github.com/kubernetes/kubernetes/issues/23835.

@a-robinson @cjcullen @lavalamp
2016-07-13 17:27:16 -07:00
k8s-merge-robot 6b6141f812 Merge pull request #28820 from caesarxuchao/patch-subresource
Automatic merge from submit-queue

[client-gen] Allow passing subresources in Patch method

Expand the Patch() method from:
```
Patch(name string, pt api.PatchType, data []byte)
```
to
```
Patch(name string, pt api.PatchType, data []byte, subresources ...string)
```

Continue on #27293. Fixes #26580.

cc @Random-Liu @lavalamp
2016-07-13 16:09:01 -07:00
k8s-merge-robot 721eabf492 Merge pull request #28626 from juanvallejo/update-resource-builder-format-error
Automatic merge from submit-queue

update resource builder error message to be more clear

release-note-none

The error message given by command line `kubectl get` is sometimes of no help / not clear on what must be corrected, e.g.:
`kubectl get pod pod/database-1-i10b9`
error: when passing arguments in resource/name form, all arguments must include the resource 

##### Steps to Reproduce:
1. Run command "$ kubectl get pod pod/database-1-i10b9"  

##### Actual Result:
Get unfriendly error message which is of no help:
"error: when passing arguments in resource/name form, all arguments must include the resource"

##### Expected Result:
Error message should recommend end user to run this cli in good grammar: "$ kubectl get pod database-1-i10b9" or "$ kubectl get pod/database-1-i10b9"

##### Before
"error: when passing arguments in resource/name form, all arguments must include the resource"

##### After
"error: there is no need to specify a resource type as a separate argument when passing arguments in resource/name form (e.g. `kubectl get resource/<resource_name>` instead of `kubectl get resource resource/<resource_name>`"

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-13 14:42:02 -07:00
Andy Goldstein 3b21a9901b Support terminal resizing for exec/attach/run
Add support for terminal resizing for exec, attach, and run. Note that for Docker, exec sessions
inherit the environment from the primary process, so if the container was created with tty=false,
that means the exec session's TERM variable will default to "dumb". Users can override this by
setting TERM=xterm (or whatever is appropriate) to get the correct "smart" terminal behavior.
2016-07-13 17:06:16 -04:00
k8s-merge-robot aebc35a9e8 Merge pull request #28800 from lavalamp/reallypanic
Automatic merge from submit-queue

Stop eating panics

Fixes #28365
2016-07-13 14:05:41 -07:00
k8s-merge-robot b50e66c66e Merge pull request #28340 from ZTE-PaaS/zhangke-patch-007
Automatic merge from submit-queue

controller-manager support number of garbage collector workers to be configurable

The number of garbage collector workers of controller-manager is a fixed value 5 now, make it configurable should more properly
2016-07-13 12:54:15 -07:00
Rudi Chiarito b86dfcf60a Fix GPU resource validation
Because of defaulting, requests are always set if limits are. Thus, the check can never succeed. Instead, make sure that the two values are equal.

Also, remove a few other error messages and remove unnecessary Sprintf calls.
2016-07-13 15:05:59 -04:00
Ryan Hitchman f1cd578363 Log restclient request/response bodies using %#v.
These are now protobufs, so outputting them with %s dumps a large
amount of binary garbage into the log. %#v properly escapes exotic
characters.
2016-07-13 11:37:16 -07:00
Daniel Smith 78c02cd052 Stop eating panics 2016-07-13 11:12:59 -07:00
Matthew Wong 58f973d8e7 Remove pod mutation for PVs with supplemental GIDs 2016-07-13 13:51:17 -04:00
Chao Xu d29b880efe add a customized ssh dialer that will timeout 2016-07-13 10:46:57 -07:00
Michael Taufen d3f3bedbb7 Fix typo in pkg/runtime/serializer/codec_factory.go 2016-07-13 10:41:02 -07:00
joe2far 5ead89b5bb Fixed several typos 2016-07-13 15:06:24 +01:00
k8s-merge-robot 7e6a856078 Merge pull request #28843 from gmarek/limiterPerZone
Automatic merge from submit-queue

Separate rate limiters for Pod evictions for different zones in NodeController

Ref. #28832

NodeController needs to be able to separately adjust rate-limits for eviction for different zones. This PR splits rate limiters.

cc @davidopp
2016-07-13 06:42:11 -07:00
k8s-merge-robot af1891ca03 Merge pull request #28531 from dims/fix-issues-28314
Automatic merge from submit-queue

Add custom-columns and custom-template-file to --help text
2016-07-13 06:09:25 -07:00
Łukasz Oleś 528bf7af3a Make Daemonset use GeneralPredicates
fixes #21454, fixes #22205
2016-07-13 14:50:29 +02:00
gmarek 5677a9845e Split NodeController rate limiters between zones 2016-07-13 14:09:19 +02:00
k8s-merge-robot 6035d88881 Merge pull request #27277 from wojtek-t/cacher_index
Automatic merge from submit-queue

Implement first version of indexing in cacher

This PR adds a first version of indexing in cacher.

It has a really significant impact on performance - __in empty 2000-node cluster, apiserver cpu usage drops by ~75%.__

Not for 1.3, but we need this soon after 1.3 is done.

@lavalamp @mqliang @davidopp @gmarek @kubernetes/sig-scalability
2016-07-13 02:45:23 -07:00
jiangyaoguo 4e91166bc6 Use PreferAvoidPods annotation to avoid pods being scheduled to specific node.
1. define PreferAvoidPods annotation
2. add PreferAvoidPodsPriority
3. validate AvoidPods in node annotations
2016-07-13 17:07:46 +08:00
Wojciech Tyczynski 1d9bc58328 Extend Filter interface with Trigger() and use it for pods and nodes 2016-07-13 08:45:18 +02:00
Wojciech Tyczynski 7f7ef0879f Change filter to interface in storage.Interface 2016-07-13 08:44:22 +02:00
Ke Zhang d74010211a controller-manager support number of garbage collector workers to be configurable 2016-07-13 13:13:20 +08:00
Tim Hockin 9eb42ff108 Don't check in generated conversion code
Conversion is now generated by Makefile, on demand, rather than all at once.
Manually verified no net change in generated code.
2016-07-12 21:52:54 -07:00
Tim Hockin 58441e8775 Don't check in generated deep-copy code
This mostly takes the previously checked in files and removes them, and moves
the generation to be on-demand instead of manual.  Manually verified no change
in generated output.
2016-07-12 21:52:54 -07:00
Tim Hockin faeef5c4ae Use make as the main build tool
This allows us to start building real dependencies into Makefile.

Leave old hack/* scripts in place but advise to use 'make'.  There are a few
rules that call things like 'go run' or 'build/*' that I left as-is for now.
2016-07-12 21:52:00 -07:00
k8s-merge-robot 708e753c72 Merge pull request #28679 from sttts/sttts-deepcopy-pointer-in
Automatic merge from submit-queue

Deepcopy: avoid struct copies and reflection Call

- make signature of generated deepcopy methods symmetric with `in *type, out *type`, avoiding copies of big structs on the stack
- switch to `in interface{}, out interface{}` which allows us to call them with without `reflect.Call`

The first change reduces runtime of BenchmarkPodCopy-4 from `> 3500ns` to around `2300ns`.

The second change reduces runtime to around `1900ns`.
2016-07-12 21:45:43 -07:00
k8s-merge-robot 47d06dd9c2 Merge pull request #28606 from dims/fix-issues-19636
Automatic merge from submit-queue

Fix kubectl run to print object on dry run

Originally Authored By tnachen in PR:
https://github.com/kubernetes/kubernetes/pull/25842

Fixes #19636
2016-07-12 21:05:58 -07:00
k8s-merge-robot 23f0edb8b0 Merge pull request #27713 from kargakis/wait-for-synced-rs-in-recreate
Automatic merge from submit-queue

controller: wait for synced old replica sets on Recreate

Partially fixes https://github.com/kubernetes/kubernetes/issues/27362

Any other work on it should be handled in the replica set level (and/or kubelet if it's required)

@kubernetes/deployment PTAL
2016-07-12 20:30:12 -07:00
Ron Lai e6b745122d Moving event.go from kubelet/container to kubelet/events 2016-07-12 17:42:29 -07:00
k8s-merge-robot 0efd03810c Merge pull request #28801 from janetkuo/kubectl-run-silent
Automatic merge from submit-queue

Add --quiet to hide the 'waiting for pods to be running' message in kubectl run

Ref #28695  

@kubernetes/kubectl 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-12 16:37:22 -07:00
Buddha Prakash 238f833f65 Do not skip check for cgroup creation in the systemd mount 2016-07-12 16:03:41 -07:00
k8s-merge-robot f2303edc36 Merge pull request #28751 from Random-Liu/use-patch-to-set-node-condition
Automatic merge from submit-queue

Change route controller to use patch to set node condition.

Change the route controller to use `PatchStatus` function in `NodeExpansion` to update node condition.
@caesarxuchao 

/cc @wojtek-t 


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-12 16:03:35 -07:00
k8s-merge-robot 5590553811 Merge pull request #28304 from ericchiang/fix-rbac-non-resource-url-rule-evaluation
Automatic merge from submit-queue

rbac authorizer: cleanups to rule evaluation for non-resource URLs

An few oversights in the RBAC authorizer. Fixes #28291 and permits non-resource URLs to use stars in the path. E.g. ("/apis/*").

cc @liggitt @kubernetes/sig-auth
2016-07-12 15:30:50 -07:00
k8s-merge-robot c9e9f4d934 Merge pull request #28726 from madhusudancs/known-versions-1-4
Automatic merge from submit-queue

Add known versions to release 1.4 clientset.

These imports install the API groups and register them with the API machinery. The release_1_4 clientset cannot be used without these imports. 

Follow up for PR #26588

@kubernetes/sig-api-machinery


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-12 14:17:46 -07:00
k8s-merge-robot b543e61215 Merge pull request #26554 from kargakis/fix-expose-container-port
Automatic merge from submit-queue

kubectl: make --container-port actually work for expose

Even if it was recently deprecated, it should work as expected.

@kubernetes/kubectl
2016-07-12 13:12:53 -07:00
k8s-merge-robot d90cc907c4 Merge pull request #27438 from gmarek/controllerDeletion
Automatic merge from submit-queue

Controllers doesn't take any actions when being deleted.

I started doing it for other controllers but it's not always clear to me how it should work. I'll be adding other ones as separate commits to this PR.

cc @caesarxuchao @lavalamp
2016-07-12 12:37:09 -07:00
Janet Kuo 268b93ea75 Add --quiet to hide the 'waiting for pods to be running' message in kubectl run 2016-07-12 11:56:58 -07:00
Dr. Stefan Schimanski 629b25daf9 Run hack/update-all.sh 2016-07-12 20:36:48 +02:00
Dr. Stefan Schimanski d46cbfd3e0 Turn pkg/api/pod_example.json into go struct to avoid noise in pprof 2016-07-12 20:36:48 +02:00
Chao Xu c2fb39102b generated changes 2016-07-12 11:09:28 -07:00
Chao Xu dc2e12d2f8 manual changes to patch subresource 2016-07-12 11:09:27 -07:00
Madhusudan.C.S eedc9d13d2 Add known versions to release 1.4 clientset. 2016-07-12 10:44:24 -07:00
Random-Liu 59ea5c088b Change route controller to use patch to set node condition. 2016-07-12 10:30:33 -07:00
Eric Chiang addc4b166c rbac authorizer: support non-resource urls with stars ("/apis/*") 2016-07-12 10:01:53 -07:00
Eric Chiang 411922f66c rbac authorizer: include verb in non-resource url requests 2016-07-12 10:01:53 -07:00
Dr. Stefan Schimanski 61cde63622 Switch to typeless generated deepcopy functions for less reflection 2016-07-12 18:05:43 +02:00
Dr. Stefan Schimanski 6049623a13 Turn first deepcopy parameter into a pointer 2016-07-12 18:05:43 +02:00
k8s-merge-robot 4018101a43 Merge pull request #24087 from Frostman/kubectl-abbr-dpl
Automatic merge from submit-queue

Add "deploy" abbrev for deployments to kubectl

Most of the objects have the abbreviation (short form) in kubectl, for ex. rc == replicationcontroller. It'll be useful to have an abbrev for "deployments" as well and I'm proposing to use "dpl" for it.

P.S. It's my very first commit to k8s. I've signed CLA already. I've decided to create this pull request while waiting on more info in #24083.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24087)
<!-- Reviewable:end -->
2016-07-12 08:43:59 -07:00
k8s-merge-robot 5894dc4615 Merge pull request #28829 from gmarek/hooks
Automatic merge from submit-queue

Add hooks for cluster health detection

Separate a function that decides if zone is healthy. First real commit for preventing massive pod eviction.
Ref. #28832

cc @davidopp
2016-07-12 08:12:04 -07:00
Sergey Lukjanov 3c0f0474d3 Add "deploy" abbrev for deployments to kubectl 2016-07-12 16:52:17 +03:00
k8s-merge-robot 98030ded05 Merge pull request #28781 from wojtek-t/optimize_priorities_2
Automatic merge from submit-queue

Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance



Currently copies that are made while copying/creating api.NodeList are significant part of scheduler profile, and a bunch of them are made in places, that are not-parallelizable.
Ref #28590
2016-07-12 06:18:15 -07:00
gmarek fd600ab65c Add hooks for cluster health detection 2016-07-12 15:10:58 +02:00
k8s-merge-robot ea70eca37b Merge pull request #28770 from gmarek/coupling
Automatic merge from submit-queue

Reduce tightness of coupling in NodeController

Depends on #28604
2016-07-12 05:42:59 -07:00
k8s-merge-robot 6a4de0927c Merge pull request #28524 from hongchaodeng/listopt
Automatic merge from submit-queue

ListOptions: add test for ResourceVersion > 0 in List

ref: #28472 

Done:
- Add a test for ResourceVersion > 0 in registry (cache) store List()
- Fix the docs.
2016-07-12 03:41:39 -07:00
k8s-merge-robot baa956b686 Merge pull request #27267 from kargakis/refactor-rollout-history
Automatic merge from submit-queue

kubectl: refactor rollout history to be more configurable

ChangeCauseAnnotation is hardcoded in PrintRolloutHistory and it needs
to be overriden since other resources that may need to be added in
`kubectl rollout history` may not use it. Instead of adding one more
method in the factory, refactor the existing HistoryViewer interface
to accomodate the change.

@kubernetes/kubectl
2016-07-12 03:00:20 -07:00
k8s-merge-robot 2125c0eb62 Merge pull request #28811 from xiang90/pv
Automatic merge from submit-queue

controller/volume: simplify sync logic in syncUnboundClaim

Remove all unnecessary branching logic. No actual logic changes. Code is more readable now.
2016-07-12 02:28:05 -07:00
gmarek 7524da877e Reduce tightness of coupling in NodeController 2016-07-12 11:00:41 +02:00
k8s-merge-robot ed1361f684 Merge pull request #28604 from gmarek/refactoring
Automatic merge from submit-queue

Move CIDR allocation logic away from nodecontroller.go

cc @fgrzadkowski @wojtek-t @mqliang
2016-07-12 01:52:48 -07:00
Michail Kargakis ad33c5c087 kubectl: refactor rollout history to be more configurable
ChangeCauseAnnotation is hardcoded in PrintRolloutHistory and it needs
to be overriden since other resources that may need to be added in
`kubectl rollout history` may not use it. Instead of adding one more
method in the factory, refactor the existing HistoryViewer interface
to accomodate the change.
2016-07-12 10:36:14 +02:00
k8s-merge-robot 72f6493376 Merge pull request #27349 from resouer/delete
Automatic merge from submit-queue

Generates DELETE pod update operations

fixes #27105

Generates DELETE pod update operations  to make the code and log more intuitive.

1. main refactoring is in `kubelet/config`
2. kubelet will log if it received DELETE, just like other OPs

cc @Random-Liu :)
2016-07-12 01:04:35 -07:00
gmarek 95de5a38ea JobController doesn't take any actions when being deleted. 2016-07-12 09:43:08 +02:00
gmarek 7815a3e7bc DeploymentController doesn't take any actions when being deleted 2016-07-12 09:43:08 +02:00
gmarek d8958257c4 DaemonController doesn't take any actions when being deleted. 2016-07-12 09:43:08 +02:00
gmarek 7f5f9d3a6f Move CIDR allocation logic away from nodecontroller.go 2016-07-12 09:40:43 +02:00
k8s-merge-robot 629f3c159e Merge pull request #28558 from quinton-hoole/2016-07-06-excise-ubernetes-from-main-repo
Automatic merge from submit-queue

Deprecate the term "Ubernetes" 

Deprecate the term "Ubernetes" in favor of "Cluster Federation" and  "Multi-AZ Clusters"
2016-07-11 23:20:53 -07:00
Harry Zhang 0d5dddcb71 Add DELETE event type
Signed-off-by: Harry Zhang <harryz@hyper.sh>

Combine delete with update
2016-07-12 14:08:01 +08:00
Xiang Li 67787caeeb controller/volume: simplify sync logic in syncBoundClaim 2016-07-11 19:36:36 -07:00
k8s-merge-robot 0699b4d41e Merge pull request #17048 from feiskyer/kubelet/client-server-proposal
Automatic merge from submit-queue

Proposal: client/server container runtime

Ref #25899  #13768 

Proposal for client/server container runtime

CC @brendandburns @dchen1107 @kubernetes/goog-node @kubernetes/sig-node
2016-07-11 19:26:51 -07:00
Xiang Li 9eb2831954 controller/volume: simplify sync logic in syncUnboundClaim 2016-07-11 19:22:14 -07:00
k8s-merge-robot 7b067c859f Merge pull request #26387 from MHBauer/cleanupjitter
Automatic merge from submit-queue

close channel to prevent buildup of wait.JitterUntil()

<!--
Checklist for submitting a Pull Request

Please remove this comment block before submitting.

1. Please read our [contributor guidelines](https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md).
2. See our [developer guide](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md).
3. If you want this PR to automatically close an issue when it is merged,
   add `fixes #<issue number>` or `fixes #<issue number>, fixes #<issue number>`
   to close multiple issues (see: https://github.com/blog/1506-closing-issues-via-pull-requests).
4. Follow the instructions for [labeling and writing a release note for this PR](https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes) in the block below.
-->

Trying to look at flake in #26377 by running the test with large counts of runs. It was timing out because a `wait.JitterUntil` goroutine builds up for each of the four tests. So if you ran it a thousand times, you would end up with 4k goroutines spinning in the background. Now I create a channel and close it at the end of each test to prevent a memory leak.
2016-07-11 18:53:39 -07:00
Pengfei Ni e12044518e Proposal for client-server container runtime 2016-07-12 09:17:08 +08:00
k8s-merge-robot 700c1dc9fe Merge pull request #28796 from ronnielai/disk-inode-summary
Automatic merge from submit-queue

Include inode info in container summary

#28719
2016-07-11 17:47:10 -07:00
k8s-merge-robot cef6f776f1 Merge pull request #27243 from smarterclayton/dont_alter_error
Automatic merge from submit-queue

resource.Builder should not alter error type from server
2016-07-11 16:42:08 -07:00
k8s-merge-robot 30c43e63af Merge pull request #26696 from gitfred/no-header-custom-column
Automatic merge from submit-queue

--no-header available now for custom-column

Change `CustomColumnsPrinter` to have `noHeader` boolean, also changed `GetPrinter` to receive this bool and pass it through.
One test `TestNewColumnPrinterFromSpecWithNoHeaders` added for checking if there is no headers in output for sure

fixes #24133
2016-07-11 16:11:23 -07:00
Ron Lai 2c71ce305a Include inode info in container summary 2016-07-11 15:53:55 -07:00
Aaron Levy 25ac0dd030 retry on apiserver insecure listen failures 2016-07-11 14:18:13 -07:00
k8s-merge-robot afba11e11e Merge pull request #28744 from smarterclayton/fix_fifo_race
Automatic merge from submit-queue

Allow a FIFO client to requeue under lock

The Pop method should allow a caller to requeue an item while under the
fifo lock, to avoid races on deletes.

@deads2k @wojtek-t
2016-07-11 12:56:16 -07:00
Wojciech Tyczynski d14fe0f269 Change storeToNodeConditionLister to return []*api.Node instead of api.NodeList for performance 2016-07-11 21:02:33 +02:00
k8s-merge-robot 5067af159e Merge pull request #28715 from euank/kubelet-trim-dead-code
Automatic merge from submit-queue

kubelete: delete a few bits of dead code

Less is more.
2016-07-11 11:40:47 -07:00
k8s-merge-robot 0aa90bd63b Merge pull request #28705 from pmorie/rm-getref
Automatic merge from submit-queue

Remove unnecessary calls to api.GetReference

These calls are unnecessary, can be removed.  `Eventf` and others just call `GetReference` on the object they are passed.

cc @kubernetes/sig-node
2016-07-11 11:07:26 -07:00
k8s-merge-robot cef3e4568d Merge pull request #28690 from markturansky/immutable_claim
Automatic merge from submit-queue

PersistentVolumeClaim.Spec is immutable once created

Per https://github.com/kubernetes/kubernetes/pull/28636, PVCs are immutable post-creation in order to enforce quota, limitRange, etc. without being able to game the system.

@derekwaynecarr @abhgupta @smarterclayton @kubernetes/sig-storage 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-11 10:30:03 -07:00
k8s-merge-robot 10141ebc21 Merge pull request #28757 from resouer/nit-fix
Automatic merge from submit-queue

Remove no needed todo

ref #19645 #13418

Remove comment about refactoring pod cleanup since we have agree to keep it.

cc @yujuhong
2016-07-11 09:57:16 -07:00
markturansky 3ddb8470b9 make PVCs immutable (except volumeName) post-creation 2016-07-11 11:50:16 -04:00
k8s-merge-robot 9b74e24fa3 Merge pull request #28769 from wojtek-t/optimize_priorities
Automatic merge from submit-queue

Optimize priorities in scheduler

Ref #28590

It's probably easier to review it commit by commit, since those changes are kind of independent from each other.

@davidopp - FYI
2016-07-11 07:49:23 -07:00
Wojciech Tyczynski dcb2ca54ad Avoid unnecessary copies 2016-07-11 15:41:27 +02:00
Johannes Scheuermann 07b81abb6c Fix typos in volume.go 2016-07-11 12:32:32 +02:00
k8s-merge-robot 39bfa168cd Merge pull request #28684 from kargakis/deployment-controller-updates
Automatic merge from submit-queue

Deployment controller updates

@kubernetes/deployment @deads2k PTAL
2016-07-11 02:56:47 -07:00
Xiang Li 67f670df2e controller/service: minor cleanup 2016-07-10 23:13:25 -07:00
k8s-merge-robot d6e84cc2e9 Merge pull request #28570 from kevinjkj/kevinjkj-patch-3
Automatic merge from submit-queue

Optimizing the processing flow of HandlePodAdditions and canAdmitPod …

Optimizing the processing flow of HandlePodAdditions and canAdmitPod methods. If the following loop body in canAdmitPod method is removed, the detection speed can be improved, and the change is very small.
------
otherPods := []*api.Pod{}
	for _, p := range pods {
		if p != pod {
			otherPods = append(otherPods, p)
		}
	}
------
2016-07-10 23:11:00 -07:00
Harry Zhang 1ad9235993 Remove no needed todo 2016-07-11 13:40:45 +08:00
Kevin Wang 09344c1ffc Optimizing the processing flow of HandlePodAdditions and canAdmitPod methods.
Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>

change the note for the canAdmitPod method.

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>

gofmt kubelet.go

Signed-off-by: Kevin Wang <wang.kanghua@zte.com.cn>
2016-07-11 10:34:51 +08:00
Hongchao Deng 73821d20eb ListOptions: fix the doc on ResourceVersion 2016-07-10 15:21:58 -07:00
Clayton Coleman 2132ecc28d
Allow a FIFO client to requeue under lock
The Pop method should allow a caller to requeue an item while under the
fifo lock, to avoid races on deletes.
2016-07-10 17:32:21 -04:00
k8s-merge-robot 00d00cdac0 Merge pull request #26315 from dims/fix-issue-26303
Automatic merge from submit-queue

Support --all-namespaces in kubectl describe


Work In Progress :)

Fixes #26303
2016-07-10 08:00:23 -07:00
k8s-merge-robot a261776f3e Merge pull request #28670 from wojtek-t/scheduler_metadata
Automatic merge from submit-queue

Add meta field to predicate signature to avoid computing the same things multiple times

This PR only uses it to avoid computing QOS of a pod for every node from scratch.

Ref #28590
2016-07-09 22:28:14 -07:00
k8s-merge-robot c12de567cd Merge pull request #26931 from xiang90/fix_daemon
Automatic merge from submit-queue

daemon/controller.go: fix bugs in updateDaemonSetStatus

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()

1. return when there is any error

2. fix StatusUpdateRetries loop

3. a few minor cleanup
2016-07-09 15:31:48 -07:00
k8s-merge-robot e712b3c47a Merge pull request #28627 from ronnielai/disk-gc2
Automatic merge from submit-queue

RemoveContainer in Runtime interface

- Added a DeleteContainer method in Runtime interface
- Implemented DeleteContainer for docker

#28552
2016-07-08 22:18:51 -07:00
k8s-merge-robot 3b3f7fb09c Merge pull request #27977 from ciwang/move-storage-examples
Automatic merge from submit-queue

Move storage examples

Fixes #23671 

Consolidate storage examples into separate folders for storage and volume plugins
2016-07-08 21:45:38 -07:00
k8s-merge-robot 01c0f8cb54 Merge pull request #28587 from wojtek-t/remove_codec_from_content_config
Automatic merge from submit-queue

Remove Codec from ContentConfig.

This is the remaining cleanup after adding NegotiatedSerializer to ContentConfig.
2016-07-08 21:12:24 -07:00
k8s-merge-robot 66522389b7 Merge pull request #28572 from atombender/master
Automatic merge from submit-queue

Fixes bad heuristic when calling "tc show" to check interface

`tc` sometimes returns stuff that has more than 12 words in its response. The heuristic is bad, but this at least fixes the case when `tc` is returning too much.

Fixes #28571.
2016-07-08 19:47:45 -07:00
k8s-merge-robot 0f20ab63af Merge pull request #28566 from dubstack/dubstack-refactor-cgroup-manager
Automatic merge from submit-queue

Add checks in Create and Update Cgroup methods

This PR is connected to upstream issue for adding pod level cgroups in Kubernetes: #27204 
Libcontainer currently doesen't support updates to parent devices cgroups. Until we get libcontainer to support skipping devices cgroup we will have that logic on the kubelet side.
This PR includes:
1. Skip the devices cgroup when updating a cgroup. We only update the memory and cpu subsytems.
2. We explicitly pass all the cgroup paths that don't already exist to Apply() 
3. Adds an AlreadyExists() method which is a utility function to check if all the subsystems of a cgroup already exist. 
On cgroupManager.Update() we only call Set() and cgroupManager.Create() we only call Apply() method

@vishh PTAL
2016-07-08 19:12:01 -07:00
k8s-merge-robot 516fba7183 Merge pull request #28511 from pmorie/kubelet-move
Automatic merge from submit-queue

Extract kubelet network code into its own file

Continuing the effort to begin modularizing the kubelet, this PR extracts the networking code into its own file.

@kubernetes/sig-node cc @kubernetes/sig-network
2016-07-08 17:50:23 -07:00
k8s-merge-robot 9a4cc9979a Merge pull request #28504 from deads2k/allow-quota-injection
Automatic merge from submit-queue

allow lock acquisition injection for quota admission

Allows for custom lock acquisition when composing the quota admission controller.

@derekwaynecarr I'm still experimenting to make sure this satisfies the need downstream, but looking for agreement in principle
2016-07-08 17:15:39 -07:00
k8s-merge-robot b71b6eb8e8 Merge pull request #25646 from nhlfr/kubectl-petset-resource
Automatic merge from submit-queue

Include petsets in kubectl valid commands

Petsets are already implemented in kubectl, but there were no hints
for that subcommand.

Fixes #25615
2016-07-08 16:36:54 -07:00
k8s-merge-robot 1376c99327 Merge pull request #27412 from liggitt/test-etcd-dir
Automatic merge from submit-queue

Allow specifying base location for test etcd data

Allows controlling where etcd test data goes. Needed in some environments (like AWS/EBS) to allow putting etcd data on a higher performing volume than /tmp
2016-07-08 15:16:40 -07:00
Euan Kemp eeee8b54ea kubelet: delete unused pod manager method 2016-07-08 15:15:54 -07:00
Euan Kemp 26e0f50504 kubelet: delete unused code 2016-07-08 15:15:43 -07:00
Paul Morie 5ca51e4047 Remove unnecessary calls to api.GetReference 2016-07-08 16:53:33 -04:00
Cindy Wang fedc513658 Consolidated examples into storage/ and volume/ folders
Search and replace for references to moved examples

Reverted find and replace paths on auto gen docs

Reverting changes to changelog

Fix bugs in test-cmd.sh

Fixed path in examples README

ran update-all successfully

Updated verify-flags exceptions to include renamed files
2016-07-08 13:34:32 -07:00
Jordan Liggitt e43e58c787
Allow specifying base location for test etcd data 2016-07-08 16:24:41 -04:00
Paul Morie 5c836f3582 Extract kubelet network code into its own file 2016-07-08 15:18:07 -04:00
k8s-merge-robot 04602bb9e5 Merge pull request #28655 from freehan/kubeproxyfix
Automatic merge from submit-queue

Don't delete affinity when endpoints are empty

closes: #25316
2016-07-08 11:28:43 -07:00
Ron Lai 0a651402f2 - Added a DeleteContainer method in Runtime interface
- Implemented DeleteContainer for docker
2016-07-08 10:40:30 -07:00
Chao Xu 7a5b3c43a0 plumb --enable_garbage_collector from environment variable;
adding a simple e2e test
2016-07-08 10:27:16 -07:00
Davanum Srinivas c879e69f9f
Support --all-namespaces in kubectl describe
Fixes #26303
2016-07-08 11:45:38 -04:00
Michail Kargakis 1fb8dd838b controller: various fixes for the deployment controller
Changes:
* moved waiting for synced caches before starting any work
* refactored worker() to really quit on quit
* changed queue to a ratelimiting queue and added retries on errors
* deep-copy deployments before mutating - we still need to deep-copy
replica sets and pods
2016-07-08 17:30:40 +02:00
Davanum Srinivas 8b0868b76d
Fix kubectl run to print object on dry run
Originally Authored By tnachen in PR:
https://github.com/kubernetes/kubernetes/pull/25842

Fixes #19636
2016-07-08 11:00:08 -04:00
k8s-merge-robot becb3b44e7 Merge pull request #28646 from kubernetes/revert-28448-gce-pd-discard
Automatic merge from submit-queue

Revert "Mount r/w GCE PD disks with -o discard"

Reverts kubernetes/kubernetes#28448

We need to make sure that we check for compatibility with the discard flag before mounting with it.
2016-07-08 05:26:23 -07:00
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +02:00
k8s-merge-robot 913d785b39 Merge pull request #28597 from soltysh/pending_pods
Automatic merge from submit-queue

Added test case covering pending pods in syncJob

@randalloveson suggested in #27997 we might not take pending pods into considerations, while checking that I wrote additional test case for `syncJob`.

@randalloveson @erictune ptal

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-08 04:12:21 -07:00
Wojciech Tyczynski b1d53895a4 Check only predicate functions in test 2016-07-08 13:01:41 +02:00
Wojciech Tyczynski 6890868823 Add meta field to predicates signature 2016-07-08 12:25:48 +02:00
k8s-merge-robot e7b92b9d0a Merge pull request #28161 from asalkeld/util_deployment
Automatic merge from submit-queue

Move deployment functions to deployment/util.go not widely used

If the function is not used in multiple areas, move it to deployment/util.go

fixes #26750
2016-07-08 03:06:51 -07:00
k8s-merge-robot 383d45f185 Merge pull request #28596 from wojtek-t/scheduler_optimizations
Automatic merge from submit-queue

Some scheduler optimizations

Ref #28590

This PR doesn't do anything fancy - it is just reducing amount of memory allocations in scheduler, which in turn significantly speeds up scheduler.
2016-07-08 02:34:06 -07:00
k8s-merge-robot 2296108886 Merge pull request #28549 from caseydavenport/cd-default-netpol
Automatic merge from submit-queue

Enable extensions/v1beta1/NetworkPolicy by default

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

For some reason this also triggered an update to the swagger spec (which apparently hadn't been done before but wasn't failing validation...)
2016-07-08 01:39:15 -07:00
k8s-merge-robot dbab1a8477 Merge pull request #28579 from thockin/dont-checkin-generated-code-prep-2
Automatic merge from submit-queue

Prep for not checking in generated, part 2/2

This PR is extracted from #25978 and build on #28578 - it is just the conversion related parts. All the Makefile stuff is excluded.

@wojtek-t this is literally branched, a bunch of commits deleted, and a very small number of manual fixups applied. If you think this is easier to review (and if it passes CI) you can feel free to go over it again. I will follow this with a conversion-related PR to build on this.

Or if you prefer, just close this and let the mega-PR ride.

@lavalamp
2016-07-08 01:05:00 -07:00
Angus Salkeld eec08872c7 Move deployment utilities to there own package 2016-07-08 09:46:56 +02:00
k8s-merge-robot b39951c7f5 Merge pull request #28522 from fluxrad/less-verbose-dns
Automatic merge from submit-queue

Fix DNS verbosity 

fixes #28515

By default kube-dns logs all queries against the internal API at Info level. In a larger cluster this is noisy. Log DNS queries at verbosity level 2 by default. 

[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-07 23:56:00 -07:00
Brendan Burns 891bd3e522 add a test 2016-07-07 22:09:55 -07:00
Tim Hockin 355794c303 Log errors or fail if conversion fail to generate
This fixes PodSpec to generate cleanly.  No other types only half-generate (so
now we Fatalf), though several fail to generate at all (only Errorf for now).
2016-07-07 22:09:08 -07:00
Tim Hockin f63f168b51 Comment and simplify a bit of conversion
There are ample opportunities to optimize and streamline here.  For example,
there's no reason to have a function to convert IntStr to IntStr. Removing the
function does generate the right assignment, but it is unclear whether the
registered function is needed or not.  I opted to leave it alone for now.
Another example is Convert_Slice_byte_To_Slice_byte, which just seems silly.
2016-07-07 22:09:08 -07:00
Tim Hockin 291b51ec50 Use file tags to generate conversions
This drives conversion generation from file tags like:
  // +conversion-gen=k8s.io/my/internal/version
.. rather than hardcoded lists of packages.

The only net change in generated code can be explained as correct.  Previously
it didn't know that conversion was available.
2016-07-07 22:09:08 -07:00
k8s-merge-robot 42805f53b0 Merge pull request #28578 from thockin/dont-checkin-generated-code-prep-1
Automatic merge from submit-queue

Prep for not checking in generated, part 1/2

This PR is extracted from #25978 - it is just the deep-copy related parts.  All the Makefile and conversion stuff is excluded.

@wojtek-t this is literally branched, a bunch of commits deleted, and a very small number of manual fixups applied.  If you think this is easier to review (and if it passes CI) you can feel free to go over it again. I will follow this with a conversion-related PR to build on this.

Or if you prefer, just close this and let the mega-PR ride.

@lavalamp
2016-07-07 21:25:10 -07:00
k8s-merge-robot 1c8985160a Merge pull request #28573 from dims/fix-issue-7496-followup
Automatic merge from submit-queue

Follow up to PR 25640 - Cleanup newline and tweak help text

Follow up to PR https://github.com/kubernetes/kubernetes/pull/25640

* Remove redundant newline below Aliases:
* Renaming "Available Commands:" to "Available Sub-commands:"
2016-07-07 20:52:56 -07:00
k8s-merge-robot 9a414d275d Merge pull request #28542 from liggitt/sa-invalid-token
Automatic merge from submit-queue

Check for valid serviceaccount JWT token before inspecting claims

Moved claims check after the error check that ensures we have a valid JWT token
2016-07-07 20:17:42 -07:00
k8s-merge-robot e06197d478 Merge pull request #28513 from smarterclayton/reflection_met
Automatic merge from submit-queue

Remove reflection path in meta.Accessor

Callers are required to implement their interfaces, removes the
potential for mistakes. We have a reflective test
pkg/api/meta_test.go#TestAccessorImplementations that verifies that all
objects registered to the scheme properly implement their interfaces.

@wojtek-t this may need an additional test or two, but I think this is a
net win over the current state (where people fallback to reflection without
being aware of it).
2016-07-07 18:08:40 -07:00
Minhan Xia e1df5c8b30 fix proxy unit tests 2016-07-07 17:43:22 -07:00
k8s-merge-robot 60c5985d02 Merge pull request #28500 from deads2k/migration
Automatic merge from submit-queue

don't migrate files you can't access

If you can't access a file, you shouldn't try to migrate it.

Ref https://github.com/openshift/origin/issues/9581

@fabianofranz
2016-07-07 17:32:51 -07:00
k8s-merge-robot 8ea57733b4 Merge pull request #28478 from smarterclayton/adaptation
Automatic merge from submit-queue

Autoscaling should be part of clientset.Adaption

@mfojtik
2016-07-07 16:57:36 -07:00
Tim Hockin 51394e862d Make runtime opt in to deepcopy
This minimizes the number of functions generated.  It also breaks the chain of
symbol dependencies to pkg/conversion, so we can remove now-unreferenced
(previously unused but referenced) conversion deep-copies.
2016-07-07 16:49:46 -07:00
Tim Hockin dc10f10e48 Recreate the opt-in/opt-out logic for deepcopy
This is the last piece of Clayton's #26179 to be implemented with file tags.
All diffs are accounted for.  Followup will use this to streamline some
packages.

Also add some V(5) debugging - it was helpful in diagnosing various issues, it
may be helpful again.
2016-07-07 16:49:46 -07:00
Tim Hockin 28af54138d Use file tags to generate deep-copies
This drives most of the logic of deep-copy generation from tags like:
  // +deepcopy-gen=package
..rather than hardcoded lists of packages.  This will make it possible to
subsequently generate code ONLY for packages that need it *right now*, rather
than all of them always.

Also remove pkgs that really do not need deep-copies (no symbols used
anywhere).
2016-07-07 16:49:46 -07:00
Tim Hockin d88fc84bae Make multi-key tags more explicit
This is in prep to simplify tag logic.  Don't rely on processing commas as new
tag delimiters.  Put new tags on new lines.  This had zero effect on generated
code (as intended).
2016-07-07 16:49:46 -07:00
Tim Hockin 57c3196914 Add support for manually defined DeepCopy methods
In bringing back Clayton's PR piece-by-piece this was almost as easy to
implement as his version, and is much more like what I think we should be
doing.

Specifically, any time which defines a .DeepCopy() method will have that method
called preferentially.  Otherwise we generate our own functions for
deep-copying.  This affected exactly one type - resource.Quantity.  In applying
this heuristic, several places in the generated code were simplified.

To achieve this I had to convert types.Type.Methods from a slice to a map,
which seems correct anyway (to do by-name lookups).
2016-07-07 16:49:46 -07:00
Tim Hockin e18b2f3a2e Revert Clayton's #26179 so I can recreate it
His PR cam during the middle of this development cycle, and it was easier to
burn it down and recreate it than try to patch it into an existing series and
re-test every assumption.  This behavior will be re-introduced in subsequent
commits.
2016-07-07 16:49:46 -07:00
Michael Rubin 8028e953b6 Revert "Mount r/w GCE PD disks with -o discard" 2016-07-07 16:47:35 -07:00
k8s-merge-robot 3494f8e2f9 Merge pull request #28581 from lixiaobing10051267/masternotesorder
Automatic merge from submit-queue

The notes are inconsistent with the code

 In file "pkg/client/cache/store.go, the notes of line 102 "name and namespace" is inconsistent with line 103 "return parts[0], parts[1], nil", because parts[0] is namespace, and parts[1] is name, It is easy to be confused, and better to modify the notes to "namespace and name".
2016-07-07 16:22:50 -07:00
k8s-merge-robot 5f2460b58c Merge pull request #21240 from thockin/validation_pt8
Automatic merge from submit-queue

Validation: Make validation func return error strings

Part of an ongoing series of validation cleanups.

This centralizes the error strings next to the code that checks the error conditions.  Future commits will refine the messages further and provide more utility validators.

I'm OK if this doesn't go into 1.2, but I am tired of rebasing :)  I suggest commit-by-commit review, which should go pretty quickly.  This was largely mechanical.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/21240)
<!-- Reviewable:end -->
2016-07-07 14:37:11 -07:00
Buddha Prakash dcfff45ab7 Add checks in Create and Update Cgroup methods 2016-07-07 14:17:14 -07:00
juanvallejo 17a4df2c31 update resource builder error message to be more clear 2016-07-07 16:32:26 -04:00
k8s-merge-robot b3c2c9eb5d Merge pull request #27381 from dims/fix-issue-2967
Automatic merge from submit-queue

Fix problem specifying fqdn:port in command line

When specifying --server in kubectl for example, we end up
with failure if you use "localhost:8080" instead of
"127.0.0.1:8080". This is because of the way url.Parse
works as shown in snippet:
https://play.golang.org/p/luD57S6sEz

Essentially localhost ends up as the Scheme and NOT as the Host.
So we add another check to make sure we prepend the scheme
when Host ends up being empty as well. Tested with
"kubectl --server localhost:8080 get po"

Fixes #2967
2016-07-07 13:21:58 -07:00
k8s-merge-robot f1a6685b71 Merge pull request #24705 from derekwaynecarr/port_active_deadline
Automatic merge from submit-queue

Move ActiveDeadlineSeconds implementation into a kubelet sync observer

The first commit is from: https://github.com/kubernetes/kubernetes/pull/24344

The second commit moves the code for enforcement around active deadlines into a kubelet sync observer pattern.  It groups code that used to be scattered across the kubelet.

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/24705)
<!-- Reviewable:end -->
2016-07-07 12:49:02 -07:00
k8s-merge-robot 4da14c8a64 Merge pull request #28204 from thockin/cleanup-third_party
Automatic merge from submit-queue

Cleanup third party (pt 2)

Move forked-and-hacked golang code to the forked/ directory.  Remove ast/build/parse code that is now in stdlib.  Remove unused shell2junit
2016-07-07 12:13:14 -07:00
k8s-merge-robot 569008809f Merge pull request #28375 from duglin/removeContinue
Automatic merge from submit-queue

Remove unneeded continute

very minor but I noticed and it and it bugged me :-)

Signed-off-by: Doug Davis <dug@us.ibm.com>
2016-07-07 11:36:13 -07:00
k8s-merge-robot 939b98481e Merge pull request #28448 from thockin/gce-pd-discard
Automatic merge from submit-queue

Mount r/w GCE PD disks with -o discard

As per https://cloud.google.com/compute/docs/disks/add-persistent-disk#formatting.

Fixes #23258
2016-07-07 11:01:43 -07:00
derekwaynecarr c162fec94d Move ActiveDeadlineSeconds to use lifecycle observers 2016-07-07 13:43:55 -04:00
k8s-merge-robot 3895cede49 Merge pull request #28434 from thockin/br-netfilter-warning
Automatic merge from submit-queue

Remove br_netfilter warning in kube-proxy

Many distros have this module linked in, generating a spurious error.

Fixes #23385
2016-07-07 10:27:20 -07:00
Casey Davenport 988359d0fe Enable extensions/v1beta1/NetworkPolicy by default 2016-07-07 10:04:46 -07:00
k8s-merge-robot 05cbaa9900 Merge pull request #28151 from mbohlool/master
Automatic merge from submit-queue

Represent unversioned.Time correctly in swagger spec

unversioned.Time previously represented as "string" type with no format while the correct representation should also have "date-time" as format. fixes #2968
2016-07-07 09:53:25 -07:00
k8s-merge-robot ec6181d5d3 Merge pull request #25036 from kargakis/validate-generation-update
Automatic merge from submit-queue

api: validate generation updates

@bprashanth @liggitt PTAL
2016-07-07 08:06:51 -07:00
k8s-merge-robot a1501fde66 Merge pull request #28550 from janetkuo/e2e-deployment-rollover-log
Automatic merge from submit-queue

Log available pods of deployments when scaling down old RS

Ref #26834


[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
2016-07-07 07:33:30 -07:00
Maciej Szulik 79028c4e3b Added test case covering pending pods in syncJob 2016-07-07 14:45:34 +02:00
Wojciech Tyczynski 7219802ac7 Pass pointer to node in NodCondition 2016-07-07 14:10:17 +02:00
Michail Kargakis 93c2656d5a api: validate generation updates 2016-07-07 13:09:48 +02:00
Sylwester Brzeczkowski 19434e1b58 24133 fix: --no-headers works with custom columns now 2016-07-07 10:04:09 +02:00
k8s-merge-robot 3832b32d08 Merge pull request #27501 from ronnielai/test1
Automatic merge from submit-queue

Log all image deletion errors instead of just the last one

#27169
2016-07-07 00:53:39 -07:00
k8s-merge-robot 2da247ffbc Merge pull request #26977 from joe2far/fix-help-strings
Automatic merge from submit-queue

Make kubectl help strings consistent
2016-07-07 00:12:22 -07:00
lixiaobing10051267 9915e89107 The notes are in reverse order 2016-07-07 14:45:16 +08:00
k8s-merge-robot 8741217179 Merge pull request #28547 from elyscape/completion-docs
Automatic merge from submit-queue

Reformat kubectl completion example text
2016-07-06 23:37:06 -07:00
k8s-merge-robot bb763df8d5 Merge pull request #28530 from lixiaobing10051267/msterwascreated
Automatic merge from submit-queue

"was not created" should be "was created"

In file pkg\client\restclient/request_test.go, line #1089, "t.Errorf("expected object was not created")" , here "was not created" should be "was created" because the if condition is "if wasCreated".
2016-07-06 23:37:02 -07:00
k8s-merge-robot f3d0d147eb Merge pull request #28305 from jlowdermilk/kubectl-convert-noise
Automatic merge from submit-queue

kubectl convert --local prints info message to stderr

fix #28298
2016-07-06 23:36:53 -07:00
k8s-merge-robot 0c696dc95b Merge pull request #27848 from liubin/fix-typos
Automatic merge from submit-queue

fix some typos

Just a minor typos fix.


Signed-off-by: bin liu <liubin0329@gmail.com>
2016-07-06 23:36:49 -07:00
k8s-merge-robot 8135154f7f Merge pull request #26868 from xiang90/rm_all
Automatic merge from submit-queue

daemon/controller.go: remove unused func enqueueAllDaemonSets
2016-07-06 23:36:45 -07:00
k8s-merge-robot 79c8d8b735 Merge pull request #26588 from caesarxuchao/release-1.4-clientset
Automatic merge from submit-queue

[client-gen] stop update release_1_3 clientset; create release_1_4

We'll bump the version after we cut 1.3 release. I'll keep this PR assigned to myself in the mean time.

@lavalamp
2016-07-06 23:02:56 -07:00
Davanum Srinivas e3146456d3
Change Commands to Sub-commands in help 2016-07-06 23:29:49 -04:00