Commit Graph

21492 Commits (d02f40a5e725d70f59e9f9e96b22ddad5c0426f7)

Author SHA1 Message Date
deads2k 5539a6721d prevent illegal verb/name combinations in default policy rules 2017-05-26 12:20:27 -04:00
deads2k 18177e2bde move CRD behind TPR 2017-05-26 12:15:13 -04:00
Kubernetes Submit Queue 46dfb3abc7 Merge pull request #46507 from bboreham/dont-print-local-message
Automatic merge from submit-queue

Don't print message at the top of `set selector` or `set subject`

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

Stop printing "running in local/dry-run mode..." at the top of `set selector` or `set subject`, because the user may be trying to pipe the output of this command as the input to another. 

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

**Special notes for your reviewer**:
This PR makes `set subject` and `set resources` consistent with similar commands in the same directory.

**Release note**:

```release-note
`set selector` and `set subject` no longer print "running in local/dry-run mode..." at the top, so their output can be piped as valid yaml or json
```
2017-05-26 09:11:09 -07:00
Kubernetes Submit Queue 25aa600360 Merge pull request #46178 from zjj2wry/des_rq
Automatic merge from submit-queue

add test in descibe resourcequota

**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
NONE
```
2017-05-26 07:05:54 -07:00
Bryan Boreham 219cebecf7 Don't print "running in local/dry-run mode..." at the top
because the user may be trying to pipe the output of this command as
the input to another. This makes `set subject` and `set resources`
consistent with all similar commands in this directory.

Signed-off-by: Bryan Boreham <bryan@weave.works>
2017-05-26 13:34:31 +00:00
zhengjiajin 60c3152c56 fix api description in swagger 2017-05-26 20:37:10 +08:00
zhengjiajin 5468773b83 add test and fix typo in daemoncontroller 2017-05-26 18:26:18 +08:00
NickrenREN a02d6cd5d8 Add createdby annotation for rbd and quobyte and make dynamical createdby key const
make dynamical createdby key const
2017-05-26 16:55:11 +08:00
Chao Xu 89e506c46a generated 2017-05-26 00:14:11 -07:00
Chao Xu bc9b305f17 generated clients 2017-05-26 00:03:53 -07:00
Kubernetes Submit Queue 6b14216a40 Merge pull request #46438 from wojtek-t/make_bound_frequency_runner_non_blocking
Automatic merge from submit-queue

Make BoundedFrequencyRunner Run() really non-blocking
2017-05-25 23:59:19 -07:00
Chao Xu 262799f91f serve the api in kube-apiserver 2017-05-25 23:55:15 -07:00
Chao Xu 6b5bd19566 api 2017-05-25 23:55:15 -07:00
ailusazh 6082b87ca3 fix typo in taint_controller 2017-05-26 13:58:31 +08:00
NickrenREN 51e2336476 Optimize provisioner plugin result check logic
If err is not returned by findProvisionablePlugin(...), storageClass is certainly not nil
2017-05-26 13:57:40 +08:00
Kubernetes Submit Queue 7d37a2685c Merge pull request #45867 from kow3ns/controller-history
Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

Controller history

**What this PR does / why we need it**:
Implements the ControllerRevision API object and clientset to allow for the implementation of StatefulSet update and DaemonSet history

```release-note
ControllerRevision type added for StatefulSet and DaemonSet history.
```
2017-05-25 22:42:08 -07:00
Kubernetes Submit Queue 07038c9417 Merge pull request #46395 from mindprince/issue-46204-45803-kubelet-volumes-test-flake
Automatic merge from submit-queue (batch tested with PRs 46429, 46308, 46395, 45867, 45492)

Implement FakeVolumePlugin's ConstructVolumeSpec method according to interface expectation.

This fixes #45803 and #46204.

**Release note**:
```release-note
NONE
```
2017-05-25 22:42:06 -07:00
xilabao 9fe2ef54ba add policy_compact to rbac validation 2017-05-26 13:22:38 +08:00
Kubernetes Submit Queue 5e853709a7 Merge pull request #46089 from karataliu/wincri1
Automatic merge from submit-queue (batch tested with PRs 46124, 46434, 46089, 45589, 46045)

Support TCP type runtime endpoint for kubelet

**What this PR does / why we need it**:
Currently the grpc server for kubelet and dockershim has a hardcoded endpoint: unix socket '/var/run/dockershim.sock', which is not applicable on non-unix OS.

This PR is to support TCP endpoint type besides unix socket.

**Which issue this PR fixes** 
This is a first attempt to address issue https://github.com/kubernetes/kubernetes/issues/45927

**Special notes for your reviewer**:
Before this change, running on Windows node results in:
```
Container Manager is unsupported in this build
```

After adding the cm stub, error becomes:
```
listen unix /var/run/dockershim.sock: socket: An address incompatible with the requested protocol was used.
```

This PR is to fix those two issues.

After this change, still meets 'seccomp' related issue when running on Windows node, needs more updates later.

**Release note**:
2017-05-25 21:40:02 -07:00
Kubernetes Submit Queue b642ae2c18 Merge pull request #46124 from humblec/cephfs-vol-source
Automatic merge from submit-queue (batch tested with PRs 46124, 46434, 46089, 45589, 46045)

Add CephFS volume source to describe printer.
2017-05-25 21:39:56 -07:00
zhengjiajin 9d68ae5963 Fix naming and comments in Container Manage 2017-05-26 10:53:09 +08:00
Kubernetes Submit Queue ae03f22c65 Merge pull request #46009 from timstclair/audit-policy
Automatic merge from submit-queue (batch tested with PRs 45949, 46009, 46320, 46423, 46437)

Implement audit policy logic

Includes https://github.com/kubernetes/kubernetes/pull/45315#discussion_r117115932 (ignore the first commit)

Feature: https://github.com/kubernetes/features/issues/22

Remaining work:

- [x] Load the policy into the `server.Config`
- [x] Rebase on https://github.com/kubernetes/kubernetes/pull/45315
- [x] Establish shared code for audit api scheme (with https://github.com/kubernetes/kubernetes/pull/45919)
- [x] Once https://github.com/kubernetes/kubernetes/pull/45766 is merged, call the policy checker in the audit path

/cc @sttts @soltysh @ericchiang @ihmccreery @pweil- @deads2k
2017-05-25 19:40:59 -07:00
Kubernetes Submit Queue 470a6a45d5 Merge pull request #45949 from NickrenREN/kubelet-metric
Automatic merge from submit-queue (batch tested with PRs 45949, 46009, 46320, 46423, 46437)

Unregister some metrics

delete some registered metrics since they are not observed


**Release note**:
```release-note
NONE
```
2017-05-25 19:40:58 -07:00
Cao Shufeng 93e50b167e support NonResourceURL for kubectl create clusterrole 2017-05-26 10:07:44 +08:00
Matthew Wong 319c608fdd Get instances of all states in DisksAreAttached, not just "running" 2017-05-25 17:08:30 -04:00
Rohit Agarwal 2b594d6197 Add missing Cleanup() calls in kubelet tests.
Possibly related to #45803 and #46204.
2017-05-25 13:19:56 -07:00
Matthew Wong 9afbb356de Log an EBS vol's instance when attaching fails because VolumeInUse 2017-05-25 15:07:12 -04:00
Kubernetes Submit Queue 749ac27e9a Merge pull request #45003 from krmayankk/garbage
Automatic merge from submit-queue (batch tested with PRs 45518, 46127, 46146, 45932, 45003)

PodDisruptionBudget should use ControllerRef

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

```release-note
PodDisruptionBudget now uses ControllerRef to decide which controller owns a given Pod, so it doesn't get confused by controllers with overlapping selectors.
```
2017-05-25 11:46:08 -07:00
Kubernetes Submit Queue 29b3bb44ba Merge pull request #45932 from lpabon/elbtag_pr
Automatic merge from submit-queue (batch tested with PRs 45518, 46127, 46146, 45932, 45003)

aws: Support for ELB tagging by users

This PR provides support for tagging AWS ELBs using information in an
annotation and provided as a list of comma separated key-value pairs.

Closes https://github.com/kubernetes/community/pull/404
2017-05-25 11:46:06 -07:00
Kubernetes Submit Queue b017a7a392 Merge pull request #45518 from portworx/px-remote
Automatic merge from submit-queue (batch tested with PRs 45518, 46127, 46146, 45932, 45003)

Remove requirement to run the Portworx volume driver on master node

**What this PR does / why we need it**:
This change removes requirement to run the Portworx volume driver on Kubernetes master node.

**Special notes for your reviewer**:
Before this pull request, in order to use a Portworx volume, users had to run the Portworx container on the master node. Since it isn't ideal (and impossible on GKE) to schedule any pods on the master node, this PR removes that requirement.
2017-05-25 11:45:59 -07:00
Kenneth Owens ba128e6e41 Implements ControllerRevision API Object without codec and code
generation
2017-05-25 11:38:57 -07:00
Zihong Zheng 41c4e965c3 Fix potential nil pointer dereference for kube-proxy healthcheck 2017-05-25 10:26:51 -07:00
David Ashpole b2a60dc9a4 By default, Disable LowDiskSpaceThresholdMB, and enable eviciton for disk 2017-05-25 10:03:35 -07:00
Shiyang Wang 4597658cb9 add `kubectl apply edit-last-applied` subcommand 2017-05-26 00:20:48 +08:00
Kubernetes Submit Queue 079020f559 Merge pull request #46160 from NickrenREN/fix-UX
Automatic merge from submit-queue

fix regression in UX experience for double attach volume

send event when volume is not allowed to multi-attach

Fixes #46012

**Release note**:
```release-note
NONE
```
2017-05-25 08:50:12 -07:00
Bryan Boreham 2d8c172a0f Fix screwed-up log message format
It had two %-verbs and three arguments
2017-05-25 15:33:39 +00:00
Tim St. Clair a5de309ee2
Implement audit policy logic 2017-05-25 07:38:07 -07:00
Wojciech Tyczynski 46e9b522fd Make BoundedFrequencyRunner Run() really non-blocking 2017-05-25 16:12:16 +02:00
Kubernetes Submit Queue ee671e64ee Merge pull request #46266 from thockin/proxy-periodic-runner-2
Automatic merge from submit-queue (batch tested with PRs 44774, 46266, 46248, 46403, 46430)

kube-proxy: ratelimit runs of iptables by sync-period flags

This bounds how frequently iptables can be synced.  It will be no more often than every 10 seconds and no less often than every 1 minute, by default.

@timothysc FYI

@dcbw @freehan FYI
2017-05-25 06:17:56 -07:00
Kubernetes Submit Queue 26d7ee0447 Merge pull request #44774 from kargakis/uniquifier
Automatic merge from submit-queue

Switch Deployments to new hashing algo w/ collision avoidance mechanism

Implements https://github.com/kubernetes/community/pull/477

@kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews 

Fixes https://github.com/kubernetes/kubernetes/issues/29735
Fixes https://github.com/kubernetes/kubernetes/issues/43948

```release-note
Deployments are updated to use (1) a more stable hashing algorithm (fnv) than the previous one (adler) and (2) a hashing collision avoidance mechanism that will ensure new rollouts will not block on hashing collisions anymore.
```
2017-05-25 06:09:58 -07:00
Michail Kargakis 9190a47c37
Generated changes for collision count
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 12:23:17 +02:00
Kubernetes Submit Queue 9c1480bb61 Merge pull request #46366 from nicksardo/gce-subnetwork-url
Automatic merge from submit-queue (batch tested with PRs 45573, 46354, 46376, 46162, 46366)

GCE - Retrieve subnetwork name/url from gce.conf 

**What this PR does / why we need it**:
Features like ILB require specifying the subnetwork if the network is type manual.

**Notes:**
The network URL can be [constructed](68e7e18698/pkg/cloudprovider/providers/gce/gce.go (L211-L217)) by fetching instance metadata; however, the subnetwork is not provided through this feature. Users must specify the subnetwork name/url through the gce.conf.

Although multiple subnets can exist in the same region for a network, the cloud provider will only use one subnet url for creating LBs. 


**Release note**:
```release-note
NONE
```
2017-05-25 03:14:05 -07:00
Kubernetes Submit Queue 8f9f412d2f Merge pull request #46162 from lixiaobing10051267/masterFound
Automatic merge from submit-queue (batch tested with PRs 45573, 46354, 46376, 46162, 46366)

break the loop when found true

break the loop when found true.
2017-05-25 03:14:03 -07:00
Kubernetes Submit Queue 4234d79aca Merge pull request #45573 from shiywang/zh
Automatic merge from submit-queue (batch tested with PRs 45573, 46354, 46376, 46162, 46366)

Add Simplified Chinese translation for kubectl

What this PR does / why we need it:
This PR provides first attempt to translate kubectl in Simplified Chinese.

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

Special notes for your reviewer:
Although I'm a native speaker for Mandarin Chinese, but I think translation is a whole different knowledge which I'm not good at it, so this pr absolutely need to be polished.
@adohe @mengqiy @resouer @k82cn @caesarxuchao @wanghaoran1988 sorry I think there are so many folks who are good at Chinese I haven't mention, feel free to leave a comment on it : )
also cc @brendandburns
2017-05-25 03:13:57 -07:00
Michail Kargakis 4a2c5eae92
Implement hash collision avoidance mechanism
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 11:17:45 +02:00
Michail Kargakis aeb2d9b9b4
Deep equality helper should not mutate state
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 11:17:45 +02:00
Michail Kargakis fcf68ba7a7
Remove obsolete deployment helpers
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 11:17:44 +02:00
Michail Kargakis 4aa8b1a66a
Add collisionCount api field in DeploymentStatus
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-25 11:17:44 +02:00
Harry Zhang 4f4b161fc7 Log out digest when digest is invalid 2017-05-25 16:46:56 +08:00
Kubernetes Submit Queue 4def5add11 Merge pull request #46373 from deads2k/controller-06-queue
Automatic merge from submit-queue (batch tested with PRs 45913, 46065, 46352, 46363, 46373)

don't queue namespaces for deletion if the namespace isn't deleted

Most namespaces aren't deleted most of the time.  No need to queue them for cleanup if they aren't deleted.
2017-05-25 00:11:07 -07:00
Kubernetes Submit Queue f5bdd61b12 Merge pull request #46352 from humblec/gluster-mount-4
Automatic merge from submit-queue (batch tested with PRs 45913, 46065, 46352, 46363, 46373)

Dont exit if 'mount.glusterfs -V' resulted in an error.
2017-05-25 00:11:03 -07:00
Jordan Liggitt aa69c80728
Remove deletecollection support from namespace object 2017-05-25 00:17:08 -04:00
Kubernetes Submit Queue cbd6b25c1c Merge pull request #46207 from zjj2wry/spea-space
Automatic merge from submit-queue

/pkg/client/listers: fix some typo

**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-05-24 20:39:00 -07:00
Tim Hockin 2856fde23b Use BoundedFrequencyRunner in kube-proxy 2017-05-24 20:33:15 -07:00
Tim Hockin bbb80c252b Add bounded frequency runner
This lib manages runs of a function to have min and max frequencies.
2017-05-24 20:33:15 -07:00
Tim Hockin 578d9fcf63 Logging/naming cleanup for service port names 2017-05-24 20:33:15 -07:00
Cheng Xing f9dc2d5ca3 Node status updater now deletes the node entry in attach updates when node is missing in NodeInformer cache. Fixes #42438.
- Added RemoveNodeFromAttachUpdates as part of node status updater operations.
2017-05-24 18:31:47 -07:00
NickrenREN add091b1fb fix regression in UX experience for double attach volume
send event when volume is not allowed to multi-attach
2017-05-25 09:27:24 +08:00
Dong Liu fb26c9100a Support TCP type runtime endpoint for kubelet. 2017-05-25 09:16:11 +08:00
Rohit Agarwal 0f5cc4027f Implement FakeVolumePlugin's ConstructVolumeSpec method according to interface expectation.
This fixes #45803 and #46204.
2017-05-24 17:26:34 -07:00
Kubernetes Submit Queue de1ebf8118 Merge pull request #44443 from jamiehannaford/kubelet-tc
Automatic merge from submit-queue

Bump kubelet/networks test coverage

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

Bumps test coverage

**Which issue this PR fixes**:

https://github.com/kubernetes/kubernetes/issues/40780
https://github.com/kubernetes/kubernetes/issues/39559

**Special notes for your reviewer**:

Writing positive test cases for these lines:
https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/networks.go#L38 https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/networks.go#L69 
is quite difficult, so the former has a negative case and the latter has no test coverage.

**Release note**:
```release-note
New tests for kubelet/networks
```
2017-05-24 16:17:08 -07:00
Cheng Xing 2141b0fb80 Created unit tests for GCE cloud provider storage interface.
- Currently covers CreateDisk and DeleteDisk, GetAutoLabelsForPD
- Created ServiceManager interface in gce.go to facilitate mocking in tests.
2017-05-24 15:50:22 -07:00
Yu-Ju Hong 417e9c8cea Update all relevant interfaces and create stubs 2017-05-24 15:21:16 -07:00
Harsh Desai ad4f21f26c Dedup common code for fetching portworx driver 2017-05-24 14:52:04 -07:00
Harsh Desai bbfda9cdfe Remove call to common unmount routine as Portworx takes care of all umount workflow 2017-05-24 14:52:03 -07:00
Harsh Desai 779455aa32 fix bazel build 2017-05-24 14:52:03 -07:00
Harsh Desai e860da4bd2 Use Portworx service as api endpoint for volume operations 2017-05-24 14:52:03 -07:00
Harsh Desai 244a0b7b7e Add support for Portworx plugin to query remote API servers 2017-05-24 14:52:03 -07:00
Yu-Ju Hong aff2be9f9b Run hack/update-generated-runtime.sh 2017-05-24 14:45:01 -07:00
Yu-Ju Hong 893a7b2dd1 CRI: add methods for getting container stats
This commit also changes the image-filesystem-related types.
2017-05-24 14:45:01 -07:00
Kubernetes Submit Queue 89a76b8c8b Merge pull request #46128 from jagosan/master
Automatic merge from submit-queue

Added deprecation notice and guidance for cloud providers.

**What this PR does / why we need it**:
Adding context/background and general guidance for incoming cloud providers. 

**Which issue this PR fixes** 

**Special notes for your reviewer**:
Generalized message per discussion with @bgrant0607
2017-05-24 14:19:01 -07:00
Kubernetes Submit Queue c1d6439fe3 Merge pull request #46262 from xilabao/fix-message-in-storage-extensions
Automatic merge from submit-queue

fix err message in storage extensions

**Release note**:

```release-note
`NONE`
```
2017-05-24 14:18:53 -07:00
Kubernetes Submit Queue b3181ec2f3 Merge pull request #46305 from sjenning/init-container-status
Automatic merge from submit-queue

clear init container status annotations when cleared in status

When I pod with an init container is terminated due to exceeding its active deadline, the pod status is phase `Failed` with reason `DeadlineExceeded`.  All container statuses are cleared from the pod status.

With init containers, however, the status is being regenerated from the status annotations.  This is causing kubectl to report the pod state as `Init:0/1` instead of `DeadlineExceeded` because the kubectl printer observes a running init container, which in reality is not running.

This PR clears out the init container status annotations when they have been removed from the pod status so they are not regenerated on the apiserver.

xref https://bugzilla.redhat.com/show_bug.cgi?id=1453180

@derekwaynecarr 

```release-note
Fix init container status reporting when active deadline is exceeded.
```
2017-05-24 14:18:45 -07:00
Ginwala 28a0e2621b Fix comment typo in kube-apiserver and cachesize 2017-05-24 13:41:33 -07:00
Jacob Simpson 07e9b0e197 Add support for specifying certificate duration at runtime. 2017-05-24 13:29:46 -07:00
deads2k ba5a1113e6 don't queue namespaces for deletion if the namespace isn't deleted 2017-05-24 14:47:53 -04:00
Nick Sardo 435303c647 Add subnetworkURL to GCE provider 2017-05-24 09:35:51 -07:00
Humble Chirammal 55808add37 Dont exit if 'mount.glusterfs -V' resulted in an error.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-24 21:07:58 +05:30
Kubernetes Submit Queue 6f7eac63c2 Merge pull request #46315 from wongma7/gcepdalready
Automatic merge from submit-queue (batch tested with PRs 38505, 41785, 46315)

Fix provisioned GCE PD not being reused if already exists

@jsafrane PTAL 

This is another attempt at https://github.com/kubernetes/kubernetes/pull/38702 . We have observed that `gce.service.Disks.Insert(gce.projectID, zone, diskToCreate).Do()` instantly gets an error response of alreadyExists, so we must check for it.

I am not sure if we still need to check for the error after `waitForZoneOp`; I think that if there is an alreadyExists error, the `Do()` above will always respond with it instantly. But because I'm not sure, and to be safe, I will leave it.
2017-05-24 06:47:03 -07:00
Kubernetes Submit Queue 70dd10cc50 Merge pull request #41785 from jamiehannaford/cinder-performance
Automatic merge from submit-queue (batch tested with PRs 38505, 41785, 46315)

Only retrieve relevant volumes

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

Improves performance for Cinder volume attach/detach calls. 

Currently when Cinder volumes are attached or detached, functions try to retrieve details about the volume from the Nova API. Because some only have the volume name not its UUID, they use the list function in gophercloud to iterate over all volumes to find a match. This incurs severe performance problems on OpenStack projects with lots of volumes (sometimes thousands) since it needs to send a new request when the current page does not contain a match. A better way of doing this is use the `?name=XXX` query parameter to refine the results.

**Which issue this PR fixes**:

https://github.com/kubernetes/kubernetes/issues/26404

**Special notes for your reviewer**:

There were 2 ways of addressing this problem:

1. Use the `name` query parameter
2. Instead of using the list function, switch to using volume UUIDs and use the GET function instead. You'd need to change the signature of a few functions though, such as [`DeleteVolume`](https://github.com/kubernetes/kubernetes/blob/master/pkg/volume/cinder/cinder.go#L49), so I'm not sure how backwards compatible that is.

Since #1 does effectively the same as #2, I went with it because it ensures BC.

One assumption that is made is that the `volumeName` being retrieved matches exactly the name of the volume in Cinder. I'm not sure how accurate that is, but I see no reason why cloud providers would want to append/prefix things arbitrarily. 

**Release note**:
```release-note
Improves performance of Cinder volume attach/detach operations
```
2017-05-24 06:46:59 -07:00
Jamie Hannaford 4bd71a3b77 Refactor to use Volume IDs and remove ambiguity 2017-05-24 12:59:16 +02:00
pospispa 9eb912e62f Admin Can Specify in Which AWS Availability Zone(s) a PV Shall Be Created
An admin wants to specify in which AWS availability zone(s) users may create persistent volumes using dynamic provisioning.

That's why the admin can now configure in StorageClass object a comma separated list of zones. Dynamically created PVs for PVCs that use the StorageClass are created in one of the configured zones.
2017-05-24 10:48:11 +02:00
pospispa d73c0d649d Admin Can Specify in Which GCE Availability Zone(s) a PV Shall Be Created
An admin wants to specify in which GCE availability zone(s) users may create persistent volumes using dynamic provisioning.

That's why the admin can now configure in StorageClass object a comma separated list of zones. Dynamically created PVs for PVCs that use the StorageClass are created in one of the configured zones.
2017-05-24 10:48:10 +02:00
pospispa dd17d620d7 Added func ValidateZone
The zone parameter provided in a Storage Class may erroneously be an empty string or contain only spaces and tab characters. Such situation shall be detected and reported as an error.

That's why the func ValidateZone was added.
2017-05-24 10:48:10 +02:00
pospispa 0f3a9cfc5f Added func ZonesToSet
An admin shall be able to configure a comma separated list of zones for a StorageClass.

That's why the func ZonesToSet (string) (set.String, error) is added. The func ZonesToSet converts a string containing a comma separated list of zones to a set. In case the list contains an empty zone an error is returned.
2017-05-24 10:48:10 +02:00
Kubernetes Submit Queue c1c7365e7c Merge pull request #46147 from nicksardo/gce-cluster-id
Automatic merge from submit-queue (batch tested with PRs 45891, 46147)

Watching ClusterId from within GCE cloud provider

**What this PR does / why we need it**:
Adds the ability for the GCE cloud provider to watch a config map for `clusterId` and `providerId`.

WIP - still needs more testing

cc @MrHohn @csbell @madhusudancs @thockin @bowei @nikhiljindal 

**Release note**:
```release-note
NONE
```
2017-05-24 00:42:58 -07:00
Kubernetes Submit Queue 84401e7601 Merge pull request #45891 from zjj2wry/zjj-t
Automatic merge from submit-queue (batch tested with PRs 45891, 46147)

fix typo

**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-05-24 00:42:56 -07:00
zhengjiajin dc48a5abc9 /pkg/client/listers: fix some typo 2017-05-24 13:59:03 +08:00
zhengjiajin 98ee2463ec add test fot set selector 2017-05-24 13:08:43 +08:00
Kubernetes Submit Queue 5be7a6a73e Merge pull request #45514 from mikedanese/cert-refactor
Automatic merge from submit-queue (batch tested with PRs 45514, 45635)

refactor certificate controller to break it into two parts

Break pkg/controller/certificates into:
* pkg/controller/certificates/approver: containing the group approver
* pkg/controller/certificates/signer: containing the local signer
* pkg/controller/certificates: containing shared infrastructure
```release-note
Break the 'certificatesigningrequests' controller into a 'csrapprover' controller and 'csrsigner' controller.
```
2017-05-23 20:52:53 -07:00
Dan Williams 02200ba752 dockershim: don't spam logs with pod IP errors before networking is ready
GenericPLEG's 1s relist() loop races against pod network setup.  It
may be called after the infra container has started but before
network setup is done, since PLEG and the runtime's SyncPod() run
in different goroutines.

Track network setup status and don't bother trying to read the pod's
IP address if networking is not yet ready.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=1434950

Mar 22 12:18:17 ip-172-31-43-89 atomic-openshift-node: E0322
   12:18:17.651013   25624 docker_manager.go:378] NetworkPlugin
   cni failed on the status hook for pod 'pausepods22' - Unexpected
   command output Device "eth0" does not exist.
2017-05-23 22:42:41 -05:00
Dan Williams 9e1385b450 kubelet/network: return but tolerate errors returned from GetNetNS()
Runtimes should never return "" and nil errors, since network plugin
drivers need to treat netns differently in different cases.  So return
errors when we can't get the netns, and fix up the plugins to do the
right thing.

Namely, we don't need a NetNS on pod network teardown.  We do need
a netns for pod Status checks and for network setup.
2017-05-23 22:33:12 -05:00
Dan Williams 2036868a7d Revert "Return empty network namespace if the infra container has exited"
This reverts commit fee4c9a7d9.

This is not the correct fix for the problem; and it causes other problems
like continuous:

docker_sandbox.go:234] NetworkPlugin cni failed on the status hook for pod
"someotherdc-1-deploy_default": Unexpected command output nsenter: cannot
open : No such file or directory with error: exit status 1

Because GetNetNS() is returning an empty network namespace.  That is
not helpful nor should really be allowed; that's what the error return
from GetNetNS() is for.
2017-05-23 22:33:12 -05:00
Mayank Kumar 3ab6082958 PodDisruptionBudget should use ControllerRef 2017-05-23 19:43:38 -07:00
Kubernetes Submit Queue 447ee4a1c9 Merge pull request #46258 from MrHohn/esipp-fix-needsUpdate
Automatic merge from submit-queue (batch tested with PRs 42042, 46139, 46126, 46258, 46312)

Detect ExternalTrafficPolicy and HealthCheckNodePort changes in needsUpdate()

Fix a bug that editing ExternalTrafficPolicy doesn't trigger LoadBalancer update. I'm surprise that ESIPP e2e tests didn't catch this.

/assign @freehan @thockin 

**Release note**:

```release-note
NONE
```
2017-05-23 19:43:04 -07:00
Kubernetes Submit Queue 8e87c02959 Merge pull request #46139 from monopole/removeDepOnPkgHelper
Automatic merge from submit-queue (batch tested with PRs 42042, 46139, 46126, 46258, 46312)

Remove kubectl's dependence on pkg/api/helper

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

Remove kubectl's dependence on pkg/api/helper, as part of
broader effort to isolate kubectl from the rest of k8s.
In this case, the code becomes private to kubectl; nobody else uses it.

**Which issue this PR fixes**

Part of a series of PRs to address kubernetes/community#598

**Release note**:
```release-note
NONE
```
2017-05-23 19:42:59 -07:00
Kubernetes Submit Queue f30443cacc Merge pull request #42042 from perotinus/svcaccounts
Automatic merge from submit-queue (batch tested with PRs 42042, 46139, 46126, 46258, 46312)

[Federation] Use service accounts instead of the user's credentials when accessing joined clusters' API servers.

Fixes #41267.

Release notes:
```release-note
Modifies kubefed to create and the federation controller manager to use credentials associated with a service account rather than the user's credentials.
```
2017-05-23 19:42:57 -07:00
zhengjiajin 61e5b5815d Fix test not use test flags 2017-05-24 10:14:00 +08:00
zhengjiajin fe44830a31 add test in descibe resourcequota 2017-05-24 10:12:37 +08:00
zhengjiajin 857306b3c2 fix some type 2017-05-24 10:05:01 +08:00
zhengjiajin 802362007e add test in create authinfo 2017-05-24 10:01:45 +08:00
Kubernetes Submit Queue 90250220a9 Merge pull request #44428 from qiujian16/commenttypo
Automatic merge from submit-queue

Fix some typo of comment in kubelet.go

**What this PR does / why we need it**:
The PR is to fix some typo in kubelet.go

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-23 18:45:34 -07:00
Kubernetes Submit Queue 95a6f108bd Merge pull request #46289 from p0lyn0mial/admission_plugins_remove_init_blocks
Automatic merge from submit-queue

remove init blocks from all admission plugins

**What this PR does / why we need it**:
removes init blocks from all admission plugins

**Release note**:

```release-note
NONE
```
2017-05-23 17:00:59 -07:00
Seth Jennings 86bc27b6a1 clear init container status annotations when cleared in status 2017-05-23 18:31:49 -05:00
Kubernetes Submit Queue 45b275d52c Merge pull request #45897 from ncdc/gc-require-list-watch
Automatic merge from submit-queue (batch tested with PRs 46149, 45897, 46293, 46296, 46194)

GC: update required verbs for deletable resources, allow list of ignored resources to be customized

The garbage collector controller currently needs to list, watch, get,
patch, update, and delete resources. Update the criteria for
deletable resources to reflect this.

Also allow the list of resources the garbage collector controller should
ignore to be customizable, so downstream integrators can add their own
resources to the list, if necessary.

cc @caesarxuchao @deads2k @smarterclayton @mfojtik @liggitt @sttts @kubernetes/sig-api-machinery-pr-reviews
2017-05-23 15:48:57 -07:00
Matthew Wong 11cb36e9dc Fix provisioned GCE PD not being reused if already exists 2017-05-23 18:30:37 -04:00
Mike Danese f04ce3cfba refactor certificate controller 2017-05-23 15:25:58 -07:00
Nick Sardo 729303f0de Watching ClusterId from within GCE cloud provider 2017-05-23 14:11:24 -07:00
Kubernetes Submit Queue 98c66f9fca Merge pull request #46267 from Random-Liu/extend-stop-container-request-timeout
Automatic merge from submit-queue

Double `StopContainer` request timeout.

Doubled `StopContainer` request timeout to leave some time for `SIGKILL` container.

@yujuhong @feiskyer
2017-05-23 14:06:23 -07:00
p0lyn0mial c5019bf696 remove init blocks from all admission plugins 2017-05-23 22:00:32 +02:00
Kubernetes Submit Queue 9ebfe9662f Merge pull request #46286 from zjj2wry/timstamps-timestamps
Automatic merge from submit-queue (batch tested with PRs 45587, 46286)

fix typo in kubelet

**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
NONE
```
2017-05-23 10:29:58 -07:00
Kubernetes Submit Queue 1602e2a338 Merge pull request #45587 from foxish/pdb-maxunavailab
Automatic merge from submit-queue (batch tested with PRs 45587, 46286)

PDB Max Unavailable Field

Completes https://github.com/kubernetes/features/issues/285

```release-note
Adds a MaxUnavailable field to PodDisruptionBudget
```


Individual commits are self-contained; Last commit can be ignored because it is autogenerated code.
cc @kubernetes/sig-apps-api-reviews @kubernetes/sig-apps-pr-reviews
2017-05-23 10:29:56 -07:00
Random-Liu 5f0288e022 Double `StopContainer` request timeout. 2017-05-23 09:35:48 -07:00
Andy Goldstein d1a0384678 GC: allow ignored resources to be customized
Allow the list of resources the garbage collector controller should
ignore to be customizable, so downstream integrators can add their own
resources to the list, if necessary.
2017-05-23 12:05:09 -04:00
Humble Chirammal 8700776d26 Add CephFS volume source to describe printer.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-23 20:27:00 +05:30
Anirudh 48d76edc74 PDB MaxUnavailable: Generated 2017-05-23 07:42:24 -07:00
Kubernetes Submit Queue 1f45c4846b Merge pull request #45766 from sttts/sttts-audit-event-in-context
Automatic merge from submit-queue (batch tested with PRs 45766, 46223)

Audit: fill audit.Event in handler chain

Related:
- external API types https://github.com/kubernetes/kubernetes/pull/45315
- policy checker https://github.com/kubernetes/kubernetes/pull/46009

Decisions:
- ~~[ ] decide whether we want to send an event before `WriteHeader` https://github.com/kubernetes/kubernetes/pull/45766#pullrequestreview-38664161~~ Follow-up described in https://github.com/kubernetes/kubernetes/pull/46065/files#r117438531
- [ ] decide how to handle `AuditID`s and the IP chain https://github.com/kubernetes/kubernetes/pull/45766#pullrequestreview-38659371. Is the variant in the proposal (https://github.com/kubernetes/community/pull/625) final? Then we need the API type update.
- ~~[ ] decide how to mark intermediate/incomplete events? set a special reason in `ResponseStatus.Reason` vs. having extra fields for that `Event.NonFinal`
 https://github.com/kubernetes/kubernetes/pull/45766#discussion_r116795888~~ Follow-up of #46065
- [ ] decide whether and how to protect the `Audit-Level` header https://github.com/kubernetes/kubernetes/pull/45766#pullrequestreview-38937691

TODOs:
- ~~[ ] move `AuditIDHeader`, `AuditLevelHeader` to types https://github.com/kubernetes/kubernetes/pull/45766#discussion_r117064094, @timstclair for the type PR~~ Follow-up of https://github.com/kubernetes/kubernetes/pull/46065
- [x] add SourceIP/ForwardedFor support https://github.com/kubernetes/kubernetes/pull/45766#discussion_r116778101
- [x] adapt ObjectReference.Resource to API PR https://github.com/kubernetes/kubernetes/pull/45766#pullrequestreview-38656828
2017-05-23 07:41:56 -07:00
Anirudh 078f9566d9 PDB MaxUnavailable: kubectl changes 2017-05-23 07:18:44 -07:00
Anirudh ce48d4fb5c PDB MaxUnavailable: Disruption Controller Changes 2017-05-23 07:18:44 -07:00
Anirudh 2b0de599a7 PDB MaxUnavailable: API changes 2017-05-23 07:18:43 -07:00
Kubernetes Submit Queue 4871f4a75b Merge pull request #45637 from xilabao/hide-api-version
Automatic merge from submit-queue

remove --api-version
2017-05-23 06:15:45 -07:00
zhengjiajin c79b0c797f fix typo in kubelet 2017-05-23 19:54:10 +08:00
Dr. Stefan Schimanski ce942d19c3 audit: wire through non-nil context everywhere 2017-05-23 11:20:14 +02:00
Dr. Stefan Schimanski 0b5bcb0219 audit: add audit event to the context and fill in handlers 2017-05-23 11:20:14 +02:00
Kubernetes Submit Queue 7e75998233 Merge pull request #46060 from MrHohn/fix-serviceregistry-externaltraffic
Automatic merge from submit-queue (batch tested with PRs 46060, 46234)

Randomize test nodePort to prevent collision

Fix #37982.

/assign @bowei 

**Release note**:

```release-note
NONE
```
2017-05-23 01:41:55 -07:00
Kubernetes Submit Queue 286bcc6f5c Merge pull request #45995 from humblec/glusterfs-mount-3
Automatic merge from submit-queue

Add `auto_unmount` mount option for glusterfs fuse mount.

libfuse has an auto_unmount option which, if enabled, ensures that
the file system is unmounted at FUSE server termination by running a
separate monitor process that performs the unmount when that occurs.
(This feature would probably better be called "robust auto-unmount",
as FUSE servers usually do try to unmount their file systems upon
termination, it's just this mechanism is not crash resilient.)
This change implements that option and behavior for glusterfs.

This option will be only supported for clients with version >3.11.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-23 00:29:41 -07:00
Kubernetes Submit Queue 455e9fff09 Merge pull request #46176 from vmware/vSphereStoragePolicySupport
Automatic merge from submit-queue

vSphere storage policy support for dynamic volume provisioning

Till now, vSphere cloud provider provides support to configure persistent volume with VSAN storage capabilities - kubernetes#42974. Right now this only works with VSAN.

Also there might be other use cases:

- The user might need a way to configure a policy on other datastores like VMFS, NFS etc.
- Use Storage IO control, VMCrypt policies for a persistent disk.

We can achieve about 2 use cases by using existing storage policies which are already created on vCenter using the Storage Policy Based Management service. The user will specify the SPBM policy ID as part of dynamic provisioning 

- resultant persistent volume will have the policy configured with it. 
- The persistent volume will be created on the compatible datastore that satisfies the storage policy requirements. 
- If there are multiple compatible datastores, the datastore with the max free space would be chosen by default.
- If the user specifies the datastore along with the storage policy ID, the volume will created on this datastore if its compatible. In case if the user specified datastore is incompatible, it would error out the reasons for incompatibility to the user.
- Also, the user will be able to see the associations of persistent volume object with the policy on the vCenter once the volume is attached to the node.

For instance in the below example, the volume will created on a compatible datastore with max free space that satisfies the "Gold" storage policy requirements.

```
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
       name: fast
provisioner: kubernetes.io/vsphere-volume
parameters:
      diskformat: zeroedthick
      storagepolicyName: Gold
```

For instance in the below example, the vSphere CP checks if "VSANDatastore" is compatible with "Gold" storage policy requirements. If yes, volume will be provisioned on "VSANDatastore" else it will error that "VSANDatastore" is not compatible with the exact reason for failure.

```
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
       name: fast
provisioner: kubernetes.io/vsphere-volume
parameters:
      diskformat: zeroedthick
      storagepolicyName: Gold
      datastore: VSANDatastore
```

As a part of this change, 4 commits have been added to this PR.

1. Vendor changes for vmware/govmomi
2. Changes to the VsphereVirtualDiskVolumeSource in the Kubernetes API. Added 2 additional fields StoragePolicyName, StoragePolicyID
3. Swagger and Open spec API changes.
4. vSphere Cloud Provider changes to implement the storage policy support.

**Release note**:


```release-note
vSphere cloud provider: vSphere Storage policy Support for dynamic volume provisioning
```
2017-05-22 23:41:10 -07:00
Kubernetes Submit Queue 3bfae793f0 Merge pull request #46008 from NickrenREN/openstack-add-metric
Automatic merge from submit-queue

Recording openstack metrics

add openstack operation metrics


**Release note**:
```release-note
Add support for emitting metrics from openstack cloudprovider about storage operations.
```

/assign @gnufied
2017-05-22 21:54:02 -07:00
Kubernetes Submit Queue 644a544d62 Merge pull request #46062 from alexandercampbell/correct-deprecation-errors
Automatic merge from submit-queue (batch tested with PRs 46201, 45952, 45427, 46247, 46062)

kubectl: fix deprecation warning bug

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

Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl resize [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 resize [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.

**Release note**:

```release-note
NONE
```
2017-05-22 20:58:07 -07:00
Kubernetes Submit Queue cc6e51c6e8 Merge pull request #45427 from ncdc/gc-shared-informers
Automatic merge from submit-queue (batch tested with PRs 46201, 45952, 45427, 46247, 46062)

Use shared informers in gc controller if possible

Modify the garbage collector controller to try to use shared informers for resources, if possible, to reduce the number of unique reflectors listing and watching the same thing.

cc @kubernetes/sig-api-machinery-pr-reviews @caesarxuchao @deads2k @liggitt @sttts @smarterclayton @timothysc @soltysh @kargakis @kubernetes/rh-cluster-infra @derekwaynecarr @wojtek-t @gmarek
2017-05-22 20:58:03 -07:00
Kubernetes Submit Queue 6f5193593d Merge pull request #46201 from wojtek-t/address_kubeproxy_todos
Automatic merge from submit-queue

Address remaining TODOs in kube-proxy.

Followup PR from the previous two.
2017-05-22 20:54:14 -07:00
Kubernetes Submit Queue 99a8f7c303 Merge pull request #43590 from dashpole/eviction_complete_deletion
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

Eviction does not evict unless the previous pod has been cleaned up

Addresses #43166
This PR makes two main changes:
First, it makes the eviction loop re-trigger immediately if there may still be pressure.  This way, if we already waited 10 seconds to delete a pod, we dont need to wait another 10 seconds for the next synchronize call.
Second, it waits for the pod to be cleaned up (including volumes, cgroups, etc), before moving on to the next synchronize call.  It has a timeout for this operation currently set to 30 seconds.
2017-05-22 20:00:03 -07:00
Kubernetes Submit Queue c586f36e55 Merge pull request #46209 from wojtek-t/remove_iptables_save
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

Remove Save() from iptables interface

This is what @thockin requested in one of the reviews.
2017-05-22 20:00:00 -07:00
Kubernetes Submit Queue c6cf666fa1 Merge pull request #45308 from fabianofranz/more_cmd_sanity_checks
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

More cli sanity verifications

Adds some more `kubectl` command sanity checks to improve consistency and avoid the need of code reviews for some of our CLI style and standards.

**Release note**:

```release-note
NONE
```
@kubernetes/sig-cli-pr-reviews
2017-05-22 19:59:59 -07:00
Kubernetes Submit Queue bb56937b92 Merge pull request #46055 from deads2k/crd-01-embed
Automatic merge from submit-queue (batch tested with PRs 46022, 46055, 45308, 46209, 43590)

embed kube-apiextensions inside of kube-apiserver

To reduce operation complexity, we decided to include the kube-apiextensions-server inside of kube-apiserver (https://github.com/kubernetes/community/blob/master/sig-api-machinery/api-extensions-position-statement.md#q-should-kube-aggregator-be-a-separate-binaryprocess-than-kube-apiserver).  With the API reasonably well established and a finalizer about merge, I think its time to add ourselves.

This pull wires kube-apiextensions-server ahead of the TPRs so that one will replace the other if both are added by accident (CRDs should have priority) and wires a controller for automatic aggregation.

WIP because I still need tests: unit test for controller, test-cmd test to mirror the TPR test.


```release-note
Adds the `CustomResourceDefinition` (crd) types to the `kube-apiserver`.  These are the successors to `ThirdPartyResource`.  See https://github.com/kubernetes/community/blob/master/contributors/design-proposals/thirdpartyresources.md for more details.
```
2017-05-22 19:59:57 -07:00
Kubernetes Submit Queue e823e60bbf Merge pull request #46022 from xilabao/add-rolebinding-to-describe-command
Automatic merge from submit-queue

add rolebinding/clusterrolebinding to describe.go

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

```
./cluster/kubectl.sh describe clusterrolebinding system:kube-dns
Name:		system:kube-dns
Labels:		kubernetes.io/bootstrapping=rbac-defaults
Annotations:	rbac.authorization.kubernetes.io/autoupdate=true
Role:
  Kind:	ClusterRole
  Name:	system:kube-dns
Subjects:
  Kind			Name		Namespace
  ----			----		---------
  ServiceAccount	kube-dns	kube-system
```

**Which issue this PR fixes**: 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-05-22 19:59:20 -07:00
Balu Dontu eb3cf509e5 SPBM policy ID support in vsphere cloud provider 2017-05-22 19:45:17 -07:00
System Administrator 83520a7470 Kubernetes core API changes for vSphere 2017-05-22 19:43:29 -07:00
xilabao d555b1e265 fix err message in storage extensions 2017-05-23 10:22:01 +08:00
Kubernetes Submit Queue 199465c3a5 Merge pull request #43663 from shiywang/quato
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

Fix command exec -- COMMAND can not contain spaces

Fixes https://github.com/kubernetes/kubernetes/issues/7688
the problem is when you execute command:
 `cluster/kubectl.sh exec -p client-blue-8yw37 -c client -i -t -- 'ls -t /usr'`
the args is 
[`client-blue-8yw37` , `ls -t /usr`] 
**instead of** 
[`client-blue-8yw37`, `ls`, `-t`, `/usr`]
@kubernetes/sig-cli-pr-reviews, so I add a warning, wdyt ?
cc @ymqytw @adohe @fabianofranz
2017-05-22 19:07:12 -07:00
Kubernetes Submit Queue c2c5051adf Merge pull request #44899 from smarterclayton/burst
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

Support parallel scaling on StatefulSets

Fixes #41255

```release-note
StatefulSets now include an alpha scaling feature accessible by setting the `spec.podManagementPolicy` field to `Parallel`.  The controller will not wait for pods to be ready before adding the other pods, and will replace deleted pods as needed.  Since parallel scaling creates pods out of order, you cannot depend on predictable membership changes within your set.
```
2017-05-22 19:07:09 -07:00
Kubernetes Submit Queue a31fda9950 Merge pull request #46225 from FengyunPan/fix-missing-close-file
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

Fix missing close file

None
2017-05-22 19:07:07 -07:00
Kubernetes Submit Queue 26a0db1722 Merge pull request #45781 from robertojrojas/issue_45736
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

kubectl: fixes issues #45736 and #45737

**What this PR does / why we need it**:
This PR improves the help displayed by the `kubectl proxy` command.

**Which issue this PR fixes**: 
fixes #45736, fixes #45737 

**Special notes for your reviewer**:
NONE

**Release note**:
NONE

```release-note
```
2017-05-22 19:07:04 -07:00
Kubernetes Submit Queue 503a8421fb Merge pull request #38990 from mikedanese/go-genrule-sets
Automatic merge from submit-queue (batch tested with PRs 38990, 45781, 46225, 44899, 43663)

migrate set generation to go_genrule

Depends on https://github.com/kubernetes/release/pull/238
2017-05-22 19:06:58 -07:00
Zihong Zheng 5f814d957e Detect ExternalTrafficPolicy and HealthCheckNodePort changes in needsUpdate() 2017-05-22 18:15:48 -07:00
Kubernetes Submit Queue 0671a46610 Merge pull request #46246 from derekwaynecarr/kubelet-events
Automatic merge from submit-queue

Fix kubelet event recording

**What this PR does / why we need it**:
There are numerous areas where the kubelet was not properly recording events due to an incorrect type.

To keep this small, I updated all references to `RefManager` that result in throwing an event to ensure it does a conversion.

**Which issue this PR fixes**
Fixes https://github.com/kubernetes/kubernetes/issues/46241
Fixes #44348
Fixes #44652

**Special notes for your reviewer**:
I updated all references I could find to the existing RefManager in kubelet.

**Release note**:
```release-note
fix kubelet event recording for selected events.
```
2017-05-22 18:12:32 -07:00
Roberto J Rojas e24384643e kubectl: fixes issues #45736 and #45737
Adds long description from #45902
2017-05-22 18:57:11 -04:00
Michelle Au 5fcb82dde9 Fix storage node affinity helpers 2017-05-22 15:30:27 -07:00
Michelle Au dd46c7f88e Local volume plugin 2017-05-22 14:44:51 -07:00
Michelle Au 06f25b03eb Check volume node affinity before mount 2017-05-22 14:44:06 -07:00
Michelle Au 6ade5461ad Add GetNodeLabels to VolumeHost interface 2017-05-22 14:44:06 -07:00
Kubernetes Submit Queue f6b3d083b7 Merge pull request #44640 from msau42/local-pv-api
Automatic merge from submit-queue

LocalStorage api

**What this PR does / why we need it**:
API changes to support persistent local volumes, as described [here](https://github.com/kubernetes/community/pull/306)

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

**Special notes for your reviewer**:
There were a few items I was concerned about.  Will add review comments in those places.

**Release note**:

NONE

Note will be added in subsequent PR with the volume plugin changes
2017-05-22 14:39:05 -07:00
Derek Carr f59069720e Fix kubelet event recording 2017-05-22 17:24:36 -04:00
Eric Tune 12fbd82529 Merge pull request #45301 from erictune/disrupt-approve
Move PDB controller and type ownership to SIG-Apps
2017-05-22 14:21:41 -07:00
Kubernetes Submit Queue 91adb3eacf Merge pull request #44906 from k82cn/moved_qos_to_v1helper
Automatic merge from submit-queue

Moved qos to api.helpers.

**What this PR does / why we need it**:
The `GetPodQoS` is also used by other components, e.g. kube-scheduler and it's not bound to kubelet; moved it to api helpers so client-go.

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

**Release note**:

```release-note-none
```
2017-05-22 13:30:06 -07:00
Eric Tune b17e3c14eb Move PDB controller and type ownership to SIG-Apps
Created OWNERS_ALIASES called sig-apps-reviewers from the union of reviewers in:
 pkg/controller/{cronjob,deployment,daemon,job,replicaset,statefulset}/OWNERS
except removed inactive user bprashanth

Created OWNERS_ALIASES called sig-apps-api-reviewers as the intersection
of sig-apps-reviewers and the approvers from pkg/api/OWNERS.

Used those OWNERS_ALIASES as the reviewers/approvers for the disruption controller,
and API.
2017-05-22 12:55:28 -07:00
Humble Chirammal 04bf95a5d1 Add `auto_unmount` mount option for glusterfs fuse mount.
libfuse has an auto_unmount option which, if enabled, ensures that
the file system is unmounted at FUSE server termination by running a
separate monitor process that performs the unmount when that occurs.
(This feature would probably better be called "robust auto-unmount",
as FUSE servers usually do try to unmount their file systems upon
termination, it's just this mechanism is not crash resilient.)
This change implements that option and behavior for glusterfs.

This option will be only supported for clients with version >3.11.

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-05-22 23:50:54 +05:30
Alexander Campbell c9c8d61048 Merge branch 'master' into correct-deprecation-errors 2017-05-22 09:55:07 -07:00
Andy Goldstein 2480f2ceb6 Use shared informers in gc controller if possible 2017-05-22 12:51:37 -04:00
Kubernetes Submit Queue 16b5093feb Merge pull request #46037 from ncdc/ns-controller-aggregate-errors
Automatic merge from submit-queue (batch tested with PRs 46164, 45471, 46037)

NS controller: don't stop deleting GVRs on error

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

If the namespace controller encounters an error trying to delete a
single GroupVersionResource, add the error to an aggregated list of
errors and continue attempting to delete all the GroupVersionResources
instead of stopping at the first error. Return the aggregated error list
(if any) when done. This allows us to delete as much of the content in
the namespace as we can in each pass.

**Special notes for your reviewer**:

This may help with some of the namespace deletions taking too long in our e2e tests.

**Release note**:

```release-note
```
2017-05-22 09:08:56 -07:00
Kubernetes Submit Queue 451d47889c Merge pull request #45471 from CaoShuFeng/useless_validate
Automatic merge from submit-queue (batch tested with PRs 46164, 45471, 46037)

validate oidc flags

This change validate oidc flags for kube-apiserver.



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

```NONE
```
2017-05-22 09:08:54 -07:00
Kubernetes Submit Queue 574608d2e9 Merge pull request #46169 from kargakis/progress-when-ready
Automatic merge from submit-queue (batch tested with PRs 45864, 46169)

Account newly ready replicas as progress

@kubernetes/sig-apps-pr-reviews
2017-05-22 08:08:56 -07:00
FengyunPan ae7bf3e649 Fix missing close file 2017-05-22 22:02:55 +08:00
deads2k 446e959bf7 make CRD apiservice controller 2017-05-22 08:54:14 -04:00
Wojciech Tyczynski 9e6de42745 Remove Save() from iptables interface 2017-05-22 13:23:49 +02:00
Cao Shufeng b5e6859d92 Remove deprecated variable RBACSuperUser
authorization-rbac-super-user is deprecated now. So we can remove
the vaiable. Further more the comment about this variable is wrong.
Remove them also.
2017-05-22 19:10:32 +08:00
Cao Shufeng 9710eb62ae validate oidc flags
This change validate oidc flags for kube-apiserver.
2017-05-22 18:03:28 +08:00
Kubernetes Submit Queue cdbfec3148 Merge pull request #43501 from xingzhou/kube-43126
Automatic merge from submit-queue

Use TabWriter to keep output of "kubectl get xx -w" aligned.

Use TabWriter to keep output of "kubectl get xx -w" aligned.

fixed #43126
2017-05-22 00:22:40 -07:00
Wojciech Tyczynski ee505677f7 Address remaining TODOs in kube-proxy. 2017-05-22 09:18:55 +02:00
Jago Macleod 185e85b632 Rename readme.md to README.md 2017-05-21 23:06:46 -07:00
Jeffrey Regan 5a9b06b717 **What this PR does / why we need it**:
Remove kubectl's dependence on pkg/api/helper, as part of
broader effort to isolate kubectl from the rest of k8s.
In this case, the code becomes private to kubectl; nobody else uses it.

**Which issue this PR fixes**

Part of a series of PRs to address kubernetes/community#598

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-05-21 20:44:21 -07:00
NickrenREN 18852c58c1 Recording openstack metrics
add openstack operation metrics
Add support for emitting metrics from openstack cloudprovider about storage operations.
2017-05-22 10:47:08 +08:00
Michelle Au 936269a2eb Generated code for local persistent volumes 2017-05-21 12:20:23 -07:00
Michelle Au d848be195f API changes for persistent local volumes.
Includes:
- A new volume type, LocalVolumeSource.  This only supports
file-based local volumes for now.
- New alpha annotation in PV: NodeAffinity
- Validation + tests for specifying LocalVolumeSource and PV
NodeAffinity
- Alpha feature gate
2017-05-21 11:48:56 -07:00
Kubernetes Submit Queue c1f8fcd9fe Merge pull request #45496 from andyxning/fix_pleg_relist_time
Automatic merge from submit-queue

fix pleg relist time

This PR fix pleg reslist time. According to current implementation, we have a `Healthy` method periodically check the relist time. If current timestamp subtracts latest relist time is longer than `relistThreshold`(default is 3 minutes), we should return an error to indicate the error of runtime.

`relist` method is also called periodically. If runtime(docker) hung, the relist method should return immediately without updating the latest relist time. If we update latest relist time no matter runtime(docker) hung(default timeout is 2 minutes), the `Healthy` method will never return an error.

```release-note
Kubelet PLEG updates the relist timestamp only after successfully relisting.
```

/cc @yujuhong @Random-Liu @dchen1107
2017-05-21 04:17:14 -07:00
Kubernetes Submit Queue 39308b8980 Merge pull request #38959 from Gradiant/master
Automatic merge from submit-queue

Adapt loadbalancer deleting/updating when using cloudprovider openstack in openstack/liberty

**What this PR does / why we need it**:
Make an extra verification on the returned listeners and pools because gophercloud query doesn't filter the results by loadbalancerID / listenerID respectively when using **openstack/librerty**.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
#33759 
**Special notes for your reviewer**:
#33759 it's supposed to have a pull request which fixes this problem but in the release  1.5 loadbalancers doesn't use that patched code.
**Release note**:

NONE
```release-note
```
2017-05-21 03:22:02 -07:00
Kubernetes Submit Queue 336fb2f508 Merge pull request #45933 from smarterclayton/secret_reuse
Automatic merge from submit-queue

Move the remaining controllers to shared informers

Completes work done in 1.6 to move the last two hold outs to shared informers - tokens controller and scheduler. Adds a few more tools to allow informer reuse (like filtering the informer, or maintaining a mutation cache).

The mutation cache is identical to #45838 and will be removed when that merges

@ncdc @deads2k extracted from openshift/origin#14086
2017-05-20 23:08:09 -07:00
Clayton Coleman 20d45af694
Combine statefulset burst and monotonic scaling tests
Use subtests to avoid duplicating entire suite of control logic.
2017-05-21 01:14:30 -04:00
Clayton Coleman 2861ae5eb9
Support burst in stateful set scale up and down
The alpha field podManagementPolicy defines how pods are created,
deleted, and replaced. The new `Parallel` policy will replace pods
as fast as possible, not waiting for the pod to be `Ready` or providing
an order. This allows for advanced clustered software to take advantage
of rapid changes in scale.
2017-05-21 01:14:26 -04:00
Clayton Coleman ad720cc651
generated: bazel 2017-05-20 21:58:38 -04:00
Michail Kargakis 7910dc3131
Account newly ready replicas as progress
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-05-20 21:14:50 +02:00
Clayton Coleman 784e3ae5fa
Switch the tokens controller to use shared informers
Tokens controller previously needed a bit of extra help in order to be
safe for concurrent use. The new MutationCache allows it to keep a local
cache and still use a shared informer. The filtering event handler lets
it only see changes to secrets it cares about.
2017-05-20 14:19:49 -04:00
Clayton Coleman 3e095d12b4
Refactor move of client-go/util/clock to apimachinery 2017-05-20 14:19:48 -04:00
Wojciech Tyczynski 7ba30afbed Fix codestyle 2017-05-20 18:46:29 +02:00
Wojciech Tyczynski 758c9666e5 Call syncProxyRules when really needed and remove reasons 2017-05-20 18:46:28 +02:00
Wojciech Tyczynski c0c41aa083 Check whether service changed 2017-05-20 14:22:56 +02:00
Wojciech Tyczynski 05ffcccdc1 Check whether endpoints change 2017-05-20 14:22:07 +02:00
Wojciech Tyczynski 37a6989c79 Cleanup iptables proxier 2017-05-20 14:17:03 +02:00
Klaus Ma 83b7f77ee2 Moved qos to api.helpers. 2017-05-20 07:17:57 -04:00
lixiaobing1 6949b5dbe7 break the loop when found true
Signed-off-by: lixiaobing1 <li.xiaobing1@zte.com.cn>
2017-05-20 15:22:07 +08:00
Kubernetes Submit Queue 8fe818b2a1 Merge pull request #45981 from fabianofranz/kubectl_plugins_v1_part1
Automatic merge from submit-queue (batch tested with PRs 46033, 46122, 46053, 46018, 45981)

Command tree and exported env in kubectl plugins

This is part of `kubectl` plugins V1:
- Adds support to several env vars passing context information to the plugin. Plugins can make use of them to connect to the REST API, access global flags, get the path of the plugin caller (so that `kubectl` can be invoked) and so on. Exported env vars include
  - `KUBECTL_PLUGINS_DESCRIPTOR_*`: the plugin descriptor fields
  - `KUBECTL_PLUGINS_GLOBAL_FLAG_*`: one for each global flag, useful to access namespace, context, etc
  - ~`KUBECTL_PLUGINS_REST_CLIENT_CONFIG_*`: one for most fields in `rest.Config` so that a REST client can be built.~
  - `KUBECTL_PLUGINS_CALLER`: path to `kubectl`
  - `KUBECTL_PLUGINS_CURRENT_NAMESPACE`: namespace in use
- Adds support for plugins as child of other plugins so that a tree of commands can be built (e.g. `kubectl myplugin list`, `kubectl myplugin add`, etc)

**Release note**:

```release-note
Added support to a hierarchy of kubectl plugins (a tree of plugins as children of other plugins).

Added exported env vars to kubectl plugins so that plugin developers have access to global flags, namespace, the plugin descriptor and the full path to the caller binary.
```
@kubernetes/sig-cli-pr-reviews
2017-05-19 23:29:32 -07:00
Kubernetes Submit Queue 3456d4d239 Merge pull request #46033 from wojtek-t/reduce_memory_allocations_in_kube_proxy
Automatic merge from submit-queue

Reduce memory allocations in kube proxy

Memory allocation (and Go GarbageCollection) seems to be one of the most expensive operations in kube-proxy (I've seen profiles where it was more than 50%).

The commits are mostly independent from each other and all of them are mostly about reusing already allocated memory.

This PR is reducing memory allocation by ~5x (results below from 100-node load test):

before:
```
(pprof) top
38.64GB of 39.11GB total (98.79%)
Dropped 249 nodes (cum <= 0.20GB)
Showing top 10 nodes out of 61 (cum >= 0.20GB)
      flat  flat%   sum%        cum   cum%
   15.10GB 38.62% 38.62%    15.10GB 38.62%  bytes.makeSlice
    9.48GB 24.25% 62.87%     9.48GB 24.25%  runtime.rawstringtmp
    8.30GB 21.21% 84.07%    32.47GB 83.02%  k8s.io/kubernetes/pkg/proxy/iptables.(*Proxier).syncProxyRules
    2.08GB  5.31% 89.38%     2.08GB  5.31%  fmt.(*fmt).padString
    1.90GB  4.86% 94.24%     3.82GB  9.77%  strings.Join
    0.67GB  1.72% 95.96%     0.67GB  1.72%  runtime.hashGrow
    0.36GB  0.92% 96.88%     0.36GB  0.92%  runtime.stringtoslicebyte
    0.31GB  0.79% 97.67%     0.62GB  1.58%  encoding/base32.(*Encoding).EncodeToString
    0.24GB  0.62% 98.29%     0.24GB  0.62%  strings.genSplit
    0.20GB   0.5% 98.79%     0.20GB   0.5%  runtime.convT2E
```

after:
```
7.94GB of 8.13GB total (97.75%)
Dropped 311 nodes (cum <= 0.04GB)
Showing top 10 nodes out of 65 (cum >= 0.11GB)
      flat  flat%   sum%        cum   cum%
    3.32GB 40.87% 40.87%     8.05GB 99.05%  k8s.io/kubernetes/pkg/proxy/iptables.(*Proxier).syncProxyRules
    2.85GB 35.09% 75.95%     2.85GB 35.09%  runtime.rawstringtmp
    0.60GB  7.41% 83.37%     0.60GB  7.41%  runtime.hashGrow
    0.31GB  3.76% 87.13%     0.31GB  3.76%  runtime.stringtoslicebyte
    0.28GB  3.43% 90.56%     0.55GB  6.80%  encoding/base32.(*Encoding).EncodeToString
    0.19GB  2.29% 92.85%     0.19GB  2.29%  strings.genSplit
    0.18GB  2.17% 95.03%     0.18GB  2.17%  runtime.convT2E
    0.10GB  1.28% 96.31%     0.71GB  8.71%  runtime.mapassign
    0.10GB  1.21% 97.51%     0.10GB  1.21%  syscall.ByteSliceFromString
    0.02GB  0.23% 97.75%     0.11GB  1.38%  syscall.SlicePtrFromStrings
```
2017-05-19 23:21:49 -07:00
Kubernetes Submit Queue 4f55f49035 Merge pull request #46042 from derekwaynecarr/quota-admission-registry
Automatic merge from submit-queue (batch tested with PRs 45346, 45903, 45958, 46042, 45975)

ResourceQuota admission control injects registry

**What this PR does / why we need it**:
The `ResourceQuota` admission controller works with a registry that maps a GroupKind to an Evaluator.  The registry used in the existing plug-in is not injectable, which makes usage of the ResourceQuota plug-in in other API server contexts difficult.  This PR updates the code to support late injection of the registry via a plug-in initializer.
2017-05-19 22:29:34 -07:00
Kubernetes Submit Queue 113cf85612 Merge pull request #45903 from brendandburns/azure-disk-api
Automatic merge from submit-queue (batch tested with PRs 45346, 45903, 45958, 46042, 45975)

Azure disk api

This is to update the AzureDiskApi and split it from the implementation which is caught in rebase hell...

Once this is merged, we'll get the implementation in.

@smarterclayton suggested this as a way to break the rebase hell logjam. request for a quick review.

Thanks!
2017-05-19 22:29:30 -07:00
Kubernetes Submit Queue f499606bfe Merge pull request #45346 from codablock/fix_double_attach
Automatic merge from submit-queue

Don't try to attach volumes which are already attached to other nodes

This PR is a replacement for https://github.com/kubernetes/kubernetes/pull/40148. I was not able to push fixes and rebases to the original branch as I don't have access to the Github organization anymore.

CC @saad-ali You probably have to update the PR link in [Q2 2017 (v1.7)](https://docs.google.com/spreadsheets/d/1t4z5DYKjX2ZDlkTpCnp18icRAQqOE85C1T1r2gqJVck/edit#gid=14624465)

I assume the PR will need a new "ok to test" 

**ORIGINAL PR DESCRIPTION**

This PR fixes an issue with the attach/detach volume controller. There are cases where the `desiredStateOfWorld` contains the same volume for multiple nodes, resulting in the attach/detach controller attaching this volume to multiple nodes. This of course fails for volumes like AWS EBS, Azure Disks, ...

I observed this situation on Azure when using Azure Disks and replication controllers which start to reschedule PODs. When you delete a POD that belongs to a RC, the RC will immediately schedule a new POD on another node. This results in a short time (max a few seconds) where you have 2 PODs which try to attach/mount the same volume on different nodes. As the old POD is still alive, the attach/detach controller does not try to detach the volume and starts to attach the volume to the new POD immediately.

This behavior was probably not noticed before on other clouds as the bogus attempt to attach probably fails pretty fast and thus is unnoticed. As the situation with the 2 PODs disappears after a few seconds, a detach for the old POD is initiated and thus the new POD can attach successfully.

On Azure however, attaching and detaching takes quite long, resulting in the first bogus attach attempt to already eat up much time.
When attaching fails on Azure and reports that it is already attached somewhere else, the cloud provider immediately does a detach call for the same volume+node it tried to attach to. This is done to make sure the failed attach request is aborted immediately. You can find this here: https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/providers/azure/azure_storage.go#L74

The complete flow of attach->fail->abort eats up valuable time and the attach/detach controller can not proceed with other work while this is happening. This means, if the old POD disappears in the meantime, the controller can't even start the detach for the volume which delays the whole process of rescheduling and reattaching.

Also, I and other people have observed very strange behavior where disks ended up being "attached" to multiple VMs at the same time as reported by Azure Portal. This results in the controller to fail reattaching forever. It's hard to figure out why and when this happens and there is no reproducer known yet. I can imagine however that the described behavior correlates with what I described above.

I was not sure if there are actually cases where it is perfectly fine to have a volume mounted to multiple PODs/nodes. At least technically, this should be possible with network based volumes, e.g. nfs. Can someone with more knowledge about volumes help me here? I may need to add a check before skipping attaching in `reconcile`.

CC @colemickens @rootfs

-->
```release-note
Don't try to attach volume to new node if it is already attached to another node and the volume does not support multi-attach.
```
2017-05-19 21:54:42 -07:00
Kubernetes Submit Queue 2473c24f81 Merge pull request #45979 from bowei/owners
Automatic merge from submit-queue

Add bowei to OWNERS: e2e/test dns,network; cloud route, node, service…
2017-05-19 19:39:05 -07:00
Kubernetes Submit Queue 83a1a863ad Merge pull request #45564 from whitlockjc/admission-api-group
Automatic merge from submit-queue (batch tested with PRs 45996, 46121, 45707, 46011, 45564)

add "admission" API group

This commit is an initial pass at providing an admission API group.
The API group is required by the webhook admission controller being
developed as part of https://github.com/kubernetes/community/pull/132
and could be used more as that proposal comes to fruition.

**Note:** This PR was created by following the [Adding an API Group](https://github.com/kubernetes/community/blob/master/contributors/devel/adding-an-APIGroup.md) documentation.

cc @smarterclayton
2017-05-19 18:57:38 -07:00
Kubernetes Submit Queue 1c8d255819 Merge pull request #46121 from Random-Liu/fix-kuberuntime-getpods
Automatic merge from submit-queue (batch tested with PRs 45996, 46121, 45707, 46011, 45564)

Fix kuberuntime GetPods.

The `ImageID` is not populated from `GetPods` in kuberuntime.

Image garbage collector is using this field, https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/images/image_gc_manager.go#L204.

Without this fix, image garbage collector will try to garbage collect all images every time. Because docker will not allow that, it should be fine. However, I'm not sure whether the unnecessary remove will cause any problem, e.g. overload docker image management system and make docker hang.

@dchen1107 @yujuhong @feiskyer Do you think we should cherry-pick this?
2017-05-19 18:57:33 -07:00
Jonathan MacMillan af2a8f7e8a [Federation] Use service accounts instead of the user's credentials when accessing joined clusters' API servers. 2017-05-19 18:05:09 -07:00
Fabiano Franz 18cb56bf78 kubectl plugins have access config, global flags and environment 2017-05-19 19:17:43 -03:00
Bowei Du 3af1c0efcb Add bowei to OWNERS: e2e/test dns,network; cloud route, node, service controller 2017-05-19 14:49:43 -07:00
Alexander Campbell 5e1a3fd020 kubectl: improve deprecatedAlias unit test
Two new behaviors are tested:

 1. The output message that deprecatedAlias gives when it is called must
    include the word "deprecatated" and the name of the new function
    that the user should use instead.
 2. The correct function must be called by the alias (alias should "fall
    back" to the functionality of the original.
2017-05-19 14:49:03 -07:00
Alexander Campbell 487398ebf9 Merge branch 'master' into correct-deprecation-errors 2017-05-19 14:20:05 -07:00
Fabiano Franz da85262f70 Adds support to a tree hierarchy of kubectl plugins 2017-05-19 18:06:15 -03:00
Kubernetes Submit Queue 8d0cce3f91 Merge pull request #46052 from davidewatson/spelling
Automatic merge from submit-queue

Correct spelling in comment

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

Corrects two misspelled names in a comment.

**Which issue this PR fixes**:

N/A

**Special notes for your reviewer**:

NONE

**Release note**:

NONE
2017-05-19 13:42:31 -07:00
Luis Pabón 67d269749b aws: Support for ELB tagging by users
This PR provides support for tagging AWS ELBs using information in an
annotation and provided as a list of comma separated key-value pairs.

Closes https://github.com/kubernetes/community/pull/404
2017-05-19 16:34:50 -04:00
Alexander Campbell 213f3c7e6e Merge branch 'master' into correct-deprecation-errors 2017-05-19 12:58:42 -07:00
Wojciech Tyczynski a3da8d7300 Fix naming and comments in kube-proxy. 2017-05-19 21:34:05 +02:00
Jago Macleod 0cab203fbd Added deprecation notice and guidance for cloud providers. 2017-05-19 12:17:09 -07:00
Kubernetes Submit Queue 69ce7d8475 Merge pull request #44606 from ivan4th/fix-serialization-of-enforce-node-allocatable
Automatic merge from submit-queue (batch tested with PRs 44606, 46038)

Fix serialization of EnforceNodeAllocatable

EnforceNodeAllocatable being `nil` and `[]` are treated in different
ways by kubelet. Namely, `nil` is replaced with `[]string{"pods"}` by
the defaulting mechanism.

E.g. if you run kubelet in Docker-in-Docker environment
you may need to run it with the following options:
`--cgroups-per-qos=false --enforce-node-allocatable=`
(this corresponds to EnforceNodeAllocatable being empty array and not
null) If you then grab kubelet configuration via /configz and try to
reuse it for dynamic kubelet config, kubelet will think that
EnforceNodeAllocatable is null, failing to run in the
Docker-in-Docker environment.

Encountered this while updating Virtlet for Kubernetes 1.6
(the dev environment is based on kubeadm-dind-cluster)
2017-05-19 11:52:03 -07:00
Random-Liu 4935e119da Fix kuberuntime GetPods. 2017-05-19 11:47:45 -07:00
Wojciech Tyczynski 7d44f83441 Descrese logs verbosity for iptables 2017-05-19 20:44:26 +02:00
Wojciech Tyczynski e3bb755270 Reuse buffers for generated iptables rules 2017-05-19 20:44:26 +02:00
Wojciech Tyczynski 4d29c8608f Avoid strings.Join which is expensive 2017-05-19 20:44:25 +02:00
Wojciech Tyczynski 5464c39333 Reuse buffer for getting iptables contents 2017-05-19 20:44:25 +02:00
Wojciech Tyczynski bcfae7e1ed Extend Iptables interface with SaveInto 2017-05-19 20:44:25 +02:00
Wojciech Tyczynski 028ac8034b Remove SaveAll from iptables interface 2017-05-19 20:44:25 +02:00
Alexander Campbell ca899ec048 kubectl: write unit test for deprecatedAlias() 2017-05-19 11:25:11 -07:00
Kubernetes Submit Queue ea828d05b8 Merge pull request #46028 from humblec/iscsi-describe
Automatic merge from submit-queue (batch tested with PRs 46028, 46104)

Add missing parameters of iscsi volume source to describe printer.
2017-05-19 10:58:04 -07:00
Alexander Campbell 2f0faedbee kubectl: make "Deprecated" a private function
There's no reason to export this function, so I've made it private.
2017-05-19 10:45:49 -07:00
Alexander Campbell bf2fc62144 kubectl: renmae deprecatedCmd -> deprecatedAlias
This will clear up some of the confusion around the deprecatedCmd /
Deprecated function.
2017-05-19 10:40:21 -07:00
Kubernetes Submit Queue 4d89212d26 Merge pull request #44898 from xingzhou/kube-44697
Automatic merge from submit-queue (batch tested with PRs 45908, 44898)

While calculating pod's cpu limits, need to count in init-container.

Need to count in init-container when calculating a pod's cpu limits.
Otherwise, may cause pod start failure due to "invalid argument"
error while trying to write "cpu.cfs_quota_us" file.

Fixed #44697 

Release note:
```
NONE
```
2017-05-19 09:39:04 -07:00
Jeremy Whitlock 1b59dd887d add "admission" API group
This commit is an initial pass at providing an admission API group.
The API group is required by the webhook admission controller being
developed as part of https://github.com/kubernetes/community/pull/132
and could be used more as that proposal comes to fruition.
2017-05-19 10:17:37 -06:00
Alexander Campbell acfdafb1fb Merge branch 'master' into correct-deprecation-errors 2017-05-19 08:55:17 -07:00
Alexander Campbell b3fc6556e4 kubectl: improve docstring on deprecatedCmd 2017-05-19 08:55:12 -07:00
Kubernetes Submit Queue ff7b3653fd Merge pull request #46095 from wojtek-t/avoid_sleep_in_endpoint_controller
Automatic merge from submit-queue (batch tested with PRs 46075, 46059, 46095, 46097)

Avoid sleep in endpoint controller
2017-05-19 08:35:10 -07:00
Wojciech Tyczynski d2529bb6b6 Avoid sleep in endpoint controller 2017-05-19 13:57:36 +02:00
Shiyang Wang 95fb791b3f Add Simplified Chinese translation for kubectl
update

update
2017-05-19 16:18:24 +08:00
realfake 250b229912 Implement providerID node functions for gce
*Add splitProviderID helper function
*Add getInstanceFromProjectInZoneByName function
*Implement gce InstanceTypeByProviderID
*Implement gce NodeAddressesByProviderID
2017-05-19 08:41:54 +02:00
Kubernetes Submit Queue d81da03132 Merge pull request #45960 from pmichali/issue45906
Automatic merge from submit-queue

IPv6 support for hexCIDR()

Includes these changes:
- Modified so that IPv6 CIDRs can be converted correctly.
- Added test cases for IPv6 addresses.
- Split UTs for hexCIDR() and asciiCIDR() so that masking can be tested.
- Add UTs for failure cases.

Note: Some code that calls hexCIDR() builds a CIDR from the pod IP string
and the concatenation of "/32". These should, in the future, use "128",
if/when the pod IP is IPv6. Not addressed as part of this commit.



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

**Special notes for your reviewer**:

**Release note**:

```release-noteNONE
```
2017-05-18 22:40:31 -07:00
Xing Zhou 22ab45b575 While calculating pod's cpu limits, need to count in init-container.
Need to count in init-container when calculating a pod's cpu limits.
Otherwise, may cause pod start failure due to "invalid argument"
error while trying to write "cpu.cfs_quota_us" file.
2017-05-19 12:31:27 +08:00
zhengjiajin ddcbc47f18 add test for set image validation 2017-05-19 12:15:49 +08:00
Kubernetes Submit Queue ead8c98cdb Merge pull request #45987 from nicksardo/cloud-init-kubeclient
Automatic merge from submit-queue

Initialize cloud providers with a K8s clientBuilder

**What this PR does / why we need it**:
This PR provides each cloud provider the ability to generate kubernetes clients. Either the full access or service account client builder is passed from the controller manager. Cloud providers could need to retrieve information from the cluster that isn't provided through defined interfaces, and this seems more preferable to adding parameters.

Please leave your thoughts/comments.

**Release note**:
```release-note
NONE
```
2017-05-18 20:51:24 -07:00
Brendan Burns 97f6c52ffd more stuff. 2017-05-18 20:31:10 -07:00
Derek Carr a71bea312a ResourceQuota admission control injects registry 2017-05-18 23:17:13 -04:00
Kubernetes Submit Queue a9fbeef694 Merge pull request #45929 from liggitt/node-admission
Automatic merge from submit-queue (batch tested with PRs 41535, 45985, 45929, 45948, 46056)

NodeRestriction admission plugin

Adds an optional `NodeRestriction` admission plugin that limits identifiable kubelets to mutating their own Node object, and Pod objects bound to their node.

This is the admission portion of https://github.com/kubernetes/community/blob/master/contributors/design-proposals/kubelet-authorizer.md and kubernetes/features#279

```release-note
The `NodeRestriction` admission plugin limits the `Node` and `Pod` objects a kubelet can modify. In order to be limited by this admission plugin, kubelets must use credentials in the `system:nodes` group, with a username in the form `system:node:<nodeName>`. Such kubelets will only be allowed to modify their own `Node` API object, and only modify `Pod` API objects that are bound to their node.
```
2017-05-18 19:58:13 -07:00
Kubernetes Submit Queue f57f0388db Merge pull request #41535 from aanm/adding-ipv6-brackets
Automatic merge from submit-queue (batch tested with PRs 41535, 45985, 45929, 45948, 46056)

kubelet/envvars: Adding brackets to IPv6 addresses

Signed-off-by: André Martins <aanm90@gmail.com>

**What this PR does / why we need it**: This adds IPv6 brackets on environments variables pods

**Special notes for your reviewer**:

Since the IP is a string I think the fastest way to detect if it's an IPv6 was to check for the presence of `:` in it. Let me know what you think.
2017-05-18 19:58:07 -07:00
xilabao e0b4f3f73c remove --api-version 2017-05-19 10:56:35 +08:00
Alexander Campbell 9e7f29c3fb cmd: fix deprecation warning bug
Some kubectl commands were deprecated but would fail to print the
correct warning message when a flag was given before the command name.

	# Correctly prints the warning that "resize" is deprecated and
	# "scale" is now preferred.
	kubectl scale [...]

	# Should print the same warning but no warning is printed.
	kubectl --v=1 scale [...]

This was due to a fragile check on os.Args[1].

This commit implements a new function deprecatedCmd() that is used to
construct new "passthrough" commands which are marked as deprecated and
hidden.

Note that there is an existing "filters" system that may be preferable
to the system created in this commit. I'm not sure why the "filters"
array was not used for all deprecated commands in the first place.
2017-05-18 16:48:13 -07:00
Zihong Zheng f0739a5638 Randomize test nodePort to prevent collision 2017-05-18 15:29:22 -07:00
Kubernetes Submit Queue 17b22cb01c Merge pull request #45315 from timstclair/audit-api
Automatic merge from submit-queue

Advanced audit logging API

This is an initial implementation of the API proposed in https://github.com/kubernetes/community/blob/master/contributors/design-proposals/auditing.md

This deviates from the exact API specified in the proposal in a number of ways. Here's a list of some of the changes I made, and why:

- General API conformance (`metav1.{Type,List}Meta`, +optional, etc.)
- Dropped fields that won't be part of the initial implementation (storage objects & filters), to be added later
- {Request,Response}Body -> {Request,Response}Object - This is actually what the proposal originally had, and will be much better for adding Filters later, and provides a less protocol-dependent API. Note that there is currently no way to include Response body for non-resource requests.
- Drop HttpMethod - redundant with verb
- Response{StatusCode,ErrorMessage} collapsed into `ResponseStatus *metav1.Status` - This is the standard response type for resourec errors, but can hold genereric error responses too. Note that this is part of the `Metadata` Level.

/cc @kubernetes/sig-auth-api-reviews @kubernetes/api-reviewers
2017-05-18 14:23:53 -07:00
Jordan Liggitt 0c516c3ac2
Add NodeIdentifier interface and default implementation 2017-05-18 16:43:41 -04:00
David E Watson 204fb62d49 Correct spelling in comment. 2017-05-18 13:31:26 -07:00
Kubernetes Submit Queue be71ec717b Merge pull request #45201 from vmware/network_id
Automatic merge from submit-queue

Same internal and external ip for vSphere Cloud Provider

Currently, vSphere Cloud Provider reports internal ip as container ip addresses. This PR modifies vSphere Cloud Provider to report same ip address as both internal and external that is provided by vmware infrastructure. 
cc @pdhamdhere @tusharnt @BaluDontu @divyenpatel @luomiao
2017-05-18 13:31:02 -07:00
Jordan Liggitt d609f4ebca
Add pod util for extracting referenced configmaps 2017-05-18 15:38:29 -04:00
Kubernetes Submit Queue 5f3f170919 Merge pull request #39488 from liggitt/flex-metadata
Automatic merge from submit-queue

Pass pod metadata to flex plugin

Normal volume plugins get the pod spec to pull information from when setting up their volume, but flex plugins do not.

If a flex volume wants to set up things unique to the pod, or limited in permission based on the service account, the pod namespace, name, uid, and service account name are needed.

This PR adds pod uid, name, namespace, and service account name to the options passed to the plugin available during mounting

```release-note
The options passed to a flexvolume plugin's mount command now contains the pod name (`kubernetes.io/pod.name`), namespace (`kubernetes.io/pod.namespace`), uid (`kubernetes.io/pod.uid`), and service account name (`kubernetes.io/serviceAccount.name`).
```
2017-05-18 12:29:04 -07:00
Fabiano Franz 3bb04c67cc More cli sanity verifications 2017-05-18 15:44:49 -03:00
Brendan Burns 83e856411d generated stuff 2017-05-18 11:38:56 -07:00
Brendan Burns 4177b28e5a Add new AzureDisk API, but not implementation. 2017-05-18 11:36:42 -07:00
Kubernetes Submit Queue f231576f29 Merge pull request #45443 from abrarshivani/owners_cloud_providers
Automatic merge from submit-queue

Add approvers to vsphere cloudprovider

This PR adds approvers for vSphere Cloud provider.
cc @pdhamdhere @tusharnt @BaluDontu @divyenpatel @luomiao
2017-05-18 11:36:25 -07:00