Commit Graph

19134 Commits (3695e85b345858f919a294c2a3c2e95ee5be5341)

Author SHA1 Message Date
Joe Beda 22d6b868e3
Introduces BootstrapSigner controller 2017-02-10 12:47:25 -08:00
Joe Beda 20e1f8ea9b
Creates constants for bootstrap tokens.
Move these form core API to a separate package (pkg/bootstrap/api).

This also creates the constant for the new kube-public namespace.
2017-02-10 12:47:25 -08:00
Kubernetes Submit Queue 03bde62666 Merge pull request #41214 from ncdc/shared-informers-06-hpa
Automatic merge from submit-queue (batch tested with PRs 41248, 41214)

Switch hpa controller to shared informer

**What this PR does / why we need it**: switch the hpa controller to use a shared informer

**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**: Only the last commit is relevant. The others are from #40759, #41114, #41148  

**Release note**:

```release-note
```

cc @smarterclayton @deads2k @sttts @liggitt @DirectXMan12 @timothysc @kubernetes/sig-scalability-pr-reviews @jszczepkowski @mwielgus @piosz
2017-02-10 10:03:44 -08:00
Minhan Xia 87fe4dca5e skip iptables sync if no endpoint changes 2017-02-10 10:03:23 -08:00
Michail Kargakis fe137a8123 Remove redundant pod helper 2017-02-10 17:58:59 +01:00
Kubernetes Submit Queue 6ea92b47eb Merge pull request #39998 from DukeXar/cinder_instance_id
Automatic merge from submit-queue (batch tested with PRs 41246, 39998)

Cinder volume attacher: use instanceID instead of NodeID when verifying attachment

**What this PR does / why we need it**: Cinder volume attacher incorrectly uses NodeID instead of openstack instance id, so that reconciliation fails.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-10 07:53:58 -08:00
Kubernetes Submit Queue f02282cfed Merge pull request #41246 from kargakis/more-logging
Automatic merge from submit-queue (batch tested with PRs 41246, 39998)

Add more logs during the progress check

@soltysh this is needed for debugging https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-gci-gke/4460#k8sio-deployment-lack-of-progress-should-be-reported-in-the-deployment-status

Probably the last set of logs I will need for this one. I have opened https://github.com/kubernetes/kubernetes/issues/41187 to reduce the verbosity level before 1.6 ships.
2017-02-10 07:53:49 -08:00
Andy Goldstein d11aa98c29 Switch hpa controller to shared informer 2017-02-10 09:53:41 -05:00
Andy Goldstein 74186d3e06 Switch disruption controller to shared informers 2017-02-10 09:27:54 -05:00
Kubernetes Submit Queue e9de1b0221 Merge pull request #40992 from k82cn/rm_empty_line
Automatic merge from submit-queue (batch tested with PRs 41236, 40992)

Removed unnecessarly empty line.
2017-02-10 05:38:42 -08:00
Michail Kargakis e13c3e481c Add more logs during the progress check 2017-02-10 14:27:07 +01:00
Kubernetes Submit Queue f4baa5860f Merge pull request #41114 from ncdc/shared-informers-04-endpoints
Automatic merge from submit-queue (batch tested with PRs 39418, 41175, 40355, 41114, 32325)

Switch endpoints controller to shared informers

cc @bprashanth @thockin @deads2k @sttts @liggitt @smarterclayton  @kubernetes/sig-scalability-pr-reviews
2017-02-10 04:50:48 -08:00
Kubernetes Submit Queue a7a74b56da Merge pull request #40355 from gmarek/nc-taint-handling
Automatic merge from submit-queue (batch tested with PRs 39418, 41175, 40355, 41114, 32325)

TaintController

```release-note
This PR adds a manager to NodeController that is responsible for removing Pods from Nodes tainted with NoExecute Taints. This feature is beta (as the rest of taints) and enabled by default. It's gated by controller-manager enable-taint-manager flag.
```
2017-02-10 04:50:42 -08:00
Wojciech Tyczynski 449aade4ee Implement runtime.Object <-> map[string]interface{} conversion 2017-02-10 10:53:27 +01:00
Kubernetes Submit Queue f9215e8fb3 Merge pull request #41058 from liggitt/v1-tokenreview
Automatic merge from submit-queue (batch tested with PRs 41112, 41201, 41058, 40650, 40926)

Promote TokenReview to v1

Peer to https://github.com/kubernetes/kubernetes/pull/40709

We have multiple features that depend on this API:

- [webhook authentication](https://kubernetes.io/docs/admin/authentication/#webhook-token-authentication)
- [kubelet delegated authentication](https://kubernetes.io/docs/admin/kubelet-authentication-authorization/#kubelet-authentication)
- add-on API server delegated authentication

The API has been in use since 1.3 in beta status (v1beta1) with negligible changes:
- Added a status field for reporting errors evaluating the token

This PR promotes the existing v1beta1 API to v1 with no changes

Because the API does not persist data (it is a query/response-style API), there are no data migration concerns.

This positions us to promote the features that depend on this API to stable in 1.7

cc @kubernetes/sig-auth-api-reviews @kubernetes/sig-auth-misc

```release-note
The authentication.k8s.io API group was promoted to v1
```
2017-02-10 01:40:44 -08:00
Kubernetes Submit Queue 64f34eb5fa Merge pull request #41201 from deads2k/api-01-round-trip
Automatic merge from submit-queue (batch tested with PRs 41112, 41201, 41058, 40650, 40926)

make round trip testing generic

RoundTrip testing is something associated with a scheme and everyone who writes an API will want to do it.  In the end, we should wire each API group separately in a test scheme and have them all call this general function.  Once `kubeadm` is out of the main scheme, we'll be able to remove the one really ugly hack.

@luxas @sttts @kubernetes/sig-apimachinery-pr-reviews @smarterclayton
2017-02-10 01:40:42 -08:00
Kubernetes Submit Queue 673d061c56 Merge pull request #40838 from kow3ns/ss-fixes
Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210)

StatefulSet hardening

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

This PR contains the following changes to StatefulSet. Only one change effects the semantics of how the controller operates (This is described in #38418), and this change only brings the controller into conformance with its documented behavior.

1. pcb and pcb controller are removed and their functionality is encapsulated in StatefulPodControlInterface. This class modules the design contoller.PodControlInterface and provides an abstraction to clientset.Interface which is useful for testing purposes.
2. IdentityMappers has been removed to clarify what properties of a Pod are mutated by the controller. All mutations are performed in the UpdateStatefulPod method of the StatefulPodControlInterface.
3. The statefulSetIterator and petQueue classes are removed. These classes sorted Pods by CreationTimestamp. This is brittle and not resilient to clock skew. The current control loop, which implements the same logic, is in stateful_set_control.go. The Pods are now sorted and considered by their ordinal indices, as is outlined in the documentation.
4. StatefulSetController now checks to see if the Pods matching a StatefulSet's Selector also match the Name of the StatefulSet. This will make the controller resilient to overlapping, and will be enhanced by the addition of ControllerRefs.
5. The total lines of production code have been reduced, and the total number of unit tests has been increased. All new code has 100% unit coverage giving the module 83% coverage. Tests for StatefulSetController have been added, but it is not practical to achieve greater coverage in unit testing for this code (the e2e tests for StatefulSet cover these areas).
6. Issue #38418 is fixed in that StaefulSet will ensure that all Pods that are predecessors of another Pod are Running and Ready prior to launching a new Pod. This removes the potential for deadlock when a Pod needs to be rescheduled while its predecessor is hung in Pending or Initializing.
7. All reference to pet have been removed from the code and comments.

**Which issue this PR fixes**
 fixes #38418,#36859
**Special notes for your reviewer**:

**Release note**:

```release-note
Fixes issue #38418 which, under circumstance, could cause StatefulSet to deadlock. 
Mediates issue #36859. StatefulSet only acts on Pods whose identity matches the StatefulSet, providing a partial mediation for overlapping controllers.
```
2017-02-10 00:04:49 -08:00
Kubernetes Submit Queue 45d122dd6b Merge pull request #36033 from DirectXMan12/feature/hpa-v2
Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210)

HPA v2 (API Changes)

**Release note**:
```release-note
Introduces an new alpha version of the Horizontal Pod Autoscaler including expanded support for specifying metrics.
```

Implements the API changes for kubernetes/features#117.

This implements #34754, which is the new design for the Horizontal Pod Autoscaler.  It includes improved support for custom metrics (and/or arbitrary metrics) as well as expanded support for resource metrics.  The new HPA object is introduces in the API group "autoscaling/v1alpha1".

Note that the improved custom metric support currently is limited to per pod metrics from Heapster -- attempting to use the new "object metrics" will simply result in an error.  This will change once #34586 is merged and implemented.
2017-02-10 00:04:48 -08:00
Kubernetes Submit Queue 8188c3cca4 Merge pull request #40796 from wojtek-t/use_node_ttl_in_secret_manager
Automatic merge from submit-queue (batch tested with PRs 40796, 40878, 36033, 40838, 41210)

Implement TTL controller and use the ttl annotation attached to node in secret manager

For every secret attached to a pod as volume, Kubelet is trying to refresh it every sync period. Currently Kubelet has a ttl-cache of secrets of its pods and the ttl is set to 1 minute. That means that in large clusters we are targetting (5k nodes, 30pods/node), given that each pod has a secret associated with ServiceAccount from its namespaces, and with large enough number of namespaces (where on each node (almost) every pod is from a different namespace), that resource in ~30 GETs to refresh all secrets every minute from one node, which gives ~2500QPS for GET secrets to apiserver.

Apiserver cannot keep up with it very easily.

Desired solution would be to watch for secret changes, but because of security we don't want a node watching for all secrets, and it is not possible for now to watch only for secrets attached to pods from my node.

So as a temporary solution, we are introducing an annotation that would be a suggestion for kubelet for the TTL of secrets in the cache and a very simple controller that would be setting this annotation based on the cluster size (the large cluster is, the bigger ttl is). 
That workaround mean that only very local changes are needed in Kubelet, we are creating a well separated very simple controller, and once watching "my secrets" will be possible it will be easy to remove it and switch to that. And it will allow us to reach scalability goals.

@dchen1107 @thockin @liggitt
2017-02-10 00:04:44 -08:00
Kubernetes Submit Queue 85b4d2e5cf Merge pull request #36592 from andrewsykim/36273-set-all-node-conditions-unknown-when-node-unreachable
Automatic merge from submit-queue (batch tested with PRs 40917, 41181, 41123, 36592, 41183)

Set all node conditions to Unknown when node is unreachable

**What this PR does / why we need it**:
Sets all node conditions to Unknown when node does not report status/unreachable

**Which issue this PR fixes** 
fixes https://github.com/kubernetes/kubernetes/issues/36273
2017-02-09 23:10:47 -08:00
Robert Roland 53a009302a Fixes #40819
Start looking up the virtual machine by it's UUID in vSphere again. Looking up by IP address is problematic and can either not return a VM entirely, or could return the wrong VM.

Retrieves the VM's UUID in one of two methods - either by a `vm-uuid` entry in the cloud config file on the VM, or via sysfs. The sysfs route requires root access, but restores the previous functionality.

Multiple VMs in a vCenter cluster can share an IP address - for example, if you have multiple VM networks, but they're all isolated and use the same address range. Additionally, flannel network address ranges can overlap.

vSphere seems to have a limitation of reporting no more than 16 interfaces from a virtual machine, so it's possible that the IP address list on a VM is completely untrustworthy anyhow - it can either be empty (because the 16 interfaces it found were veth interfaces with no IP address), or it can report the flannel IP.
2017-02-09 22:55:37 -08:00
Kubernetes Submit Queue 76b39431d3 Merge pull request #41147 from derekwaynecarr/improve-eviction-logs
Automatic merge from submit-queue (batch tested with PRs 41074, 41147, 40854, 41167, 40045)

Add debug logging to eviction manager

**What this PR does / why we need it**:
This PR adds debug logging to eviction manager.

We need it to help users understand when/why eviction manager is/is not making decisions to support information gathering during support.
2017-02-09 17:41:41 -08:00
Andy Goldstein 3b8cc59214 Switch endpoints controller to shared informers 2017-02-09 20:40:42 -05:00
gmarek 004552f8a4 generated 2017-02-10 02:13:45 +01:00
gmarek 2f0e436677 Taint controller - first commit 2017-02-10 02:13:45 +01:00
Kubernetes Submit Queue f5c07157a8 Merge pull request #41092 from yujuhong/cri-docker1_10
Automatic merge from submit-queue (batch tested with PRs 41037, 40118, 40959, 41084, 41092)

CRI node e2e: add tests for docker 1.10
2017-02-09 16:44:44 -08:00
Kubernetes Submit Queue d2ada4bbd3 Merge pull request #41084 from ncdc/shared-informers-03-certs
Automatic merge from submit-queue (batch tested with PRs 41037, 40118, 40959, 41084, 41092)

Switch CSR controller to use shared informer

Switch the CSR controller to use a shared informer. Originally part of #40097 but I'm splitting that up into multiple PRs.

I have added a test to try to ensure we don't mutate the cache. It could use some fleshing out for additional coverage but it gets the initial job done, I think.

cc @mikedanese @deads2k @liggitt @sttts @kubernetes/sig-scalability-pr-reviews
2017-02-09 16:44:43 -08:00
Kubernetes Submit Queue 052f3b9d4c Merge pull request #40118 from vmware/FixdetachVolumeOnNodeOff
Automatic merge from submit-queue (batch tested with PRs 41037, 40118, 40959, 41084, 41092)

Fix for detach volume when node is not present/ powered off

Fixes #33061 
When a vm is reported as no longer present in cloud provider and is deleted by node controller, there are no attempts to detach respective volumes. For example, if a VM is powered off or paused, and pods are migrated to other nodes. In the case of vSphere, the VM cannot be started again because the VM still holds mount points to volumes that are now mounted to other VMs.

In order to re-join this node again, you will have to manually detach these volumes from the powered off vm before starting it.

The current fix will make sure the mount points are deleted when the VM is powered off. Since all the mount points are deleted, the VM can be powered on again.

This is a workaround proposal only. I still don't see the kubernetes issuing a detach request to the vsphere cloud provider which should be the case. (Details in original issue #33061 )

@luomiao @kerneltime @pdhamdhere @jingxu97 @saad-ali
2017-02-09 16:44:40 -08:00
Kubernetes Submit Queue 75887829bc Merge pull request #41136 from deads2k/apiserver-10-example
Automatic merge from submit-queue (batch tested with PRs 41121, 40048, 40502, 41136, 40759)

add k8s.io/sample-apiserver to demonstrate how to build an aggregated API server

builds on https://github.com/kubernetes/kubernetes/pull/41093

This creates a sample API server is a separate staging repo to guarantee no cheating with `k8s.io/kubernetes` dependencies.  The sample is run during integration tests (simple tests on it so far) to ensure that it continues to run.

@sttts @kubernetes/sig-api-machinery-misc ptal
@pwittrock @pmorie @kris-nova an aggregated API server example that will stay up to date.
2017-02-09 14:27:48 -08:00
Kubernetes Submit Queue ce998a9fa7 Merge pull request #40365 from shiywang/attach
Automatic merge from submit-queue (batch tested with PRs 41145, 38771, 41003, 41089, 40365)

Add `kubectl attach` support for multiple types

To address this issue: https://github.com/kubernetes/kubernetes/issues/24857
the new `kubectl attach` will contain three scenarios depend on args:
1. `kubectl attach POD` :   if only one argument provided, we assume it's a pod name
2. `kubectl attach TYPE NAME` : if two arguments provided, we assume first one is resource we [supported](4770162fd3/pkg/kubectl/cmd/util/factory_object_mapping.go (L285)), the second resource's name.
3. `kubectl attach TYPE/NAME` : one argument provided and arg[0] must contain `/`, ditto

Is there any other scenarios I haven't consider in ?

for now the first scenario is compatible with changed before, also `make test` pass  
will write some unit test to test second and third scenario, if you guys think i'm doing the right way.
@pwittrock @kargakis @fabianofranz @ymqytw @AdoHe
2017-02-09 13:34:56 -08:00
Kubernetes Submit Queue 85fd324b62 Merge pull request #41003 from xingzhou/create-rolebinding-bug
Automatic merge from submit-queue (batch tested with PRs 41145, 38771, 41003, 41089, 40365)

Remove useless param from kubectl create rolebinding

The `force` param is not used in
`kubectl create rolebinding` & `kubectl create clusterrolebinding`
commands, removed it.
2017-02-09 13:34:49 -08:00
Kubernetes Submit Queue 5c4cec21c3 Merge pull request #38771 from derekwaynecarr/fix_drain_typo
Automatic merge from submit-queue (batch tested with PRs 41145, 38771, 41003, 41089, 40365)

Fix typo in drain command
2017-02-09 13:34:47 -08:00
Kubernetes Submit Queue 641315f859 Merge pull request #41145 from kargakis/cleanup-test-fix
Automatic merge from submit-queue

Do not cleanup already deleted replica sets and add more logging around it

For https://k8s-gubernator.appspot.com/build/kubernetes-jenkins/logs/ci-kubernetes-e2e-kops-aws/3569

@ncdc will make the output of the test cleaner
2017-02-09 13:34:24 -08:00
Kubernetes Submit Queue 1c33a1cde2 Merge pull request #41164 from janetkuo/controller-approver
Automatic merge from submit-queue

Add janetkuo to approvers for controllers
2017-02-09 11:20:29 -08:00
Kubernetes Submit Queue 310b1e2e2c Merge pull request #41062 from jsafrane/gce-owners
Automatic merge from submit-queue

Add OWNERS file for GCE cloud provider

GCE cloud provider does not have OWNERS file and all PRs need to be approved by owner of pkg/cloudprovider, which is currently only @mikedanese. Adding more options would be helpful to speed up reviews.

Feel free to add/remove some names, this first version is just my qualified guess. It's hard to distinguish generic Kubernetes refactoring from real cloud provider work in git log.

```release-note
NONE
```
2017-02-09 11:20:21 -08:00
David Ashpole b224f83c37 Revert "[Kubelet] Delay deletion of pod from the API server until volumes are deleted" 2017-02-09 08:45:18 -08:00
Kenneth Owens 4d99b4d825 StatefulSet refactoring and semantics fix
1. pcb and pcb controller are removed and their functionality is
encapsulated in StatefulPodControlInterface.
2. IdentityMappers has been removed to clarify what properties of a Pod are
mutated by the controller. All mutations are performed in the
UpdateStatefulPod method of the StatefulPodControlInterface.
3. The statefulSetIterator and petQueue classes are removed. These classes
sorted Pods by CreationTimestamp. This is brittle and not resilient to
clock skew. The current control loop, which implements the same logic,
is in stateful_set_control.go. The Pods are now sorted and considered by
their ordinal indices, as is outlined in the documentation.
4. StatefulSetController now checks to see if the Pods matching a
StatefulSet's Selector also match the Name of the StatefulSet. This will
make the controller resilient to overlapping, and will be enhanced by
the addition of ControllerRefs.
2017-02-09 08:42:28 -08:00
deads2k 0a74353118 make round trip testing generic 2017-02-09 11:42:22 -05:00
Wojciech Tyczynski dcf8a85fdf Add integration test for ttlcontroller. 2017-02-09 14:50:24 +01:00
Wojciech Tyczynski 6c0535a939 Use secret TTL annotation in secret manager 2017-02-09 13:53:32 +01:00
Wojciech Tyczynski 3aebc4c003 Implement ttl controller 2017-02-09 13:53:32 +01:00
Michail Kargakis 97c9e7fe07 Do not cleanup replicasets already marked for deletion 2017-02-09 10:31:25 +01:00
Michail Kargakis ff83eb58eb Add more logs during the cleanup phase of a deployment 2017-02-09 10:31:15 +01:00
tanshanshan 46b1256d34 fix wrong 2017-02-09 12:19:32 +08:00
Janet Kuo 16ce097b04 Add janetkuo to approvers for controllers 2017-02-08 14:37:25 -08:00
Kubernetes Submit Queue 42d8d4ca88 Merge pull request #40948 from freehan/cri-hostport
Automatic merge from submit-queue (batch tested with PRs 40873, 40948, 39580, 41065, 40815)

[CRI] Enable Hostport Feature for Dockershim

Commits:
1. Refactor common hostport util logics and add more tests

2. Add HostportManager which can ADD/DEL hostports instead of a complete sync.

3. Add Interface for retreiving portMappings information of a pod in Network Host interface. 
Implement GetPodPortMappings interface in dockerService. 

4. Teach kubenet to use HostportManager
2017-02-08 14:14:43 -08:00
Derek Carr 0171121486 Add debug logging to eviction manager 2017-02-08 15:01:12 -05:00
Kubernetes Submit Queue 1be74e39fa Merge pull request #41095 from dashpole/deletion_pod_lifecycle
Automatic merge from submit-queue

[Kubelet] Delay deletion of pod from the API server until volumes are deleted

Previous PR that was reverted: #40239.

To summarize the conclusion of the previous PR after reverting:
- The status manager has the most up-to-date status, but the volume manager uses the status from the pod manager, which only is as up-to-date as the API server.
- Because of this, the previous change required an additional round trip between the kubelet and API server.
- When few pods are being added or deleted, this is only a minor issue.  However, when under heavy load, the QPS limit to the API server causes this round trip to take ~60 seconds, which is an unacceptable increase in latency. Take a look at the graphs in #40239 to see the effect of QPS changes on timing.
- To remedy this, the volume manager looks at the status from the status manager, which eliminates the round trip.

cc: @vishh @derekwaynecarr @sjenning @jingxu97 @kubernetes/sig-storage-misc
2017-02-08 10:45:16 -08:00
Yu-Ju Hong f96611ac45 dockershim: set the default cgroup driver 2017-02-08 10:22:19 -08:00
Kubernetes Submit Queue 59f7af1c67 Merge pull request #41138 from deads2k/owners-07-controllers
Automatic merge from submit-queue

add deads2k to approvers for controllers

I've done significant maintenance on these for a while and introduced new patterns like shared informers and rate limited work queues.
2017-02-08 09:49:16 -08:00
Kubernetes Submit Queue 4166c0e4a0 Merge pull request #38683 from bruceauyeung/k8s-branch-fix-possible-nil-error
Automatic merge from submit-queue

avoid repeated length calculation and some other code improvements

**What this PR does / why we need it**:
1. in function `ParsePairs`,  calculating `invalidBuf`'s length over and over again brings performance penalty. a `invalidBufNonEmpty` bool value can fix this.
2. pairArg is not a string template and also there is no other arguments for `fmt.Sprintf`, so i remove `fmt.Sprintf`
3. in function `DumpReaderToFile`, we must check nil error first before defer statement, otherwise there maybe a potential nil error on `f.Close()`
4. add nil checks into `GetWideFlag` function
5. some other minor code improvements for better readability.


Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-02-08 09:49:10 -08:00
Minhan Xia be9eca6b51 teach kubenet to use hostport_manager 2017-02-08 09:35:04 -08:00
Minhan Xia bd05e1af2b add portmapping getter into network host 2017-02-08 09:35:04 -08:00
Minhan Xia 8e7219cbb4 add hostport manager 2017-02-08 09:26:52 -08:00
Minhan Xia aabdaa984f refactor hostport logic 2017-02-08 09:26:52 -08:00
Andy Goldstein e5fc73a4f1 Switch CSR controller to use shared informer 2017-02-08 11:01:34 -05:00
Kubernetes Submit Queue 4ed86f5d46 Merge pull request #41076 from gyliu513/port-forward
Automatic merge from submit-queue

Removed a space in portforward.go.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-08 07:59:10 -08:00
David Ashpole 67cb2704c5 delete volumes before pod deletion 2017-02-08 07:34:49 -08:00
deads2k 390266f9b0 add deads2k to approves for controllers 2017-02-08 10:16:38 -05:00
deads2k a463540d47 remove duplication of RESTOptionsGetter for kube 2017-02-08 09:08:58 -05:00
deads2k 470cb9d2c9 streamline etcd options for aggregated api server 2017-02-08 09:07:47 -05:00
Michail Kargakis 38195704be Add more logs in the progress check path 2017-02-08 13:15:28 +01:00
Kubernetes Submit Queue c6f30d3750 Merge pull request #41105 from Random-Liu/fix-kuberuntime-log
Automatic merge from submit-queue (batch tested with PRs 38796, 40823, 40756, 41083, 41105)

Let ReadLogs return when there is a read error.

Fixes a bug in kuberuntime log.

Today, @yujuhong found that once we cancel `kubectl logs -f` with `Ctrl+C`, kuberuntime will keep complaining:
```
27939 kuberuntime_logs.go:192] Failed with err write tcp 10.240.0.4:10250->10.240.0.2:53913: write: broken pipe when writing log for log file "/var/log/pods/5bb76510-ed71-11e6-ad02-42010af00002/busybox_0.log": &{timestamp:{sec:63622095387 nsec:625309193 loc:0x484c440} stream:stdout log:[84 117 101 32 70 101 98 32 32 55 32 50 48 58 49 54 58 50 55 32 85 84 67 32 50 48 49 55 10]}
```

This is because kuberuntime keeps writing to the connection even though it is already closed. Actually, kuberuntime should return and report error whenever there is a writing error.

Ref the [docker code](3a4ae1f661/pkg/stdcopy/stdcopy.go (L159-L167))

I'm still creating the cluster and verifying this fix. Will post the result here after that.

/cc @yujuhong @kubernetes/sig-node-bugs
2017-02-08 00:49:51 -08:00
Kubernetes Submit Queue 44980eb55c Merge pull request #40756 from vmware/e2eTestsUpdate
Automatic merge from submit-queue (batch tested with PRs 38796, 40823, 40756, 41083, 41105)

e2e tests for vSphere cloud provider

**What this PR does / why we need it**:
This PR contains changes for existing e2e volume provisioning test cases for running on vsphere cloud provider.

**Following is the summary of changes made in  existing e2e test cases**

**Added test/e2e/persistent_volumes-vsphere.go**
- This test verifies deleting a PVC before the pod does not cause pod deletion to fail on PD detach and deleting the PV before the pod does not cause pod deletion to fail on PD detach.

**test/e2e/volume_provisioning.go**
- This test creates a StorageClass and claim with dynamic provisioning and alpha dynamic provisioning annotations and verifies that required volumes are getting created. Test also verifies that created volume is readable and retaining data.
- Added vsphere as supported cloud provider. Also set pluginName to "kubernetes.io/vsphere-volume" for vsphere cloud provider.

**test/e2e/volumes.go**
- Added test spec for vsphere
-  This test creates requested volume, mount it on the pod, write some random content at /opt/0/index.html and verifies file contents are perfect to make sure we don't see the content from previous test runs.
- This test also passes "1234" as fsGroup to mount volume and verifies fsGroup is set correctly.

**added  test/e2e/vsphere_utils.go** 
- Added function verifyVSphereDiskAttached - Verify the persistent disk attached to the node.
- Added function waitForVSphereDiskToDetach - Wait until vsphere vmdk is deteched from the given node or time out after 5 minutes
- Added getVSpherePersistentVolumeSpec - create vsphere volume spec with given VMDK volume path, Reclaim Policy and labels
- Added getVSpherePersistentVolumeClaimSpec - get vsphere persistent volume spec with given selector labels
- createVSphereVolume - function to create vmdk volume

**Following is the summary of new e2e tests added with this PR**

**test/e2e/vsphere_volume_placement.go**
- contains volume placement tests using node label selector
-  Test Back-to-back pod creation/deletion with the same volume source on the same worker node
- Test Back-to-back pod creation/deletion with the same volume source attach/detach to different worker nodes

**test/e2e/pv_reclaimpolicy.go**
- contains tests for PV/PVC - Reclaiming Policy
- Test verifies persistent volume should be deleted when reclaimPolicy on the PV is set to delete and associated claim is deleted
- Test also verified that persistent volume should be retained when reclaimPolicy on the PV is set to retain and associated claim is deleted 

**test/e2e/pvc_label_selector.go** 
- This is function test for Selector-Label Volume Binding Feature.
- Verify volume with the matching label is bounded with the PVC.

Other changes
Updated  pkg/cloudprovider/providers/vsphere/BUILD  and test/e2e/BUILD 


**Which issue this PR fixes** *
fixes # 41087

**Special notes for your reviewer**:
Updated tests were executed on kubernetes v1.4.8 release on vsphere.
Test steps are provided in comments 


@kerneltime @BaluDontu
2017-02-08 00:49:47 -08:00
Kubernetes Submit Queue 79e333afe0 Merge pull request #40823 from liggitt/edit-tests
Automatic merge from submit-queue (batch tested with PRs 38796, 40823, 40756, 41083, 41105)

Add unit tests for interactive edit command

Before updating edit to use unstructured objects and use generic JSON patching, we need better test coverage of the existing paths. This adds unit tests for the interactive edit scenarios. 

This PR adds:
* Simple framework for recording tests for interactive edit:
  * record.go is a tiny test server that records editor and API inputs as test expectations, and editor and API outputs as playback stubs
  * record_editor.sh is a shell script that sends the before/after of an interactive `vi` edit to the test server
  * record_testcase.sh (see README) starts up the test server, sets up a kubeconfig to proxy to the test server, sets EDITOR to invoke record_editor.sh, then opens a shell that lets you use `kubectl edit` normally
* Adds test cases for the following scenarios:
  - [x] no-op edit (open and close without making changes)
  - [x] try to edit a missing object
  - [x] edit single item successfully
  - [x] edit list of items successfully
  - [x] edit a single item, submit with an error, re-edit, submit fixed successfully
  - [x] edit list of items, submit some with errors and some good, re-edit errors, submit fixed
  - [x] edit trying to change immutable things like name/version/kind, ensure preconditions prevent submission
  - [x] edit in "create mode" successfully (`kubectl create -f ... --edit`)
  - [x] edit in "create mode" introducing errors (`kubectl create -f ... --edit`)
* Fixes a bug with edit printing errors to stdout (caught when testing stdout/stderr against expected output)

Follow-ups:
- [ ] clean up edit code path
- [ ] switch edit to use unstructured objects
- [ ] make edit fall back to jsonmerge for objects without registered go structs (TPR, unknown versions of pods, etc)
- [ ] add tests:
  - [ ] edit TPR
  - [ ] edit mix of TPR and known objects
  - [ ] edit known object with extra field from server
  - [ ] edit known object with new version from server
2017-02-08 00:49:46 -08:00
Kubernetes Submit Queue 1b7bdde40b Merge pull request #38796 from chentao1596/kubelet-cni-log
Automatic merge from submit-queue (batch tested with PRs 38796, 40823, 40756, 41083, 41105)

kubelet/network-cni-plugin: modify the log's info

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

  Checking the startup logs of kubelet, i can always find a error like this:
    "E1215 10:19:24.891724    2752 cni.go:163] error updating cni config: No networks found in /etc/cni/net.d"
 
 It will appears, neither i use cni network-plugin or not. 
After analysis codes, i thought it should be a warn log, because it will not produce any actions like as exit or abort, and just ignored when not any valid plugins exit.

 thank you!
2017-02-08 00:49:44 -08:00
shiywang 919cb19706 kubectl attach support for multiple types
hot fix

add unit test and statefulSet

update example

remove package

change to ResourceNames

remove some code

remove strings

add fake testing func for AttachablePodForObject

minor change

add test.obj nil check

update testfile

gofmt

update

add fallthough

revert back
2017-02-08 16:10:55 +08:00
Kubernetes Submit Queue 01c45f7de1 Merge pull request #41085 from deads2k/apiserver-07-move-runtime-config
Automatic merge from submit-queue (batch tested with PRs 41061, 40888, 40664, 41020, 41085)

move --runtime-config to kubeapiserver

`--runtime-config` is only useful if you have a lot of API groups in one server.  If you have a single API group in your server (the vast majority of aggregated API servers), then the flag is unneeded and relatively complex.  This moves it to closer to point of use.

@sttts
2017-02-07 23:06:43 -08:00
Kubernetes Submit Queue 843e6d1cc3 Merge pull request #40770 from apilloud/clientset_interface
Automatic merge from submit-queue (batch tested with PRs 41103, 41042, 41097, 40946, 40770)

Use Clientset interface in KubeletDeps

**What this PR does / why we need it**:
This replaces the Clientset struct with the equivalent interface for the KubeClient injected via KubeletDeps. This is useful for testing and for accessing the Node and Pod status event stream without an API server.

**Special notes for your reviewer**:
Follow up to #4907

**Release note**:

`NONE`
2017-02-07 22:12:39 -08:00
Kubernetes Submit Queue 51b8eb9424 Merge pull request #40946 from yujuhong/docker_sep
Automatic merge from submit-queue (batch tested with PRs 41103, 41042, 41097, 40946, 40770)

dockershim: set security option separators based on the docker version

Also add a version cache to avoid hitting the docker daemon frequently.

This is part of #38164
2017-02-07 22:12:37 -08:00
Kubernetes Submit Queue 3ed7394cb1 Merge pull request #41042 from gnufied/add-gnufied-reviewer-gce-aws-volume
Automatic merge from submit-queue

Add gnufied as reviewer for aws and gce volumes

Adding myself as reviewer for aws and gce volume plugins. I understand the code well enough and have helped with review in those areas already.

cc @childsb @justinsb @saad-ali
2017-02-07 22:12:23 -08:00
Xing Zhou b9c6fb52ab Added unit tests for kubectl create role command.
Added unit tests for kubectl create role command.
2017-02-08 13:30:10 +08:00
Xing Zhou 0a2876d39e Added kubectl create role command.
Added kubectl create role command.
2017-02-08 13:30:03 +08:00
Solly Ross 946ecb549e Update kubectl to work with new HPA objects
This commit updates kubectl to work with the changes to the unversioned
HPA object made to support the HPA v2alpha1 API.
2017-02-07 22:25:28 -05:00
Solly Ross f6c78eb0de Generated Files for autoscaling/v2alpha1
This commit contains all the autogenerated file changes from the commit
introducing the autoscaling/v2alpha1 API group.
2017-02-07 22:25:27 -05:00
Rajat Chopra 440dcd3675 For the auto generated kube api-server service, the service spec re-uses the service port itself. The endpoint is created correctly using public port. Fix the service also because there are some plugin controllers that react to service spec itself. 2017-02-07 20:43:20 -05:00
Guangya Liu 9607edc556 Clean up for some typo.
1) Removed a space in portforward.go.
2) Renamed `lockAquisitionFunc` to `lockAcquisitionFunc` in
controller.go.
3) Fixed typo in predicates.go.
2017-02-08 09:39:03 +08:00
Random-Liu 65190e2a72 Let ReadLogs return when there is a read error. 2017-02-07 15:43:48 -08:00
Solly Ross fe32a09ba4 Add autoscaling/v2alpha1 types to v1 in annotation
This commit adds autoscaling/v2alpha1 types to autoscaling/v1
for use in the alpha annotations which preserve v2alpha1 content
through round-trips.
2017-02-07 17:40:31 -05:00
Solly Ross 86c430b881 Introduce HPA v2 API Objects
This commit introduces the autoscaling/v2alpha1 API group, which
currently contains the first alpha of the new HorizontalPodAutoscaler
object.
2017-02-07 17:20:14 -05:00
Kubernetes Submit Queue 461514fc0a Merge pull request #41073 from gmarek/nc-bug
Automatic merge from submit-queue (batch tested with PRs 41064, 41090, 41068, 41073, 40882)

Fix bug in NC

It was introduced by #40385 cc @ncdc
2017-02-07 13:46:39 -08:00
Kubernetes Submit Queue d408ab0536 Merge pull request #41090 from yujuhong/freeze_dockertools
Automatic merge from submit-queue

Add OWNERS to the dockertools package

We are in the middle of switching to the CRI implementation. It's critical to minimize
the development of dockertools to avoid any more diversion. We should freeze any
non-essential changes to dockertools once CRI becomes the default. This change
adds an OWNERS file with a small group of people to ensure no unintentional changes
go through unnoticed.
2017-02-07 13:46:08 -08:00
Kubernetes Submit Queue 034b831660 Merge pull request #41064 from soltysh/job_owners
Automatic merge from submit-queue

Update owners file for job and cronjob controller

I've just noticed we have outdated OWNERS files for job and cronjob controllers.

@erictune ptal
@kubernetes/sig-contributor-experience-pr-reviews fyi
2017-02-07 13:46:02 -08:00
Balu Dontu 9fe3cf9ec3 Fix for detach volume when node is not present/ powered off 2017-02-07 13:36:36 -08:00
Kubernetes Submit Queue 5034d96bfb Merge pull request #40861 from lucab/to-k8s/bump-test-images
Automatic merge from submit-queue (batch tested with PRs 40345, 38183, 40236, 40861, 40900)

test: bump mounttest and mounttest-users images

This PR bumps two test images to latest versions:
 * mounttest to 0.8
 * mounttest-user to 0.5

It is a followup to https://github.com/kubernetes/kubernetes/pull/40613 and https://github.com/kubernetes/kubernetes/pull/40821.
2017-02-07 11:33:44 -08:00
Kubernetes Submit Queue cc0279fb0d Merge pull request #40236 from mikedanese/cert-csr
Automatic merge from submit-queue (batch tested with PRs 40345, 38183, 40236, 40861, 40900)

refactor approver and signer interfaces to be consisten w.r.t. apiserver interaction

This makes it so that only the controller loop talks to the
API server directly. The signatures for Sign and Approve also
become more consistent, while allowing the Signer to report
conditions (which it wasn't able to do before).
2017-02-07 11:33:43 -08:00
Kubernetes Submit Queue d404e07a72 Merge pull request #38183 from tianshapjq/remove-create-external-load-balancer
Automatic merge from submit-queue (batch tested with PRs 40345, 38183, 40236, 40861, 40900)

remove the create-external-load-balancer flag in cmd/expose.go

**What this PR does / why we need it**:
In cmd/expose.go there is a todo "remove create-external-load-balancer in code on or after Aug 25, 2016.", and now it's been a long time past. So I remove this flag and modify the test cases. 
Please check for this, thanks!

**Release note**:

```
remove the deprecated flag "create-external-load-balancer" and use --type="LoadBalancer" instead.
```
2017-02-07 11:33:41 -08:00
Kubernetes Submit Queue ff40f3ce75 Merge pull request #40345 from brendandburns/i18n3
Automatic merge from submit-queue

Extract a number of short description strings for translation

@fabianofranz 
@kubernetes/sig-cli-pr-reviews 

Follow on for https://github.com/kubernetes/kubernetes/pull/39223
2017-02-07 11:33:26 -08:00
Yu-Ju Hong e66dd63b05 Add OWNERS to the dockertools package 2017-02-07 11:31:37 -08:00
Yu-Ju Hong d8e29e782f dockershim: set security option separators based on the docker version
Also add a version cache to avoid hitting the docker daemon frequently.
2017-02-07 11:06:40 -08:00
deads2k 226af4adc4 move --runtime-config to kubeapiserver 2017-02-07 13:43:13 -05:00
divyenpatel 7b17f91867 updating existing e2e tests and adding new e2e tests for vsphere cloud provider
addressed review comments

Addressed review comment for pv_reclaimpolicy.go to verify content of the volume

addressed 2nd round of review comments

addressed 3rd round of review comments from jeffvance
2017-02-07 10:36:39 -08:00
Kubernetes Submit Queue 8fb2496e10 Merge pull request #36908 from vishh/cc-owner
Automatic merge from submit-queue

Adding approvers for componentconfig
2017-02-07 09:05:06 -08:00
Kubernetes Submit Queue 42973b0523 Merge pull request #40947 from deads2k/apiserver-04-invert
Automatic merge from submit-queue (batch tested with PRs 41023, 41031, 40947)

apiserver command line options lead to config

Logically command line options lead to config, not the other way around.  We're clean enough now we can actually do the inversion.

WIP because I have some test cycles to fix, but this is all the meat.

@kubernetes/sig-api-machinery-misc
2017-02-07 09:04:41 -08:00
Kubernetes Submit Queue 03db7eac03 Merge pull request #41023 from deads2k/apiserver-05-config-move
Automatic merge from submit-queue (batch tested with PRs 41023, 41031, 40947)

move admission read logic to apiserver

Promised followup to https://github.com/kubernetes/kubernetes/pull/40943

@sttts @kubernetes/sig-api-machinery-misc
2017-02-07 09:04:38 -08:00
gmarek c5258149c1 Fix bug in NC 2017-02-07 15:30:00 +01:00
Kubernetes Submit Queue 3f6dd889f3 Merge pull request #40985 from p0lyn0mial/add_shortnames_to_discovery_api
Automatic merge from submit-queue (batch tested with PRs 40980, 40985)

added short names for resources which are exposed during discovery

**What this PR does / why we need it**:
The changes add short names for resources. The short names will be delivered to kubectl during discovery.
2017-02-07 06:21:10 -08:00
Kubernetes Submit Queue 63ae15e012 Merge pull request #40980 from k82cn/fix_39136
Automatic merge from submit-queue (batch tested with PRs 40980, 40985)

Updated NodeRef to clientv1.ObjectReference.

fixes #40979
2017-02-07 06:21:08 -08:00
deads2k 250408ee9c apiserver command line options lead to config 2017-02-07 07:57:11 -05:00
deads2k 58992ce8d2 move admission read logic 2017-02-07 07:44:14 -05:00
Maciej Szulik 0c90065bb1 Update owners file for job and cronjob controller 2017-02-07 11:24:51 +01:00
Jan Safranek d6e9803007 Add OWNERS file for GCE cloud provider 2017-02-07 10:35:14 +01:00
Jordan Liggitt 09b5d7279f
install authentication.k8s.io/v1, add tests 2017-02-07 01:44:56 -05:00
Jordan Liggitt 529ce5d3aa
Generated files for authentication.k8s.io/v1 2017-02-07 01:44:56 -05:00
Brendan Burns d9c4a289a6 Extract strings for translation. 2017-02-06 22:32:01 -08:00
Jordan Liggitt 9adf9225c4
Copy authentication.k8s.io/v1beta1 types to v1 2017-02-07 00:57:14 -05:00
Kubernetes Submit Queue 9dec47dc28 Merge pull request #39369 from CallMeFoxie/validation-hostip
Automatic merge from submit-queue (batch tested with PRs 40971, 41027, 40709, 40903, 39369)

Validate unique  against HostPort/Protocol/HostIP

**What this PR does / why we need it**:
We can bind to specific IPs however validation will fail for different HostIP:HostPort combination. This is a small fix to check combination of HostPort/Protocol/HostIP rather than just HostPort/Protocol.

Sample configuration
...
"ports": [
              {
                "protocol": "TCP",
                "containerPort": 53,
                "hostPort": 55,
                "hostIP": "127.0.0.1",
                "name": "dns-local-tcp"
              },
              {
                "protocol": "TCP",
                "containerPort": 53,
                "hostPort": 55,
                "hostIP": "127.0.0.2",
                "name": "dns-local-tcp2"
              }
]

Before:
* spec.template.spec.containers[1].ports[2].hostPort: Duplicate value: "55/TCP"
* spec.template.spec.containers[1].ports[3].hostPort: Duplicate value: "55/TCP"

After applying the patch:
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:55            0.0.0.0:*               LISTEN      3644/docker-proxy
tcp        0      0 127.0.0.2:55            0.0.0.0:*               LISTEN      3629/docker-proxy

Thanks
Ashley

**Release note**:

```release-note
```
2017-02-06 20:57:18 -08:00
Kubernetes Submit Queue 98f97496ef Merge pull request #40903 from yujuhong/security_opts
Automatic merge from submit-queue (batch tested with PRs 40971, 41027, 40709, 40903, 39369)

Set docker opt separator correctly for SELinux options

This is based on @pmorie's commit from #40179
2017-02-06 20:57:17 -08:00
Kubernetes Submit Queue 460f44347c Merge pull request #40709 from liggitt/v1-sar
Automatic merge from submit-queue (batch tested with PRs 40971, 41027, 40709, 40903, 39369)

Promote SubjectAccessReview to v1

We have multiple features that depend on this API:

SubjectAccessReview
- [webhook authorization](https://kubernetes.io/docs/admin/authorization/#webhook-mode)
- [kubelet delegated authorization](https://kubernetes.io/docs/admin/kubelet-authentication-authorization/#kubelet-authorization)
- add-on API server delegated authorization

The API has been in use since 1.3 in beta status (v1beta1) with negligible changes:
- Added a status field for reporting errors evaluating access
- A typo was discovered in the SubjectAccessReviewSpec Groups field name

This PR promotes the existing v1beta1 API to v1, with the only change being the typo fix to the groups field. (fixes https://github.com/kubernetes/kubernetes/issues/32709)

Because the API does not persist data (it is a query/response-style API), there are no data migration concerns.

This positions us to promote the features that depend on this API to stable in 1.7

cc @kubernetes/sig-auth-api-reviews @kubernetes/sig-auth-misc

```release-note
The authorization.k8s.io API group was promoted to v1
```
2017-02-06 20:57:15 -08:00
Kubernetes Submit Queue 821e171247 Merge pull request #35950 from nikhiljindal/nsdelreuse
Automatic merge from submit-queue

federation: Refactoring namespaced resources deletion code from kube ns controller and sharing it with fed ns controller

Ref https://github.com/kubernetes/kubernetes/issues/33612

Refactoring code in kube namespace controller to delete all resources in a namespace when the namespace is deleted. Refactored this code into a separate NamespacedResourcesDeleter class and calling it from federation namespace controller.
This is required for enabling cascading deletion of namespaced resources in federation apiserver.
Before this PR, we were directly deleting the namespaced resources and assuming that they go away immediately. With cascading deletion, we will have to wait for the corresponding controllers to first delete the resources from underlying clusters and then delete the resource from federation control plane. NamespacedResourcesDeleter has this waiting logic.

cc @kubernetes/sig-federation-misc @caesarxuchao @derekwaynecarr @mwielgus
2017-02-06 18:10:58 -08:00
Kubernetes Submit Queue 2eebe956cc Merge pull request #40996 from NickrenREN/openstack-servername
Automatic merge from submit-queue (batch tested with PRs 40385, 40786, 40999, 41026, 40996)

optimize duplicate openstack serverList judgement

if len(serverList) > 1, we will return err in pager.EachPage() function,so here we do not need to judge again
2017-02-06 16:51:11 -08:00
Kubernetes Submit Queue e0db0932a7 Merge pull request #40999 from xingzhou/tiny-bug
Automatic merge from submit-queue (batch tested with PRs 40385, 40786, 40999, 41026, 40996)

Fixed a tiny bug on using RoleBindingGenerator

Fixed a typo bug while using RoleBindingGenerator, this
bug causes error when binding role to service accounts
through "kubectl create rolebinding" command.
2017-02-06 16:51:08 -08:00
Kubernetes Submit Queue 9abfa6b446 Merge pull request #40385 from ncdc/shared-informers-02-swap-existing
Automatic merge from submit-queue

Replace hand-written informers with generated ones

Replace existing uses of hand-written informers with generated ones.
Follow-up commits will switch the use of one-off informers to shared
informers.

This is a precursor to #40097. That PR will switch one-off informers to shared informers for the majority of the code base (but not quite all of it...).

NOTE: this does create a second set of shared informers in the kube-controller-manager. This will be resolved back down to a single factory once #40097 is reviewed and merged.

There are a couple of places where I expanded the # of caches we wait for in the calls to `WaitForCacheSync` - please pay attention to those. I also added in a commented-out wait in the attach/detach controller. If @kubernetes/sig-storage-pr-reviews is ok with enabling the waiting, I'll do it (I'll just need to tweak an integration test slightly).

@deads2k @sttts @smarterclayton @liggitt @soltysh @timothysc @lavalamp @wojtek-t @gmarek @sjenning @derekwaynecarr @kubernetes/sig-scalability-pr-reviews
2017-02-06 16:25:42 -08:00
Vishnu Kannan fb2d98ac8f adding approvers for componentconfig
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2017-02-06 16:05:53 -08:00
Kubernetes Submit Queue 88673271d2 Merge pull request #41009 from deads2k/owners-06-registry
Automatic merge from submit-queue

add deads2k to registry package owners

I established the package layout and wrote a lot of the non-boilerplate code in this package.
2017-02-06 15:35:06 -08:00
Jordan Liggitt 8706bc9617
install authorization.k8s.io/v1, add tests
Use specific v1beta1 Authorization client

Add client expansions
2017-02-06 18:16:51 -05:00
Jordan Liggitt 31d45fe78f
Generated files 2017-02-06 18:16:51 -05:00
Yu-Ju Hong 05c3b8c1cf Set docker opt separator correctly for SELinux options 2017-02-06 14:47:30 -08:00
Jordan Liggitt ae73f2498f
Fix typo in v1beta1 field name 2017-02-06 17:43:55 -05:00
Jordan Liggitt e4d6c48900
Copy v1beta1 authorization types to v1 2017-02-06 17:43:55 -05:00
p0lyn0mial b2cce0ac8e added short names for resources which are exposed during discovery 2017-02-06 23:35:07 +01:00
Klaus Ma f6aa8bbb8f Updated NodeRef to clientv1.ObjectReference. 2017-02-07 06:27:06 +08:00
Kubernetes Submit Queue d4bcf3ede5 Merge pull request #40951 from yujuhong/fix_cri_portforward
Automatic merge from submit-queue (batch tested with PRs 40930, 40951)

Fix CRI port forwarding

Websocket support was introduced #33684, which broke the CRI
implementation. This change fixes it.
2017-02-06 14:27:05 -08:00
Hemant Kumar 8fad1a6aec Add gnufied as reviewer for aws and gce volumes 2017-02-06 16:38:13 -05:00
Kubernetes Submit Queue 095f4ef624 Merge pull request #40967 from pwittrock/discovery-client
Automatic merge from submit-queue (batch tested with PRs 40943, 40967)

Switch kubectl version and api-versions to create a discovery client …

…directly.

The clientset will throw an error for aggregated apiservers because the
clientset looks for specific versions of apis that are compiled into
the client.  These will be missing from aggregated apiservers.
The discoveryclient is fully dynamic and does not rely on compiled
in apiversions.

```release-note
NONE
```
2017-02-06 12:22:56 -08:00
Kubernetes Submit Queue b87adb21b1 Merge pull request #40943 from deads2k/apiserver-01-admission-types
Automatic merge from submit-queue (batch tested with PRs 40943, 40967)

switch admission serialized config to an apiserver type

Switches the kube admission config from componentconfig to the new `apiserver.k8s.io` group so that all API servers can use the shared configuration.  This switch external serialization, but it does not move the code that reads the config.  I'd like to do that as a follow-on.

@kubernetes/sig-api-machinery-misc @kubernetes/api-reviewers @smarterclayton 
@derekwaynecarr ptal
@sttts
2017-02-06 12:22:54 -08:00
rootfs b36009be7f use instance's Name to attach gce disk
Signed-off-by: rootfs <hchen@redhat.com>
2017-02-06 14:45:41 -05:00
nikhiljindal ca6f821738 Autogenerated bazel changes 2017-02-06 10:50:40 -08:00
nikhiljindal 74676f6995 Updating federation namespace controller to share namespaced resources deletion code with kube namespace controller 2017-02-06 10:50:40 -08:00
nikhiljindal c1c2a12134 Refactorying namespace deletion code to enable reuse with federation namespace controller 2017-02-06 10:50:40 -08:00
Andy Goldstein 70c6087600 Replace hand-written informers with generated ones
Replace existing uses of hand-written informers with generated ones.
 Follow-up commits will switch the use of one-off informers to shared
 informers.
2017-02-06 13:49:27 -05:00
Kubernetes Submit Queue 010559ece6 Merge pull request #39321 from NickrenREN/controller-utils
Automatic merge from submit-queue (batch tested with PRs 39681, 39321, 41018, 40883)

remove never used var
2017-02-06 10:46:56 -08:00
deads2k 75841dc4f1 switch admission serialized config to an apiserver type 2017-02-06 11:38:08 -05:00
Maciej Szulik 19a25e480f Avoid closing over range variables 2017-02-06 16:02:21 +01:00
Kubernetes Submit Queue 6f37347fce Merge pull request #40931 from deads2k/owners-05-liggitt
Automatic merge from submit-queue

add liggitt to apimachinery/apiserver packages

Add @liggitt to apimachinery and apiserver packages.
2017-02-06 06:45:26 -08:00
deads2k 00bcf81943 add deads2k to registry package owners 2017-02-06 07:41:18 -05:00
Humble Chirammal 72f0a5219a Update specs for iscsi volume source.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-06 17:21:33 +05:30
Humble Chirammal 332e26dc8c Add portals field to iscsi volume source to achieve multipathing.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-06 17:06:33 +05:30
Ashley Reese 10117cc815 Validate unique host ports with host IPs as well 2017-02-06 09:28:41 +01:00
Xing Zhou 8db1cfc2f6 Fixed a tiny bug on using RoleBindingGenerator
Fixed a typo bug while using RoleBindingGenerator to bind
role to service accounts.
2017-02-06 16:00:51 +08:00
Xing Zhou 7a4293f6df Remove useless param from kubectl create rolebinding
The `force` param is not used in
`kubectl create rolebinding` & `kubectl create clusterrolebinding`
commands, removed it.
2017-02-06 15:49:43 +08:00
NickrenREN 70ab5fc6b8 optimize duplicate openstack serverList judgement
if len(serverList) > 1, we will return err in pager.EachPage() function,so here we do not need to do the judgement again
2017-02-06 14:30:52 +08:00
Klaus Ma cc26fe6ee9 Removed unnecessarly empty line. 2017-02-06 11:10:34 +08:00
bruceauyeung eac48c2cd5 avoid repeated length calculation and some other code improvements
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-02-06 09:19:46 +08:00
Dr. Stefan Schimanski 1c53f46233 Add custom conversion funcs not directly into pkg/api.Scheme 2017-02-05 15:01:47 +01:00
Phillip Wittrock 9abd275607 Switch kubectl version and api-versions to create a discovery client directly.
The clientset will throw an error for aggregated apiservers because the
clientset looks for specific versions of apis that are compiled into
the client.  These will be missing from aggregated apiservers.
The discoveryclient is fully dynamic and does not rely on compiled
in apiversions.
2017-02-04 08:38:19 -08:00
NickrenREN a62da3e22b record ReduceCPULimits result err info if possible
record ReduceCPULimits result err info if possible
2017-02-04 21:12:39 +08:00
Kubernetes Submit Queue 2541c16692 Merge pull request #40942 from ymqytw/extract_util_from_SMPatch
Automatic merge from submit-queue (batch tested with PRs 40289, 40877, 40879, 39972, 40942)

Extract util used by jsonmergepatch and SMPatch

followup  https://github.com/kubernetes/kubernetes/pull/40666#discussion_r99198931

Extract some util out of the `strategicMergePatch` to make `jsonMergePatch` doesn't depend on `strategicMergePatch`.

```release-note
None
```

cc: @liggitt
2017-02-04 04:43:10 -08:00
Kubernetes Submit Queue a777a8e3ba Merge pull request #39972 from derekwaynecarr/pod-cgroups-default
Automatic merge from submit-queue (batch tested with PRs 40289, 40877, 40879, 39972, 40942)

Rename experimental-cgroups-per-pod flag

**What this PR does / why we need it**:
1. Rename `experimental-cgroups-per-qos` to `cgroups-per-qos`
1. Update hack/local-up-cluster to match `CGROUP_DRIVER` with docker runtime if used.

**Special notes for your reviewer**:
We plan to roll this feature out in the upcoming release.  Previous node e2e runs were running with this feature on by default.  We will default this feature on for all e2es next week.

**Release note**:
```release-note
Rename --experiemental-cgroups-per-qos to --cgroups-per-qos
```
2017-02-04 04:43:08 -08:00
Kubernetes Submit Queue 6adf3e5268 Merge pull request #40877 from yujuhong/rm_mirror_annotation
Automatic merge from submit-queue (batch tested with PRs 40289, 40877, 40879, 39972, 40942)

Remove the temporary fix for pre-1.0 mirror pods

The fix was introduced to fix #15960 for pre-1.0 pods. It should be safe to remove
this fix now.
2017-02-04 04:43:06 -08:00
Kubernetes Submit Queue a2931c6218 Merge pull request #40289 from xilabao/fix-save-config-in-create-subcommand
Automatic merge from submit-queue

fix --save-config in create subcommand

--save-config option doesn't work.
```
#kubectl create rolebinding a --role=b --user=c --save-config  
rolebinding "a" created
```
old output:
```
#kubectl get rolebinding a -o yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
  creationTimestamp: 2017-01-23T10:09:48Z
  name: a
  namespace: default
  resourceVersion: "281"
  selfLink: /apis/rbac.authorization.k8s.io/v1beta1/namespaces/default/rolebindings/a
  uid: 12abccd6-e154-11e6-819c-525400f84377
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: b
subjects:
- apiVersion: rbac/v1alpha1
  kind: User
  name: c
```

expected output:
```
#kubectl get rolebinding a -o yaml
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"kind":"RoleBinding","apiVersion":"rbac.authorization.k8s.io/v1beta1","metadata":{"name":"c","creationTimestamp":null},"subjects":[{"kind":"User","apiVersion":"rbac/v1alpha1","name":"c"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"Role","name":"b"}}
  creationTimestamp: 2017-01-23T10:09:48Z
  name: a
  namespace: default
  resourceVersion: "281"
  selfLink: /apis/rbac.authorization.k8s.io/v1beta1/namespaces/default/rolebindings/a
  uid: 12abccd6-e154-11e6-819c-525400f84377
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: b
subjects:
- apiVersion: rbac/v1alpha1
  kind: User
  name: c
```
2017-02-04 04:40:29 -08:00
Kubernetes Submit Queue 4796c7b409 Merge pull request #40727 from Random-Liu/handle-cri-in-place-upgrade
Automatic merge from submit-queue

CRI: Handle cri in-place upgrade

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

## How does this PR restart/remove legacy containers/sandboxes?
With this PR, dockershim will convert and return legacy containers and infra containers as regular containers/sandboxes. Then we can rely on the SyncPod logic to stop the legacy containers/sandboxes, and the garbage collector to remove the legacy containers/sandboxes.

To forcibly trigger restart:
* For infra containers, we manually set `hostNetwork` to opposite value to trigger a restart (See [here](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/kuberuntime/kuberuntime_manager.go#L389))
* For application containers, they will be restarted with the infra container.
## How does this PR avoid extra overhead when there is no legacy container/sandbox?
For the lack of some labels, listing legacy containers needs extra `docker ps`. We should not introduce constant performance regression for legacy container cleanup. So we added the `legacyCleanupFlag`:
* In `ListContainers` and `ListPodSandbox`, only do extra `ListLegacyContainers` and `ListLegacyPodSandbox` when `legacyCleanupFlag` is `NotDone`.
* When dockershim starts, it will check whether there are legacy containers/sandboxes.
  * If there are none, it will mark `legacyCleanupFlag` as `Done`.
  * If there are any, it will leave `legacyCleanupFlag` as `NotDone`, and start a goroutine periodically check whether legacy cleanup is done.
This makes sure that there is overhead only when there are legacy containers/sandboxes not cleaned up yet.

## Caveats
* In-place upgrade will cause kubelet to restart all running containers.
* RestartNever container will not be restarted.
* Garbage collector sometimes keep the legacy containers for a long time if there aren't too many containers on the node. In that case, dockershim will keep performing extra `docker ps` which introduces overhead.
  * Manually remove all legacy containers will fix this.
  * Should we garbage collect legacy containers/sandboxes in dockershim by ourselves? /cc @yujuhong 
* Host port will not be reclaimed for the lack of checkpoint for legacy sandboxes. https://github.com/kubernetes/kubernetes/pull/39903 /cc @freehan 

/cc @yujuhong @feiskyer @dchen1107 @kubernetes/sig-node-api-reviews 
**Release note**:

```release-note
We should mention the caveats of in-place upgrade in release note.
```
2017-02-03 22:17:56 -08:00
Jordan Liggitt c43192c0c1
Add edit command testcases 2017-02-04 00:11:30 -05:00
Jordan Liggitt 9af0dca52d
Log edit errors to stderr 2017-02-04 00:11:30 -05:00
Jordan Liggitt af3505f53c
Add unit test framework for edit command 2017-02-04 00:11:29 -05:00
Kubernetes Submit Queue 67859efaec Merge pull request #40935 from liggitt/sar-subresource
Automatic merge from submit-queue

Plumb subresource through subjectaccessreview

plumb all fields for subjectaccessreview into the resulting `authorizer.AttributesRecord`

```release-note
The SubjectAccessReview API passes subresource and resource name information to the authorizer to answer authorization queries.
```
2017-02-03 18:13:01 -08:00
Christoph Blecker 89d1b09fdf
Move Private Key parsing to k8s.io/client-go/util/cert 2017-02-03 17:41:34 -08:00
ymqytw aadcd9b5e2 filter lastAppliedConfig annotation for describe secret 2017-02-03 17:17:20 -08:00
Kubernetes Submit Queue f20b4fc67f Merge pull request #40655 from vishh/flag-gate-critical-pod-annotation
Automatic merge from submit-queue

Optionally avoid evicting critical pods in kubelet

For #40573

```release-note
When feature gate "ExperimentalCriticalPodAnnotation" is set, Kubelet will avoid evicting pods in "kube-system" namespace that contains a special annotation - `scheduler.alpha.kubernetes.io/critical-pod`
This feature should be used in conjunction with the rescheduler to guarantee availability for critical system pods - https://kubernetes.io/docs/admin/rescheduler/
```
2017-02-03 16:22:26 -08:00
Yu-Ju Hong bb0eb3c33e Fix CRI port forwarding
Websocket support was introduced #33684, which broke the CRI
implementation. This change fixes it.
2017-02-03 15:29:49 -08:00
ymqytw a910284e17 extract util used by jsonmergepatch and SMPatch 2017-02-03 15:28:42 -08:00
Kubernetes Submit Queue 9642104e82 Merge pull request #39914 from kevin-wangzefeng/forgiveness-library-changes
Automatic merge from submit-queue (batch tested with PRs 40696, 39914, 40374)

Forgiveness library changes

**What this PR does / why we need it**:
Splited from #34825, contains library changes that are needed to implement forgiveness:

1. ~~make taints-tolerations matching respect timestamps, so that one toleration can just tolerate a taint for only a period of time.~~ As TaintManager is caching taints and observing taint changes, time-based checking is now outside the library (in TaintManager). see #40355.
2. make tolerations respect wildcard key.
3. add/refresh some related functions to wrap taints-tolerations operation.

**Which issue this PR fixes**: 
Related issue: #1574
Related PR: #34825, #39469 
~~Please note that the first 2 commits in this PR come from #39469 .~~

**Special notes for your reviewer**:

~~Since currently we have `pkg/api/helpers.go` and `pkg/api/v1/helpers.go`, there are some duplicated periods of code laying in these two files.~~

~~Ideally we should move taints-tolerations related functions into a separate package (pkg/util/taints), and make it a unified set of implementations. But I'd just suggest to do it in a follow-up PR after Forgiveness ones done, in case of feature Forgiveness getting blocked to long.~~

**Release note**:

```release-note
make tolerations respect wildcard key
```
2017-02-03 15:05:55 -08:00
Derek Carr d5aa35e330 Add generated artifacts 2017-02-03 17:19:53 -05:00
Derek Carr 04a909a257 Rename cgroups-per-qos flag to not be experimental 2017-02-03 17:10:53 -05:00
Jordan Liggitt 3a89d33306
Plumb subresource through subjectaccessreview 2017-02-03 16:07:55 -05:00
deads2k 0a536544b4 add liggitt to apimachinery/apiserver packages 2017-02-03 12:24:22 -05:00
Kubernetes Submit Queue ab794c6128 Merge pull request #40918 from k82cn/pv_ctrl_typo
Automatic merge from submit-queue

Fixed typo in pv_controller.go

fixes #40916
2017-02-03 07:37:25 -08:00
Andrew Pilloud 3f8505022c Use clientset.Interface for KubeClient 2017-02-03 07:36:16 -08:00
Klaus Ma ef5f838c23 Fixed typo in pv_controller.go 2017-02-03 20:55:15 +08:00
Kubernetes Submit Queue 2bb1e75815 Merge pull request #40863 from kubernetes/sttts-big-genericapiserver-move
Automatic merge from submit-queue (batch tested with PRs 40795, 40863)

Move pkg/genericapiserver and pkg/storage to k8s.io/apiserver

approved based on #40363

These must merge first:
- [x] genericvalidation https://github.com/kubernetes/kubernetes/pull/40810
- [x] openapi https://github.com/kubernetes/kubernetes/pull/40829
- [x] episode 7 https://github.com/kubernetes/kubernetes/pull/40853
2017-02-03 03:48:50 -08:00
Kubernetes Submit Queue 0dcc04d698 Merge pull request #40795 from wojtek-t/use_caching_manager
Automatic merge from submit-queue (batch tested with PRs 40795, 40863)

Use caching secret manager in kubelet

I just found that this is in my local branch I'm using for testing, but not in master :)
2017-02-03 03:48:48 -08:00
tanshanshan bd0ebc9dba add unit test for groupversion 2017-02-03 17:37:42 +08:00
Dr. Stefan Schimanski 6af3210d6f Update generated files 2017-02-03 08:15:46 +01:00
Dr. Stefan Schimanski 536460e1d9 Mechanical fixup imports: pkg/genericapiserver 2017-02-03 08:15:45 +01:00
Dr. Stefan Schimanski 03beed51d6 Mechanical move: pkg/genericapiserver -> k8s.io/apiserver 2017-02-03 07:33:43 +01:00
Dr. Stefan Schimanski 80b96b441b Mechanical import fixup: pkg/storage 2017-02-03 07:33:43 +01:00
Dr. Stefan Schimanski abe993a808 Mechanical move: pkg/storage -> k8s.io/apiserver 2017-02-03 07:33:43 +01:00
Kubernetes Submit Queue 8b795e2396 Merge pull request #38382 from hodovska/init-containers-to-ga
Automatic merge from submit-queue (batch tested with PRs 40864, 40666, 38382, 40874)

Promote init containers to GA

This is proposed for 1.6
PR moves beta proved concept for init containers to stable. Specification of init containers can be now stated under initContainers field in PodSpec/PodTemplateSpec. Specifying init-containers in annotation is still possible, but will be removed in future version.

```release-note
Init containers have graduated to GA and now appear as a field.  The beta annotation value will still be respected and overrides the field value.
```
2017-02-02 21:04:50 -08:00
Kubernetes Submit Queue 99def0d9f9 Merge pull request #40666 from ymqytw/support_generic_merge_patch
Automatic merge from submit-queue (batch tested with PRs 40864, 40666, 38382, 40874)

apply falls back to generic JSON patch computation if no go struct is registered for the target GVK

This PR is the master version of #40096 which is target 1.4 branch.
This PR is based on #40260 

- [x] ensure subkey deletion works in CreateThreeWayJSONMergePatch
- [x] ensure type stomping works in CreateThreeWayJSONMergePatch
- [x] lots of tests for generic json patch computation
- [x] apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK
  - [x] prevent generic apply patch computation between different apiVersions and/or kinds
  - [x] make pruner generic (apply --prune works with TPR)

```release-note
apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK
```
2017-02-02 21:04:49 -08:00
tianshapjq 8057170588 gofmt the service_test.go 2017-02-03 08:55:41 +08:00
Dominika Hodovska adf7cf1934 Init containers in GA - generated code 2017-02-03 01:08:25 +01:00
Random-Liu b9cf8ebe77 Update bazel. 2017-02-02 15:36:24 -08:00
Random-Liu 626680d289 Add unit test for legacy container cleanup 2017-02-02 15:36:24 -08:00
Random-Liu 14940edaad Add legacy container cleanup 2017-02-02 15:36:24 -08:00
Dominika Hodovska a856188b96 Show InitContainers and InitContainerStatus in PodSpec 2017-02-03 00:25:47 +01:00
ymqytw ad7ffd79c3 apply falls back to generic 3-way JSON merge patch if no go struct is registered for the target GVK 2017-02-02 15:19:50 -08:00
Kubernetes Submit Queue c84f3abca1 Merge pull request #40571 from jcbsmpsn/close-watch
Automatic merge from submit-queue

Release API watch resources when done.
2017-02-02 14:10:10 -08:00
Luca Bruno 85b1def175
test: update to use mounttest:0.8 and mounttest-user:0.5 2017-02-02 20:41:18 +00:00
Wojciech Tyczynski 6f3acb801d Fix bug in secret manager. 2017-02-02 21:39:26 +01:00
Vishnu kannan 77a88f7e8b update critical pod annotation flag gate to mention that BestEffort pods are not supported
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-02-02 11:32:23 -08:00
Vishnu Kannan c967ab7b99 Avoid evicting critical pods in Kubelet if a special feature gate is enabled
Signed-off-by: Vishnu Kannan <vishnuk@google.com>
2017-02-02 11:32:20 -08:00
Mike Danese e34351f715 refactor approver and signer interfaces to be consisten w.r.t. apiserver interaction
This makes it so that only the controller loop talks to the
API server directly. The signatures for Sign and Approve also
become more consistent, while allowing the Signer to report
conditions (which it wasn't able to do before).
2017-02-02 11:23:52 -08:00
Vishnu Kannan 6ddb528446 Revert "Sort critical pods before admission"
This reverts commit b7409e0038.
2017-02-02 10:41:24 -08:00
Vishnu Kannan ffd7dda234 Revert "Kubelet admits critical pods even under memory pressure"
This reverts commit afd676d94c.
2017-02-02 10:41:24 -08:00
Vishnu Kannan a3ae8c2b21 Revert "assign -998 as the oom_score_adj for critical pods."
This reverts commit 53931fbce4.
2017-02-02 10:41:21 -08:00
Yu-Ju Hong 999f8dff8e Remove the temporary fix for pre-1.0 mirror pods 2017-02-02 10:37:19 -08:00
Vishnu Kannan b8a63537dd Revert "Don't evict static pods"
This reverts commit 1743c6b6ab.
2017-02-02 10:29:12 -08:00
Minhan Xia 51526d3103 Add checkpointHandler to DockerService 2017-02-02 10:19:34 -08:00
Minhan Xia 344d2f591f add checkpoint structures for dockershim 2017-02-02 10:18:37 -08:00
Jacob Simpson cf31d9413e Release API watch resources when done. 2017-02-02 10:17:08 -08:00