Commit Graph

20344 Commits (c20e63bfb98fecef7461dbaf8ed52e31fe12cd11)

Author SHA1 Message Date
Avesh Agarwal ebe3255439 Add unit tests when the feature AffinityInAnnotations is disabled. 2017-04-13 17:15:45 -04:00
Avesh Agarwal d2117c0148 Fix to not allow when the feature AffinityInAnnotations is disabled.
https://github.com/kubernetes/kubernetes/issues/44360
2017-04-13 17:15:44 -04:00
Chao Xu 9837a98564 move resource_helpers.go to a subpackage 2017-04-13 12:03:42 -07:00
Chao Xu 9d7a8df5ee add gc admission plugin that prevents user who doesn't have delete permission of the owner from setting blockOwnerDeletion 2017-04-13 11:55:22 -07:00
Kubernetes Submit Queue d2733394ca Merge pull request #42144 from xilabao/add-resource-validate
Automatic merge from submit-queue

add validate to resource in can-i

```
#kubectl auth can-i get xxx
the server doesn't have a resource type "xxx"
```
2017-04-13 11:43:05 -07:00
Random-Liu 2fbf34f7c1 Stop following container log when container exited. 2017-04-13 11:25:08 -07:00
Chao Xu d9920c53a5 move ref.go to its own subpackage 2017-04-13 10:02:43 -07:00
Kubernetes Submit Queue c3463d737e Merge pull request #44251 from superbrothers/completion-cluster-user-flags
Automatic merge from submit-queue

Support completion for --cluster and --user

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

kubectl is supported completion for `--cluster` and `--user`.

```
$ kubectl --user=<tab>
--user=minikube  --user=user01

$ kubectl --cluster=<tab>
--cluster=cluster01  --cluster=minikube
```

**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
Add completion support for --namespace and --cluster to kubectl
```
2017-04-13 08:42:04 -07:00
Dmitry Shulyak f50480c714 Decouple remotecommand client from term/kubelet dependencies
In order to move client/unversioned/remotecommand to client-go as a followup
for this change we have to decouple it from tons of dependencies
2017-04-13 15:56:40 +03:00
Kubernetes Submit Queue 45dc1539f3 Merge pull request #44416 from ivan4th/fix-kubectl-crash
Automatic merge from submit-queue

Fix crash in kubectl run

I observed the problem in k8s 1.5.1, but the code is still there, so fixing it.
Here's the old backtrace - happened due to network disconnection during `kubectl run`:

```
ivan4th@i4mac:~$ kubectl run --rm -it alpine1 --image=alpine:3.5 --restart=Never /bin/sh
Waiting for pod default/alpine1 to be running, status is Pending, pod ready: false
If you don't see a command prompt, try pressing enter.
/ # panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xe8706]

goroutine 1 [running]:
panic(0x11e0d80, 0xc420016090)
        /usr/local/go/src/runtime/panic.go:500 +0x1a1
k8s.io/kubernetes/pkg/kubectl/cmd.waitForPod.func2(0xc400000008, 0x14783a0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:432 +0x126
k8s.io/kubernetes/pkg/util/interrupt.(*Handler).Run(0xc420379230, 0xc4206c11f0, 0x0, 0x0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/util/interrupt/interrupt.go:103 +0x109
k8s.io/kubernetes/pkg/kubectl/cmd.waitForPod(0x208c8c0, 0xc4204832c0, 0xc4204395d0, 0x7, 0xc4204395a0, 0x7, 0x1477e10, 0xc4206e6040, 0x0, 0x0, ...)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:434 +0x49e
k8s.io/kubernetes/pkg/kubectl/cmd.waitForPodTerminated(0x208c8c0, 0xc4204832c0, 0xc4204395d0, 0x7, 0xc4204395a0, 0x7, 0x1c48020, 0xc42002c010, 0xc420124300, 0x0, ...)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:458 +0xea
k8s.io/kubernetes/pkg/kubectl/cmd.Run(0x1c61040, 0xc4203106e0, 0x1c47fe0, 0xc42002c008, 0x1c48020, 0xc42002c010, 0x1c48020, 0xc42002c018, 0xc42047e6c0, 0xc42006d200, ...)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:304 +0xe37
k8s.io/kubernetes/pkg/kubectl/cmd.NewCmdRun.func1(0xc42047e6c0, 0xc42006d200, 0x2, 0x6)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/kubectl/cmd/run.go:98 +0x144
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute(0xc42047e6c0, 0xc42006d140, 0x6, 0x6, 0xc42047e6c0, 0xc42006d140)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:603 +0x439
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0xc4204dbb00, 0xc420438e50, 0x1, 0x1)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:689 +0x367
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute(0xc4204dbb00, 0xc4203106e0, 0x1c47fe0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/spf13/cobra/command.go:648 +0x2b
k8s.io/kubernetes/cmd/kubectl/app.Run(0x0, 0x0)
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubectl/app/kubectl.go:38 +0xd5
main.main()
        /go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/cmd/kubectl/kubectl.go:26 +0x22
```
2017-04-13 05:56:14 -07:00
Maciej Szulik fda5010948 Generated changes for docs in batch types.go 2017-04-13 14:15:19 +02:00
Maciej Szulik 4b57a25730 Update batch types.go documentation strings 2017-04-13 13:28:00 +02:00
Kubernetes Submit Queue 19d722671b Merge pull request #43297 from mvdan/kubectl-params
Automatic merge from submit-queue

kubectl/cmd: remove a bunch of unused parameters

Found with github.com/mvdan/unparam.

**Release note**: NONE
2017-04-13 04:07:21 -07:00
Kubernetes Submit Queue 868eb745ab Merge pull request #42663 from soltysh/37166_followup
Automatic merge from submit-queue

Add default information to CronJobSpec

This is requested followup to https://github.com/kubernetes/kubernetes/pull/41890

@smarterclayton @janetkuo ptal
2017-04-13 03:23:26 -07:00
Kubernetes Submit Queue e4752d612a Merge pull request #44391 from ncdc/reduce-rc-logging
Automatic merge from submit-queue

Reduce replication_controller log spam

Decrease verbosity and reword 'Observed updated replication controller
...' now that the issue it was added for has been fixed.

This was originally added to debug #31981, and it was fixed back in September 2016.

cc @gmarek @wojtek-t @kargakis @eparis @smarterclayton
2017-04-12 23:13:22 -07:00
FengyunPan 09db327019 ServiceAccountsController does not need nameIndexFunc to index ST 2017-04-13 12:31:34 +08:00
NickrenREN 5c9fe166f9 add test for service controller sync and remove unused function 2017-04-13 12:06:12 +08:00
Kubernetes Submit Queue f1c0c0a73c Merge pull request #42395 from nicksardo/gce-src-ranges
Automatic merge from submit-queue

Adding load balancer src cidrs to GCE cloudprovider

**What this PR does / why we need it**:
As of January 31st, 2018, GCP will be sending health checks and l7 traffic from two CIDRs and legacy health checks from three CIDS. This PR moves them into the cloudprovider package and provides a flag for override.

Another PR will need to be address firewall rule creation for external L4 network loadbalancing #40778

**Which issue this PR fixes**
Step one of #40778
Step one of https://github.com/kubernetes/ingress/issues/197

**Release note**:
```release-note
Add flags to GCE cloud provider to override known L4/L7 proxy & health check source cidrs
```
2017-04-12 19:57:43 -07:00
xiangpengzhao e1e1834e8b Show node address type in kubectl describe node command 2017-04-13 09:22:39 +08:00
Ivan Shvedunov b62af04f7f Fix crash in kubectl run 2017-04-13 01:00:50 +03:00
Kubernetes Submit Queue 42c0994c34 Merge pull request #43031 from dashpole/eviction_metrics
Automatic merge from submit-queue

Add prometheus metrics for age of stats used for evictions.

Completes #42923 

This PR adds metrics for evictions, and records how stale data used for evictions is.

cc @vishh @derekwaynecarr @kubernetes/sig-node-pr-reviews
2017-04-12 12:38:58 -07:00
Jordan Liggitt ad116026d9
Remove vestiges of defaulting from conversion path, switch to top-level default registration only 2017-04-12 13:36:15 -04:00
Kubernetes Submit Queue 06cdb02fca Merge pull request #44359 from ncdc/var-lib-dockershim
Automatic merge from submit-queue

Make the dockershim root directory configurable

Make the dockershim root directory configurable so things like
integration tests (e.g. in OpenShift) can run as non-root.

cc @sttts @derekwaynecarr @yujuhong @Random-Liu @kubernetes/sig-node-pr-reviews @kubernetes/rh-cluster-infra
2017-04-12 09:58:18 -07:00
Kubernetes Submit Queue c9014b1029 Merge pull request #42849 from janetkuo/kubectl-describe-controllerRef
Automatic merge from submit-queue

In 'kubectl describe', find controllers with ControllerRef, instead of showing the original creator

@enisoc @kargakis @kubernetes/sig-apps-pr-reviews @kubernetes/sig-cli-pr-reviews 

```release-note
In 'kubectl describe', find controllers with ControllerRef, instead of showing the original creator.
```
2017-04-12 09:05:41 -07:00
Kubernetes Submit Queue c7b0ec0178 Merge pull request #42981 from NickrenREN/pv-controller-init
Automatic merge from submit-queue

Exit from NewController() for PersistentVolumeController when InitPlugins() failed

Exit from NewController() for PersistentVolumeController when InitPlugins() failed just like NewAttachDetachController() does

**Release note**:
```release-note
NONE
```
@jsafrane  @saad-ali  PTAL. Thanks in advance
2017-04-12 08:18:50 -07:00
Andy Goldstein ebd22526b1 Reduce replication_controller log spam
Decrease verbosity and reword 'Observed updated replication controller
...' now that the issue it was added for has been fixed.
2017-04-12 10:23:06 -04:00
Andy Goldstein 00e11566f2 Make the dockershim root directory configurable
Make the dockershim root directory configurable so things like
integration tests (e.g. in OpenShift) can run as non-root.
2017-04-12 09:06:21 -04:00
Kubernetes Submit Queue 949440b43a Merge pull request #43698 from sttts/sttts-non-global-admission-plugin-registry
Automatic merge from submit-queue

Non global admission plugin registry

For testing the global state is a problem. This PR turns the actual registry into a struct that must be instantiated. For the beginning, we do this in `pkg/kubeapiserver/admission`. In some follow-up (where we hunt down all globals some day), we will move this into the genericapiserver.
2017-04-12 04:12:11 -07:00
Kubernetes Submit Queue 1ba9202cd8 Merge pull request #42781 from spzala/conversionlint
Automatic merge from submit-queue

Conversionlint

**What this PR does / why we need it**:
This PR adds a comment placeholder for the exported or public functions in conversion generator files. Such functions without a comment results into golint failure in various generated files. The changes in this patch takes care of about 36 related lint failures. 
Given below is an example lint error, 
zz_generated.conversion.go:91:1: exported function Convert_v1alpha1_Binding_To_servicecatalog_Binding should have comment or be unexported

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
Considering minor changes no issue is created. 

**Special notes for your reviewer**:
Hello, I am trying to fix golint failures as we see them in the kubernetes-incubator/service-catalog project. I have separate PRs opened for lint issues related to other generator code which are in separate libraries like gengo. Thanks! 

**Release note**:

```release-note
```
2017-04-12 03:02:26 -07:00
Dr. Stefan Schimanski 63f547e1b1 pkg/admission: make plugin registry non-global 2017-04-12 11:37:25 +02:00
Wojciech Tyczynski af710835fa Remove deprecated code from proxy/config 2017-04-12 11:17:49 +02:00
Wojciech Tyczynski c3e9467b63 Edge-based winuserspace proxy 2017-04-12 11:10:34 +02:00
Kubernetes Submit Queue 284615d79d Merge pull request #43702 from wojtek-t/edge_based_proxy
Automatic merge from submit-queue

Edge-based userspace LB in kube-proxy

@thockin @bowei - if one of you could take a look if that PR doesn't break some basic kube-proxy assumptions. The similar change for winuserproxy should be pretty trivial.

And we should also do that for iptables, but that requires splitting the iptables code to syncProxyRules (which from what I know @thockin already started working on so we should probably wait for it to be done).
2017-04-12 00:30:53 -07:00
Kubernetes Submit Queue abd92fab1e Merge pull request #44296 from caesarxuchao/move-api-helpers.go
Automatic merge from submit-queue

Move api helpers.go to a subpackage

Part of https://github.com/kubernetes/kubernetes/issues/44065.

This PR moves the pkg/api/helpers.go to its own subpackage. It's mostly a mechanic move, except that
* I removed ConversionError in helpers.go, it's not used by anyone
* I moved the 3 methods of Taint and Toleration to pkg/api/methods.go, and left a TODO saying refactoring these methods to functions.

I'll send a few more PRs to make the k8s.io/kubernetes/pkg/api package only contains the code we want in the k8s.io/api repo, then we can run a [script](a0015fd1be (diff-7a2fbb4371972350ee414c6b88aee1c8)) to cut the new repo.
2017-04-11 23:46:04 -07:00
NickrenREN e0ef5bfd40 Exit from NewController() for PersistentVolumeController when InitPlugins() failed just like NewAttachDetachController() does 2017-04-12 13:43:09 +08:00
Kubernetes Submit Queue ceccd305ce Merge pull request #42147 from bowei/ip-alias-2
Automatic merge from submit-queue

Add support for IP aliases for pod IPs (GCP alpha feature)

```release-note
Adds support for allocation of pod IPs via IP aliases.

# Adds KUBE_GCE_ENABLE_IP_ALIASES flag to the cluster up scripts (`kube-{up,down}.sh`).

KUBE_GCE_ENABLE_IP_ALIASES=true will enable allocation of PodCIDR ips
using the ip alias mechanism rather than using routes. This feature is currently
only available on GCE.

## Usage
$ CLUSTER_IP_RANGE=10.100.0.0/16 KUBE_GCE_ENABLE_IP_ALIASES=true bash -x cluster/kube-up.sh

# Adds CloudAllocator to the node CIDR allocator (kubernetes-controller manager).

If CIDRAllocatorType is set to `CloudCIDRAllocator`, then allocation
of CIDR allocation instead is done by the external cloud provider and
the node controller is only responsible for reflecting the allocation
into the node spec.

- Splits off the rangeAllocator from the cidr_allocator.go file.
- Adds cloudCIDRAllocator, which is used when the cloud provider allocates
  the CIDR ranges externally. (GCE support only)
- Updates RBAC permission for node controller to include PATCH
```
2017-04-11 22:09:24 -07:00
FengyunPan 4ba7f7dc9e Record a warning type event
A warning type event should be recorded when failed to calculate
the number of expected pods.
And the same to daemoncontroller when failed to place pod.
2017-04-12 12:03:18 +08:00
Kubernetes Submit Queue e60cc6ee3d Merge pull request #44090 from NickrenREN/remove-alpha-pv
Automatic merge from submit-queue

Remove alphaProvisioner in PVController and AlphaStorageClassAnnotation

remove alpha annotation and alphaProvisioner 

**Release note**:

```release-note
NONE
```
2017-04-11 20:41:40 -07:00
Kubernetes Submit Queue ebf1439d93 Merge pull request #43406 from janetkuo/ds-semantic-equal-update
Automatic merge from submit-queue

Add tests for semantically equal DaemonSet updates

Tests for #43337, depends on #43337. The last commit is already reviewed in #43337. 

@liggitt @kargakis @lukaszo @kubernetes/sig-apps-pr-reviews
2017-04-11 18:25:03 -07:00
Chao Xu 08aa712a6c move helpers.go to helper 2017-04-11 15:49:11 -07:00
Janet Kuo b29135ea8f In 'kubectl describe', find controllers with ControllerRef, instead of showing the original creator 2017-04-11 15:41:57 -07:00
Bowei Du f61590c221 Adds support for PodCIDR allocation from the GCE cloud provider
If CIDRAllocatorType is set to `CloudCIDRAllocator`, then allocation
of CIDR allocation instead is done by the external cloud provider and
the node controller is only responsible for reflecting the allocation
into the node spec.

- Splits off the rangeAllocator from the cidr_allocator.go file.
- Adds cloudCIDRAllocator, which is used when the cloud provider allocates
  the CIDR ranges externally. (GCE support only)
- Updates RBAC permission for node controller to include PATCH
2017-04-11 14:07:54 -07:00
Kubernetes Submit Queue 785299eea5 Merge pull request #43490 from xingzhou/add-testcases
Automatic merge from submit-queue (batch tested with PRs 43304, 41427, 43490, 44352)

Supplement unit tests to `kubectl create rolebinding` command.

Supplement unit tests to `kubectl create rolebinding` command,
including:
1. Unit tests for pkg/kubectl/role.go
2. Unit tests for pkg/kubectl/cmd/create_role.go
2017-04-11 13:46:16 -07:00
Kubernetes Submit Queue c17f0f60f9 Merge pull request #41427 from timothysc/etcd_3_1_godep
Automatic merge from submit-queue (batch tested with PRs 43304, 41427, 43490, 44352)

Update etcd-client godep to 3.1.5

This transitively level sets the godeps to yank in the 3.1.5 client.  

Currently WIP, b/c it required some regen and I had some weird local permissions issue. 

xref: #41143

/cc @xiang90 @mml
2017-04-11 13:46:15 -07:00
Sahdev P. Zala 08639023d0 Conversion generated code changes for golint fix
The exported or public functions requires a doc comment to pass golint.
This commit has changes of conversion generated code. The actual doc
changes are added into a separate commit for a clean review.
2017-04-11 15:34:51 -04:00
Kubernetes Submit Queue 67f2a7cc00 Merge pull request #43888 from liggitt/unsecured-port-user
Automatic merge from submit-queue (batch tested with PRs 43545, 44293, 44221, 43888)

Avoid nil user special-casing in unsecured endpoint

The unsecured handler currently adds no `user.Info` to the request context.  That means that anything that tries to authorize actions in the API server currently has to special case nil users to ensure the unsecured localhost endpoint remains capable of performing all actions. 

This PR changes the unsecured localhost endpoint to be treated as a privileged user internally, so that no special casing is required by code inside the authentication layer

I'm not particularly attached to the username. It doesn't bother me for it to have a slightly uncomfortable sounding name.
2017-04-11 12:18:24 -07:00
Kubernetes Submit Queue 867159416f Merge pull request #44293 from deads2k/api-08-unstructureditems
Automatic merge from submit-queue (batch tested with PRs 43545, 44293, 44221, 43888)

make unstructured items correspond to other items for storage

"normal" `Items` elements include the struct itself, not a pointer to the struct.  Some of the deeper bits of storage rely on this behavior in reflective paths.

This updates the `UnstructuredList` to be "normal".

@kubernetes/sig-api-machinery-pr-reviews
2017-04-11 12:18:20 -07:00
Kubernetes Submit Queue 6283077fb5 Merge pull request #43545 from luomiao/vsphere-remove-loginInfo-on-workers-update
Automatic merge from submit-queue (batch tested with PRs 43545, 44293, 44221, 43888)

Remove credentials on worker nodes for vSphere cloud provider.

**What this PR does / why we need it**:
Remove the dependency of login information on worker nodes for vsphere cloud provider:
1. VM Name is required to be set in the cloud provider configuration file.
2. Remove the requirement of login for Instance functions when querying local node information.

**Which issue this PR fixes** : fixes #https://github.com/kubernetes/kubernetes/issues/35339

**Release note**:
2017-04-11 12:18:17 -07:00
Jacob Simpson e7666648bf Fix the certificate rotation threshold and add jitter. 2017-04-11 09:20:16 -07:00
David Ashpole 9f7e09ddfe eviction age metrics 2017-04-11 09:07:16 -07:00
Kubernetes Submit Queue 44131a3658 Merge pull request #44324 from shiywang/fix-subresource
Automatic merge from submit-queue (batch tested with PRs 43900, 44152, 44324)

make deployment unit tests need to respect subresources

Fixes #42569
I check all the unit test code related to `Matches` method, seems there's only one line we could change to not break previous testing logic
@kargakis ptal, thanks

/assign @kargakis
2017-04-11 07:57:20 -07:00
Kubernetes Submit Queue da1fe12133 Merge pull request #43900 from CaoShuFeng/cani-quiet
Automatic merge from submit-queue (batch tested with PRs 43900, 44152, 44324)

fix return value of "kubectl auth cani --quiet"

Before this change:
$ kubectl auth can-i get pod
no
$ kubectl auth can-i get pod --quiet
$ echo $?
0

After this change:
$ kubectl auth can-i get pod
no
$ kubectl auth can-i get pod --quiet
$ echo $?
1

@deads2k 

**Release note**:

```NONE
```
2017-04-11 07:57:13 -07:00
Timothy St. Clair 818dd4443d Update generated due to proto-shift 2017-04-11 08:48:59 -05:00
Kubernetes Submit Queue 1c34102d5b Merge pull request #43844 from weiwei04/master
Automatic merge from submit-queue

add Stringer interface for eventType

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

fix invalid log outputs like 

"graph_builder.go:429] GraphBuilder process object: v1/Endpoints, namespace kube-system, name kube-controller-manager, event type %!s(garbagecollector.eventType=1)"
2017-04-11 06:22:56 -07:00
deads2k 706823aaa8 make unstructured items correspond to other items for storage 2017-04-11 08:44:16 -04:00
Tim Hockin 0022639a2f Zero-out healthchecks when no endpoints 2017-04-10 21:43:33 -07:00
Kubernetes Submit Queue 859b97b551 Merge pull request #44170 from danwinship/networkpolicy-docs
Automatic merge from submit-queue (batch tested with PRs 43887, 41914, 44170)

Make NetworkPolicy docs reflect reality

spinoff of #39164; this just updates the docs to reflect the way the v1beta1 API has actually been implemented

**Release note**:
```release-note
NONE
```
2017-04-10 19:46:16 -07:00
Wei Wei 3329446c0e add Stringer interface for eventType 2017-04-11 10:36:52 +08:00
Kubernetes Submit Queue f77a40bc81 Merge pull request #43887 from dcbw/proxy-precompute-servicenamestring
Automatic merge from submit-queue

proxy/iptables: precompute svcPortName strings

With many services, the calls to svcPortName.String() show up as a
somewhat significant CPU user under syncProxyRules().

For whatever reason github repeatedly fails to upload the pprof with Firefox, so here's an example:

http://people.redhat.com/dcbw/kube-proxy-svcPortName-String.pdf
2017-04-10 19:28:52 -07:00
Kubernetes Submit Queue 9f58ffe9ad Merge pull request #44286 from shashidharatd/leader-election
Automatic merge from submit-queue (batch tested with PRs 44286, 44209)

Refactor leader election package test code to remove redundant code

**What this PR does / why we need it**:
leader election object supports locking on 2 objects currently endpoints and configmap. The test code for both is almost identical. This pr attempts to remove redundancy in test code for easier maintenance and extension.

**Special notes for your reviewer**:
I am trying to add leader election feature to federation controller manager and this pr is one of sub-task of the overall work documented in #44283

**Release note**:
```
NONE
```
2017-04-10 17:54:12 -07:00
Kubernetes Submit Queue d4eaf0b680 Merge pull request #44281 from deads2k/server-15-objectmetafor
Automatic merge from submit-queue (batch tested with PRs 43273, 44287, 44281)

Remove ObjectMetaFor

Builds on https://github.com/kubernetes/kubernetes/pull/43767

The second commit removes `ObjectMetaFor`.  This was debt we left around after we created the interfaces.  Fixing this makes it possible to start running `Unstructured` through generic storage.

@kubernetes/sig-api-machinery-pr-reviews @smarterclayton @lavalamp
2017-04-10 16:19:14 -07:00
shashidharatd 45b3f6a167 Refactor leader election test code to remove redundant code 2017-04-11 03:45:36 +05:30
Kubernetes Submit Queue 5962b849f1 Merge pull request #43866 from kerneltime/patch-1
Automatic merge from submit-queue

Update owners to include kerneltime

**What this PR does / why we need it**: Update owners to include kerneltime to help with PRs
2017-04-10 13:40:35 -07:00
Kubernetes Submit Queue d2e4f54791 Merge pull request #30302 from aveshagarwal/master-project-node-selector-taints-tolerations
Automatic merge from submit-queue (batch tested with PRs 43870, 30302, 42722, 43736)

Admission plugin to merge pod and namespace tolerations for restricting pod placement on nodes

```release-note
This admission plugin checks for tolerations on the pod being admitted and its namespace, and verifies if there is any conflict. If there is no conflict, then it merges the pod's namespace tolerations with the the pod's tolerations and it verifies them against its namespace' whitelist of tolerations and returns. If a namespace does not have its default or whitelist tolerations specified, then cluster level default and whitelist is used. An example of its versioned config:

apiVersion: apiserver.k8s.io/v1alpha1
kind: AdmissionConfiguration
plugins:
- name: "PodTolerationRestriction"
  configuration:
    apiVersion: podtolerationrestriction.admission.k8s.io/v1alpha1
    kind: Configuration
    default:
     - Key: key1
       Value: value1
     - Key: key2
       Value: value2
    whitelist:
    - Key: key1
      Value: value1
    - Key: key2
      Value: value2
```
2017-04-10 13:33:13 -07:00
deads2k 04460c8750 remove objectmetafor 2017-04-10 15:13:35 -04:00
Bowei Du f5be63e0f7 Add PodCIDRs API for GCE (Google cloud alpha feature) 2017-04-10 12:05:02 -07:00
Dan Williams 70e53ace17 proxy/iptables: precompute svcPortName strings
With many services, the calls to svcPortName.String() show up as a
somewhat significant CPU user under syncProxyRules().
2017-04-10 12:49:06 -05:00
shiywang b3f48f736f make deployment unit tests need to respect subresources 2017-04-11 01:24:44 +08:00
Kubernetes Submit Queue 2899f47bc8 Merge pull request #44137 from k82cn/k8s_44135
Automatic merge from submit-queue (batch tested with PRs 41758, 44137)

Removed hostname/subdomain annotation.

fixes #44135

```release-note
Remove `pod.beta.kubernetes.io/hostname` and `pod.beta.kubernetes.io/subdomain` annotations. 
Users should use `pod.spec.hostname` and `pod.spec.subdomain` instead.
```
2017-04-10 10:06:15 -07:00
Kubernetes Submit Queue a9b0aaa66e Merge pull request #43377 from deads2k/server-09-logging
Automatic merge from submit-queue

only log stacks on server errors

Stack traces on http logging statements can be useful, but you  usually only need them for server errors not for things like redirects or even client errors since the server won't be fixing those.

This tightens the "log stack" behavior to only happen for server errors.  Messages will still be logged, but the automatic stacks will only come out for server errors.

@enj @mfojtik @smarterclayton
@kubernetes/sig-api-machinery-misc
2017-04-10 07:53:09 -07:00
Kubernetes Submit Queue 3f941ac16c Merge pull request #41995 from roidelapluie/41990-a
Automatic merge from submit-queue

Improvements to mustrunas_test.go

refs #41990

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-04-10 07:28:51 -07:00
Dan Winship 11471e965d Regenerate files 2017-04-10 09:00:48 -04:00
Kubernetes Submit Queue 50b104b8e2 Merge pull request #42313 from timchenxiaoyu/completelytypo
Automatic merge from submit-queue

fix completely typo
2017-04-10 05:57:06 -07:00
Dan Winship 1940941dbb Update NetworkPolicy comments to reflect reality.
NetworkPolicy has been implemented with no distinction between nil and
empty Ports/From, and we don't intend to change that now.
2017-04-10 08:40:36 -04:00
Kubernetes Submit Queue 3572e5ca86 Merge pull request #43679 from xingzhou/kube-42121
Automatic merge from submit-queue

Improve event msg for PV controller when using external provisioner

Improve event msg for PV controller when using external provisioner

**Which issue this PR fixes** *:
Fixed part of #42121

**Special notes for your reviewer**:
@jsafrane, as many of our users are confused by the original message, can we fix the message first and then consider how to control the count of the events?
2017-04-10 05:07:52 -07:00
Maciej Szulik 6e9658ab55 Generated changes for defaults updates 2017-04-10 14:02:11 +02:00
deads2k b73cddb227 only log stacks on server errors 2017-04-10 07:57:43 -04:00
Maciej Szulik 70b8df6742 Add default information to CronJobSpec 2017-04-10 13:31:12 +02:00
Wojciech Tyczynski b1475565e6 Edge-based iptables proxy 2017-04-10 13:12:45 +02:00
Wojciech Tyczynski c5cbdbe3d2 Edge-based userspace proxy 2017-04-10 11:59:21 +02:00
Wojciech Tyczynski f7c06ad23c Support endpoints event handlers in kube-proxy 2017-04-10 11:59:21 +02:00
NickrenREN fa7bd44966 Remove alphaProvisioner in PVController and AlphaStorageClassAnnotation 2017-04-10 17:09:40 +08:00
Kubernetes Submit Queue 94836a52f7 Merge pull request #44019 from thockin/proxy-defer-on-update-events-2
Automatic merge from submit-queue (batch tested with PRs 44019, 42225)

Move On*Update handling into sync funcion
2017-04-10 00:49:12 -07:00
Kubernetes Submit Queue 97857e8390 Merge pull request #41687 from aliscott/fix_overwriting_err
Automatic merge from submit-queue

Fix original error being overwritten before returned
2017-04-09 23:16:32 -07:00
Klaus Ma c2b629ee2a Removed hostname/subdomain annotation. 2017-04-10 13:55:40 +08:00
Kubernetes Submit Queue 357af07718 Merge pull request #44197 from Random-Liu/dockershim-only-mode
Automatic merge from submit-queue

Add dockershim only mode

This PR added a `experimental-dockershim` hidden flag in kubelet to run dockershim only.

We introduce this flag mainly for cri validation test. In the future we should compile dockershim into another binary.

@yujuhong @feiskyer @xlgao-zju 
/cc @kubernetes/sig-node-pr-reviews
2017-04-09 19:27:51 -07:00
Kubernetes Submit Queue 6e3bd081d5 Merge pull request #43892 from bsalamat/sched_conf1
Automatic merge from submit-queue

Scheduler can recieve its policy configuration from a ConfigMap

**What this PR does / why we need it**: This PR adds the ability to scheduler to receive its policy configuration from a ConfigMap. Before this, scheduler could receive its policy config only from a file. The logic to watch the ConfigMap object will be added in a subsequent PR.

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

```Add the ability to the default scheduler to receive its policy configuration from a ConfigMap object.
```
2017-04-08 23:19:43 -07:00
Kazuki Suda 2b1078e61e Support completion for --cluster and --user
With this commit, kubectl is supported completion for `--cluster` and `--user`.

```
$ kubectl --user=<tab>
--user=minikube  --user=user01

$ kubectl --cluster=<tab>
--cluster=cluster01  --cluster=minikube
```
2017-04-09 15:11:21 +09:00
Kubernetes Submit Queue 41e9b80e5f Merge pull request #44235 from kubermatic/feature/configurable-aws-subnetid-routetableid
Automatic merge from submit-queue

Specify subnetid and routetableid via cloud provider config

**What this PR does / why we need it**:
This is a fix for https://github.com/kubernetes/kubernetes/pull/39996 which is needed since 1.6

Changes introduced from 1.6 broke partially(LoadBalancer) the support for running the master components in a different environment (different aws account/on premise). This PR will add support for specifying the Subnet & RouteTable to use via the cloud provider config.

**Release note**:

```release-note
AWS cloud provider: fix support running the master with a different AWS account or even on a different cloud provider than the nodes.
```
2017-04-08 11:19:21 -07:00
Kubernetes Submit Queue 97f9b717d3 Merge pull request #44199 from supereagle/update-docker-version-parser
Automatic merge from submit-queue

update docker version parser for its new versioning scheme

**What this PR does / why we need it**:
Docker has change its release strategy and versioning scheme from [v17.03.0-ce-rc1](https://github.com/docker/docker/releases/tag/v17.03.0-ce-rc1). We need to update the version verify condition to satisfy the new docker versions.

**Which issue this PR fixes** : fixes #44140

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-04-08 06:02:19 -07:00
Henrik Schmidt 1c1f02fde3 Specify subnetid and routetableid via cloud provider config 2017-04-08 11:44:45 +02:00
Kubernetes Submit Queue 67029858ae Merge pull request #40160 from wlan0/credentialprovider
Automatic merge from submit-queue

add rancher credential provider

This adds rancher as a credential provider in kubernetes.

@erictune This might be a good opportunity to discuss adding a provision for people to have their own credential providers that is similar to the new cloud provider changes (https://github.com/kubernetes/community/pull/128). WDYT?

```
release-note
Added Rancher Credential Provider to use Rancher Registry credentials when running in a Rancher cluster
```
2017-04-07 22:12:18 -07:00
Tim Hockin 9bfb88d2d7 Fix a couple nits from previous reviews. 2017-04-07 20:47:11 -07:00
Tim Hockin c716886215 Put service/endpoint sync into syncProxyRules
After this, syncProxyRules() can reliably be called in any context to do
the right thing.  Now it cn be made async.
2017-04-07 20:47:00 -07:00
Kubernetes Submit Queue d043e20feb Merge pull request #44121 from mbohlool/patch
Automatic merge from submit-queue (batch tested with PRs 43777, 44121)

Add patchMergeKey and patchStrategy  support to OpenAPI

Support generating Open API extensions for strategic merge patch tags in go struct tags
Support `patchStrategy` and `patchMergeKey`.
Also support checking if the Open API extension and struct tags match.

```release-note
Support generating Open API extensions for strategic merge patch tags in go struct tags
```

cc: @pwittrock @ymqytw 

(Description mostly copied from #43833)
2017-04-07 20:01:10 -07:00
Kubernetes Submit Queue 9c9326114c Merge pull request #43777 from wlan0/provider-id
Automatic merge from submit-queue

move ProvideID indexed methods to right location

@bowei
2017-04-07 19:57:48 -07:00
Kubernetes Submit Queue d8fbff35cd Merge pull request #44223 from caesarxuchao/gather-constants
Automatic merge from submit-queue

move constants to their own file

A step towards #44065

These constants are part of the API and will be moved to k8s.io/api. The helper functions are not and will remain in the main repo. This PR separates them to different files. Next step is put all the helper functions into sub-packages, so that the package `k8s.io/kubernetes/pkg/api` only contains code we want to move to k8s.io/api.

I added the retest-not-required label because this just moves code to another file in the same package.
2017-04-07 18:28:20 -07:00
Kubernetes Submit Queue 00743a4f2b Merge pull request #42629 from NickrenREN/pv-index
Automatic merge from submit-queue (batch tested with PRs 41775, 39678, 42629, 42524, 43028)

matchPredicate does not fit findByClaim()

matchPredicate has two args which are type of PV,and is not used in function findByClaim(),remove it


**Release note**:
```release-note
NONE
```
2017-04-07 17:44:16 -07:00
Kubernetes Submit Queue c8f90171e4 Merge pull request #39678 from resouer/extract-resource
Automatic merge from submit-queue (batch tested with PRs 41775, 39678, 42629, 42524, 43028)

Extract resources functions belongs to api/util

Address: extract kubelet resources functions belongs to `pkg/api/v1/resource_helpers.go`
2017-04-07 17:44:14 -07:00
Kubernetes Submit Queue 7d4fe5f3cd Merge pull request #41775 from CaoShuFeng/username_password_401_403
Automatic merge from submit-queue

Ensure invalid username/password returns 401 error, not 403

If a user attempts to use basic auth, and the username/password combination
is rejected, the authenticator should return an error. This distinguishes
requests that did not provide username/passwrod (and are unauthenticated
without error) from ones that attempted to, and failed.

Related to:
https://github.com/kubernetes/kubernetes/pull/39408
2017-04-07 17:35:42 -07:00