Commit Graph

29122 Commits (8cccc022b05dc6fb130295a97373b06735a636cc)

Author SHA1 Message Date
David Eads 1fd4149ed4 update describer to use dynamic client 2018-05-11 07:59:08 -04:00
Weibin Lin 10664ee8c6 Add comments for ipset entries in kube-proxy 2018-05-11 17:11:34 +08:00
Harry Zhang 7f01ce4ec0 Update generated bazel 2018-05-11 14:25:23 +08:00
Harry Zhang 0377c69aad Use simple cache instead of LRU
Update generated bazel

Use map instead
2018-05-11 14:25:17 +08:00
Kubernetes Submit Queue 7eb88f11d2
Merge pull request #59727 from wgliang/master.time
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

should use time.Since instead of time.Now().Sub

**What this PR does / why we need it**:
should use time.Since instead of time.Now().Sub

**Special notes for your reviewer**:
2018-05-10 20:29:40 -07:00
Kubernetes Submit Queue 8d80d5df59
Merge pull request #63685 from nicksardo/patch-bs
Automatic merge from submit-queue (batch tested with PRs 62244, 63685). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

GCE: Add Patch method to GA Backend Services

**What this PR does / why we need it**:
Generates the Patch API call for GA Backend Services.

**Special notes for your reviewer**:
/cc @rramkumar1 

**Release note**:
```release-note
NONE
```
2018-05-10 16:30:10 -07:00
Kubernetes Submit Queue 6203b621ba
Merge pull request #62244 from CaoShuFeng/raw
Automatic merge from submit-queue (batch tested with PRs 62244, 63685). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix "kubectl create --raw"

Before this change:
```
$ kubectl create -f  pod.json --raw=https://172.16.29.130:443/api/v1/namespaces/default/pods  --as=tom --as-group=aaaaa
Error from server (Forbidden): unknown
```

After this change:
```
$ kubectl create -f pod.json --raw=https://172.16.29.130:443/api/v1/namespaces/default/pods  --as=tom --as-group=aaaaa
Error from server (Forbidden): pods is forbidden: User "tom" cannot create pods in the namespace "default"
```

/assign @soltysh 
**Release note**:

```release-note
NONE
```
2018-05-10 16:30:07 -07:00
Kubernetes Submit Queue 143d3b8824
Merge pull request #63561 from juanvallejo/jvallejo/make-opinionated-print-flags-constructor
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove legacyscheme dep from printFlags

**Release note**:
```release-note
NONE
```

Breaks PrintFlags dependency on legacyscheme
Prerequisite to https://github.com/kubernetes/kubernetes/pull/63402

cc @deads2k @soltysh
2018-05-10 14:25:16 -07:00
Kubernetes Submit Queue 4868d7775a
Merge pull request #63511 from juanvallejo/jvallejo/cmd-cleanup
Automatic merge from submit-queue (batch tested with PRs 63669, 63511, 63561, 63289). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cleanup TODOs from PrintFlags wiring

**Release note**:
```release-note
NONE
```

Address TODOs from PrintFlags wiring

cc @soltysh @deads2k
2018-05-10 14:25:13 -07:00
Nick Sardo 81a5fa431c Add Patch method to GA Backend Services 2018-05-10 12:45:21 -07:00
juanvallejo 40e52bf07d remove legacyscheme dep from printFlags 2018-05-10 14:51:12 -04:00
David Eads 16d6a6c52f move resource builder to generic options 2018-05-10 14:15:12 -04:00
juanvallejo 7b1b107ea4 cleanup TODO comments from PrintFlags wiring 2018-05-10 14:03:06 -04:00
David Eads 76d744efe9 remove kube/kube deps from resourcebuilder 2018-05-10 12:50:28 -04:00
Kubernetes Submit Queue 7e75a09db6
Merge pull request #63613 from deads2k/cli-52-builderclient
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 construct resource.Builder from kubeconfig flags

updates the resource.Builder to be constructed from the kubeconfig flags struct/interface that we now have.

@kubernetes/sig-cli-maintainers 
@juanvallejo @soltysh 

```release-note
NONE
```
2018-05-10 09:03:11 -07:00
Kubernetes Submit Queue 321201f672
Merge pull request #63406 from derekwaynecarr/label-pod-cgroups
Automatic merge from submit-queue (batch tested with PRs 60200, 63623, 63406). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Apply pod name and namespace labels for pod cgroup for cadvisor metrics

**What this PR does / why we need it**:
1. Enable Prometheus users to determine usage by pod name and namespace for pod cgroup sandbox.
1. Label cAdvisor metrics for pod cgroups by pod name and namespace.
1. Aligns with kubelet stats summary endpoint pod cpu and memory stats.

**Special notes for your reviewer**:
This provides parity with the summary API enhancements done here:
https://github.com/kubernetes/kubernetes/pull/55969

**Release note**:
```release-note
Apply pod name and namespace labels to pod cgroup in cAdvisor metrics
```
2018-05-10 08:33:11 -07:00
David Eads 080d6a4b0d wrap restclientgetter with match version option 2018-05-10 09:43:22 -04:00
David Eads 1f5357034b construct resource.Builder from kubeconfig flags 2018-05-10 09:42:15 -04:00
Kubernetes Submit Queue f321613dad
Merge pull request #63424 from xiaoxubeii/issue-63183-master
Automatic merge from submit-queue (batch tested with PRs 63424, 63657). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix #63183 Pods on different nodes mount Ceph RBD PVC stuck on ContainerCreating

**What this PR does / why we need it**:
Ceph/RBD pvc can be attached on different nodes when use ReadOnlyMany.


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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-05-10 06:31:16 -07:00
Nikhita Raghunath 3ed5cc3954 Promote CustomResourcesSubresources to beta 2018-05-10 18:24:04 +05:30
Kubernetes Submit Queue 0ba80021c5
Merge pull request #56690 from redbaron/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Disable session affinity for internal kuberntes service

Under following conditions session affinity leads to a deadlock:
  - Self hosted controller-manager, where it talks to API servers
    via kubernetes service ClusterIP
  - default master-count reconcilier is used
  - --apiserver-count is set to >1 according to the help message
  - number of responsive APIServers goes below `apiserver-count`
  - all controller-managers happen to be hashed to APIServers which
    are down.

What then happens is that controller managers never be able to
contact APIServer, despite correctly working APIServer available.

Less serious outages also possible for other consumers of kubernetes
service, such as operators, kube-dns, flannel & calico, etc.  There is
always non zero chance, that given consumer is hashed  to an apiserver
which is down.

This reverts PR https://github.com/kubernetes/kubernetes/pull/23129

/sig api-machinery
CCing:
  -  author and approver of reverted PR: @mikedanese, @lavalamp 
  - other affected users which spoke up: @jsravn, @tatsuhiro-t 


```release-note
NONE
```
2018-05-10 04:20:40 -07:00
John Calabrese 3a9e988015 use subtest for table units 2018-05-10 07:12:20 -04:00
Kubernetes Submit Queue d42df4561a
Merge pull request #61976 from atlassian/ticker-with-stop
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Stop() for Ticker to enable leak-free code

**What this PR does / why we need it**:
I wanted to use the clock package but the `Ticker` without a `Stop()` method is a deal breaker for me.

**Release note**:
```release-note
NONE
```
/kind enhancement
/sig api-machinery
2018-05-09 19:06:56 -07:00
WanLinghao c68a11d042 remove unused variables on
pkg/controller/serviceaccount/serviceaccounts_controller_test.go
	pkg/controller/endpoint/endpoints_controller_test.go
2018-05-10 09:19:00 +08:00
Kubernetes Submit Queue b2fe2a0a6d
Merge pull request #59847 from mtaufen/dkcfg-explicit-keys
Automatic merge from submit-queue (batch tested with PRs 63624, 59847). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap

This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.
    
As part of this change, we are retiring ConfigMapRef for ConfigMap.


```release-note
You must now specify Node.Spec.ConfigSource.ConfigMap.KubeletConfigKey when using dynamic Kubelet config to tell the Kubelet which key of the ConfigMap identifies its config file.
```
2018-05-09 17:55:13 -07:00
Kubernetes Submit Queue 8de6600a55
Merge pull request #63539 from wojtek-t/refactor_secret_configmap_manager
Automatic merge from submit-queue (batch tested with PRs 63593, 63539). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor cachingSecretManager

I have a POC of watch-based implementation of SecretManager in https://github.com/kubernetes/kubernetes/pull/63461

This is an initial refactoring that would make that change easier.

@yujuhong - if you're fine with this PR, I will do the same for configmaps in the follow up PR.
2018-05-09 14:49:14 -07:00
Kubernetes Submit Queue ca92b73a65
Merge pull request #63602 from deads2k/cli-54-categories
Automatic merge from submit-queue (batch tested with PRs 59284, 63602). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 category expansion can only come from the server

A couple release ago we moved category expansion to the server instead of hardcoding it in the client.  Similar to restmappings, there is no valid client-side expansion anymore, so this removes the code that hardcoded the list and moves the category expansion to the same package as our discovery based restmappers.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-09 13:51:13 -07:00
Kubernetes Submit Queue d89471c4b5
Merge pull request #59284 from Addepar/fix-empty-null-patch
Automatic merge from submit-queue (batch tested with PRs 59284, 63602). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Exclude keys containing empty patches in the final patch

**What this PR does / why we need it**: 
This minimizes the 3-way JSON merge patch generated when calculating the patch necessary to send to the server. It does this by removing empty maps created from deleting keys in the keepOrDeleteNullInObj method.

This is not only a slight performance improvement (less PATCH requests) but also necessary when working with custom resources that have RBAC restrictions.

**Which issue(s) this PR fixes**: N/A

**Special notes for your reviewer**: N/A

**Release note**:

```release-note
NONE
```
2018-05-09 13:51:09 -07:00
David Eads ad87219b2c category expansion can only come from the server 2018-05-09 15:05:58 -04:00
David Eads 37f6cb7230 move category expansion types to restmapper package 2018-05-09 15:03:09 -04:00
Kubernetes Submit Queue 23a9136d4e
Merge pull request #63599 from deads2k/cli-53-restmapper
Automatic merge from submit-queue (batch tested with PRs 63597, 63599). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

push ToRESTMapper down a layer

The RESTMapper is needed to drive some use-cases for a dynamic client and takes a little bit of wiring (nested restmappers).  This pull pushes that into information derived from the kubeconfig flags to allow easy re-use.

@kubernetes/sig-cli-maintainers 
/assign @juanvallejo 
/assign @soltysh 

assigned to original creators.


```release-note
NONE
```
2018-05-09 11:26:12 -07:00
Kubernetes Submit Queue 234939dced
Merge pull request #63502 from liggitt/parallel-discovery
Automatic merge from submit-queue (batch tested with PRs 62354, 62934, 63502). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Run resource discovery in parallel

best viewed ignoring whitespace (https://github.com/kubernetes/kubernetes/pull/63502/files?w=1)

on high-latency connections, serializing resource discovery requests across group versions can take significant amounts of time. this parallelizes the network request portion of the discovery call

xref #63368 

```release-note
NONE
```
2018-05-09 09:30:15 -07:00
Kubernetes Submit Queue aea6addb82
Merge pull request #62934 from wackxu/scto
Automatic merge from submit-queue (batch tested with PRs 62354, 62934, 63502). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Refactor GetResourceRequest and GetResourceLimit

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

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

**Special notes for your reviewer**:
/assign @bsalamat 

**Release note**:

```release-note
NONE
```
2018-05-09 09:30:11 -07:00
wojtekt 52713cd837 Rename Add/Delete to *Reference 2018-05-09 18:14:50 +02:00
wojtekt 8e55220523 Refactor cachingSecretManager 2018-05-09 18:09:59 +02:00
David Eads 3cb7d25959 push ToRESTMapper down a layer 2018-05-09 11:18:26 -04:00
Kubernetes Submit Queue d09cd75ea6
Merge pull request #58874 from sorenmat/sg_tag_verbose
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Include more information when multiple security groups are tagged

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

When trying to create ELB we can sometime fail if there is more then one AWS
security group tagged. It very useful to get the list of security groups printed in
the error message.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
  Include the list of security groups when failing with the errors that more then one is tagged
```
2018-05-09 05:48:42 -07:00
Kubernetes Submit Queue 75af0646ba
Merge pull request #59034 from wenlxie/githubupstream.master.ignoreloopdevicenotfounderrorforrbd
Automatic merge from submit-queue (batch tested with PRs 59034, 63565, 63533). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[RBD block device ]ignore the loopbackdevice error, or the rbd volume will not get detached

The rbd volume loop device maybe not found and then the volume will  not get detached.
so need to ignore the error.
@mtanino @sbezverk
Can you take a look?

Release note:
```
ignore the loopback device not found error when  `GetLoopDevice` 
```
2018-05-09 05:13:08 -07:00
Kubernetes Submit Queue 0949cefd7b
Merge pull request #62453 from k82cn/k8s_61410_2
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Supported nodeSelector.matchFields in scheduler.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
part of  #61410

**Special notes for your reviewer**:

**Release note**:
```release-note
Supported nodeSelector.matchFields (node's `metadata.node`) in scheduler.
```
2018-05-09 02:47:21 -07:00
Tardis Xu 6d3b41cd85 Fix issue #63183 that pods on different nodes mount Ceph RBD PVC stuck on ContainerCreating. 2018-05-09 16:04:24 +08:00
wackxu adea3733a8 add SetMaxResource for Resource 2018-05-09 15:33:24 +08:00
Kubernetes Submit Queue ce2bb3d77f
Merge pull request #63541 from feiskyer/vmss-ip
Automatic merge from submit-queue (batch tested with PRs 63563, 63541). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Do not check vmSetName when getting Azure node's IP

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

Do not check vmSetName when getting Azure node's IP.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Do not check vmSetName when getting Azure node's IP
```
2018-05-08 23:48:16 -07:00
Pengfei Ni d32e73aba9 Fix unit tests for new interfaces 2018-05-09 12:47:56 +08:00
Pengfei Ni f427d279fe Do not check vmSetName when getting node IP 2018-05-09 12:47:52 +08:00
Kubernetes Submit Queue 13f3c7c7ca
Merge pull request #63120 from wgliang/master.remove-todo
Automatic merge from submit-queue (batch tested with PRs 58580, 63120). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

-Remove TODO comment of GetNonzeroRequests function

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

-Remove TODO comment of GetNonzeroRequests function

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-08 21:45:13 -07:00
Kubernetes Submit Queue ba3176d94c
Merge pull request #58580 from k82cn/k8s_58505
Automatic merge from submit-queue (batch tested with PRs 58580, 63120). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Admit BestEffort if it tolerates memory pressure.

Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>

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

**Release note**:
```release-note
None
```
2018-05-08 21:45:10 -07:00
Kubernetes Submit Queue b733342f3c
Merge pull request #61883 from CaoShuFeng/configz
Automatic merge from submit-queue (batch tested with PRs 63297, 61883). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

set right Content-Type for configz

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-08 20:38:11 -07:00
Jordan Liggitt d037b0893f
Run resource discovery in parallel 2018-05-08 23:24:34 -04:00
hangaoshuai c01f6a1e68 fix a small mistake in function getFieldMeta 2018-05-09 11:14:57 +08:00
andyzhangx 1d24f48bba add IsLikelyNotMountPoint test on Windows
fix comments

fix comments on unit test

fix comments
2018-05-09 02:41:38 +00:00
Kubernetes Submit Queue 5ba149e182
Merge pull request #63528 from silveryfu/master
Automatic merge from submit-queue (batch tested with PRs 63535, 63528). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Build image size map upon node info updates

@resouer 

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

The imageSizes map will be built only at each NodeInfo update and reused across pod requests between updates. 

Ideally, the node scoring part should run as fast as possible - a slow(er) one would pose as head-of-line blocking for pods in the scheduler queue. 

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

fixes #63345

**Special notes for your reviewer**:


**Release note**:

```release-note
None
```
2018-05-08 19:38:10 -07:00
Kubernetes Submit Queue a46ced041d
Merge pull request #63464 from dougm/vsphere-auth
Automatic merge from submit-queue (batch tested with PRs 63364, 63464). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

vsphere: use vim25.Client directly to support token authentication

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

This refactor is in support of SAML token authentication: #63209
Avoid use of govmomi.Client as it only supports username+password authentication via SessionManager.Login().
Using vim25.Client directly will allow VCP to add other authentication methods,
such as SessionManager.LoginByToken().

**Release note**:

```release-note
NONE
```
2018-05-08 18:36:14 -07:00
David Ashpole a5df208866 eviction test ensures failed pods are evicted 2018-05-08 16:08:35 -07:00
Michael Taufen c41cf55a2c explicit kubelet config key in Node.Spec.ConfigSource.ConfigMap
This makes the Kubelet config key in the ConfigMap an explicit part of
the API, so we can stop using magic key names.

As part of this change, we are retiring ConfigMapRef for ConfigMap.
2018-05-08 15:37:26 -07:00
David Eads c5445d3c56 simplify api registration 2018-05-08 18:33:50 -04:00
David Eads 7b4f97aca3 generated 2018-05-08 18:32:44 -04:00
Kubernetes Submit Queue 51d75a7b1e
Merge pull request #63444 from deads2k/client-07-gc-dynamic
Automatic merge from submit-queue (batch tested with PRs 63526, 60371, 63444). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update garbage collection to use the new dynamic client

Update GC to use the new and easy to use dynamic client.  This is one of two remaining stragglers.

@kubernetes/sig-api-machinery-pr-reviews 
@caesarxuchao @ironcladlou 

```release-note
NONE
```
2018-05-08 15:24:11 -07:00
Kubernetes Submit Queue e70c4331a9
Merge pull request #60371 from superbrothers/__kubectl_cp-1
Automatic merge from submit-queue (batch tested with PRs 63526, 60371, 63444). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Support completion for kubectl cp

**What this PR does / why we need it**: With this PR, kubectl cp supports completion. I tested this PR in bash and zsh.

```
$ kubectl cp kube-system/<tab>
kube-system/kube-state-metrics-769566fdfb-4v52s:   kube-system/kubernetes-dashboard-6b6ddbd46-t5bv9:  kube-system/prometheus-694594c45b-qk5lq:
```

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes kubernetes/kubectl#5

**Special notes for your reviewer**: @cblecker

**Release note**:

```release-note
`kubectl cp` supports completion.
```
2018-05-08 15:24:08 -07:00
Silvery Fu 4087ff32bc Build image size map upon node info updates 2018-05-08 15:02:18 -07:00
Kubernetes Submit Queue b00d600b48
Merge pull request #63526 from djsly/fix-vmss-parsing
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

adding support for VM name with extra Separator String

**What this PR does / why we need it**:
Allows the Azure VM name to have within their name the `_` character

**Special notes for your reviewer**:
This is the error I got before testing
```
May 07 21:55:14 kn-infra000000.<domainname> kubelet[39465]: I0507 21:55:14.462125   39465 azure_vmss.go:108] getVmssVM gets scaleSetName ("kn-infra_ss") and instanceID ("0") for node "kn-infra000000"
May 07 21:55:14 kn-infra000000.<domainname> kubelet[39465]: E0507 21:55:14.462147   39465 azure_vmss_cache.go:52] Failed to extract vmssVMName "kn-infra_ss_0"
May 07 21:55:14 kn-infra000000.<domainname> kubelet[39465]: F0507 21:55:14.462160   39465 kubelet.go:1349] Kubelet failed to get node info: failed to get external ID from cloud provider: not a vmss instance
```

**Release note**:
```release-note
Azure VMSS: support VM names to contain the `_` character
```
2018-05-08 15:01:30 -07:00
Kubernetes Submit Queue a67ccaeab1
Merge pull request #63536 from deads2k/cli-51-streams
Automatic merge from submit-queue (batch tested with PRs 63070, 63536). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use IOStreams for cli commands

Scrubs the last commands to use IOStreams for consistency and testability.

@kubernetes/sig-cli-maintainers 
/assign @juanvallejo 

```release-note
NONE
```
2018-05-08 14:14:20 -07:00
Kubernetes Submit Queue 084e068406
Merge pull request #63524 from dims/deprecate-in-tree-openstack-cloud-provider
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deprecate in-tree OpenStack cloud provider

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

Warn operators and users to switch to the external cloud provider
for openstack.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
OpenStack built-in cloud provider is now deprecated. Please use the external cloud provider for OpenStack.
```
2018-05-08 13:16:27 -07:00
Kubernetes Submit Queue c27335fe3e
Merge pull request #63507 from deads2k/cli-50-tidyup
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 move client based restmappers to client-go

Moves the client-based restmappers to client-go where everyone who needs them can have access.


```release-note
the shortcuts which were moved server-side in at least 1.9 have been removed from being hardcoded in kubectl
```

@kubernetes/sig-cli-maintainers @kubernetes/sig-api-machinery-pr-reviews
2018-05-08 13:16:23 -07:00
Kubernetes Submit Queue f9fd3c89e7
Merge pull request #63490 from deads2k/cli-48-delete
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

default the ignorenotfound for delete when selecting objects

When selecting resources and then deleting them (as opposed to specifically indicating a resource to delete) we should default to not failing if something disappeared partway through.  This is quite common when label selecting deletes and GC runs before you get to a dependent object.

I also took the liberty of doing complete work in complete instead of validate.

```release-note
`kubectl delete` with selection criteria defaults to ignoring not found errors
```

@kubernetes/sig-cli-maintainers
2018-05-08 13:16:14 -07:00
Kubernetes Submit Queue 9091c26d72
Merge pull request #63291 from WanLinghao/set_const_clean
Automatic merge from submit-queue (batch tested with PRs 63291, 63490, 60445, 63507, 63524). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

	clean unused variables

**What this PR does / why we need it**:
clean unused variables on set.go
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-08 13:16:11 -07:00
Kubernetes Submit Queue f13fa1e3af
Merge pull request #63415 from dashpole/eviction_event
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Clean up kubelet eviction events

**What this PR does / why we need it**:
This makes eviction events better.  
* Exceeding container disk limits no longer says "node was low on X", since the node isn't actually low on a resource.  The container limit was just exceeded.  Same for pods and volumes.
* Eviction message now lists containers which were exceeding their requests.  This is an event from a container evicted while under memory pressure: 
`reason: 'Evicted' The node was low on resource: memory. Container high-priority-memory-hog was using 166088Ki, which exceeds its request of 10Mi.`
* Eviction messages now displays real resources, when they exist.  Rather than `The node was low on resource: nodefs`, it will now show `The node was low on resource: ephemeral-storage`.

This also cleans up eviction code in order to accomplish this.  We previously had a resource for each signal: e.g. `SignalNodeFsAvailable` mapped to the resource`nodefs`, and `nodefs` maps to reclaim functions, and ranking functions.  Now, signals map directly to reclaim and ranking functions, and signals map to real resources: e.g. `SignalNodeFsAvailable` maps to the resource `ephemeral-storage`, which is what we use in events.
This also cleans up duplicated code by reusing the `evictPod` function.  It also removes the unused signal `SignalAllocatableNodeFsAvailable`.

**Release note**:
```release-note
NONE
```

/sig node
/priority important-longterm

/assign @dchen1107 @jingxu97
2018-05-08 10:38:29 -07:00
David Eads facd04be43 use IOStreams for cli commands 2018-05-08 09:02:34 -04:00
David Eads dd97a7bc59 move client based restmappers to client-go 2018-05-08 08:11:56 -04:00
David Eads 682e028516 stop pretending that we have statically known shortcuts 2018-05-08 08:11:56 -04:00
Kubernetes Submit Queue 8d064823bb
Merge pull request #63264 from bsalamat/monotonic_generation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Increase scheduler cache generation number monotonically in order to avoid collision

**What this PR does / why we need it**:
Increments the scheduler cache generation number monotonically to avoid collision of the generation numbers. More context in #63262.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Increase scheduler cache generation number monotonically in order to avoid collision and use of stale information in scheduler.
```
2018-05-08 03:45:57 -07:00
sylvain.boily a8de002952 adding support for VM name with extra Separator String 2018-05-08 06:36:04 -04:00
Kubernetes Submit Queue e6b6e5c4b4
Merge pull request #63045 from msau42/fix-subpath-readonly
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

passthrough readOnly to subpath

**What this PR does / why we need it**:
If a volume is mounted as readonly, or subpath volumeMount is configured as readonly, then the subpath bind mount should be readonly.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixes issue where subpath readOnly mounts failed
```
2018-05-07 23:36:49 -07:00
andyzhangx 5671cd81df fix IsLikelyNotMountPoint func on Windows 2018-05-08 05:50:30 +00:00
Davanum Srinivas e30fe2ba4b Deprecate in-tree OpenStack cloud provider
Warn operators and users to switch to the external cloud provider
for openstack.
2018-05-07 21:53:15 -04:00
Kubernetes Submit Queue af70337f8c
Merge pull request #63083 from mgdevstack/master-make-verify
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixed hack/verify-golint.sh reported errors 

**What this PR does / why we need it**:
Fixes errors reported by `hack/verify-golint.sh` while running `make verify`

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

**Special notes for your reviewer**:
Fixing `hack/verify-gofmt.sh` reported error for `k8s.io/code-generator/cmd/client-gen/generators/client_generator.go` mentioned in #63065 throws error. So didn't modify that file.

**Release note**:

```release-note
NONE
```
/sig-testing-bugs
2018-05-07 18:23:46 -07:00
David Ashpole 2294f09e4e add memcg notifications for allocatable cgroup 2018-05-07 17:15:23 -07:00
Kubernetes Submit Queue 861d20bf48
Merge pull request #63340 from juanvallejo/jvallejo/remove-printer-helpers
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove cmdutil printer helpers

**Release note**:
```release-note
NONE
```

Removes printer helpers from the cmd/util package.
Followup to PrintFlags updates.

cc @deads2k @soltysh
2018-05-07 15:08:57 -07:00
Kubernetes Submit Queue 6549342386
Merge pull request #63496 from mtaufen/dkcfg-fs-tests
Automatic merge from submit-queue (batch tested with PRs 63488, 63496). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improve test coverage of Kubelet file utils

Improves from 30.9% to 77.8%.

```release-note
NONE
```
2018-05-07 14:18:06 -07:00
juanvallejo a74b28d961 rm GetStandardPrinter 2018-05-07 15:37:55 -04:00
juanvallejo 5a34e4f594 remove printer helpers 2018-05-07 15:37:55 -04:00
Kubernetes Submit Queue 81b96b822e
Merge pull request #63373 from juanvallejo/jvallejo/begin-wiring-config-flags-struct
Automatic merge from submit-queue (batch tested with PRs 63373, 63338). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Wire ConfigFlags struct through cmdutil.Factory

**Release note**:
```release-note
NONE
```

Continues the Flags struct pattern established with PrintFlags.
Wires ConfigFlags through the client_access_factory

cc @deads2k @soltysh
2018-05-07 12:22:07 -07:00
Jordan Liggitt 814b065928
Close all kubelet->API connections on heartbeat failure 2018-05-07 15:06:31 -04:00
Jordan Liggitt 52876f77e9
Always track kubelet -> API connections 2018-05-07 15:06:30 -04:00
Derek Carr a09990cd43 Apply pod name and namespace labels for pod cgroup for cadvisor metrics 2018-05-07 14:51:12 -04:00
Michael Taufen e7b42f8a77 Improve test coverage of Kubelet file utils
Improves from 30.9% to 77.8%.
2018-05-07 11:17:21 -07:00
Kubernetes Submit Queue bc1c2de163
Merge pull request #62914 from sjenning/kubelet-unit-flake
Automatic merge from submit-queue (batch tested with PRs 62914, 63431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: fix flake in TestUpdateExistingNodeStatusTimeout

xref https://github.com/openshift/origin/issues/19443

There are cases where some process, outside the test, attempts to connect to the port we are using to do the test, leading to a attempt count greater than what we expect.

To deal with this, just ensure that we have seen *at least* the number of connection attempts we expect.

@liggitt 

```release-note
NONE
```
2018-05-07 10:44:05 -07:00
David Eads 4ae3f882be default the ignorenotfound for delete when selecting objects 2018-05-07 12:38:18 -04:00
Doug MacEachern cc1552c072 vsphere: update bazel 2018-05-07 08:50:31 -07:00
Doug MacEachern e22f9ca4ae vsphere: fallback to vcsim for testing authentication
The TestVSphereLogin method still defaults to testing against a real vCenter,
but if the required environment variables are not set, it can test against vcsim.

More tests can be converted to use configFromEnvOrSim(), but can be in follow up PRs.
2018-05-07 08:50:31 -07:00
Doug MacEachern e7f74d83c6 Rename VSphereConnection.GoVmomiClient -> Client 2018-05-07 08:50:31 -07:00
Doug MacEachern 64601373f1 vsphere: use vim25.Client directly to support token authentication
This refactor is in support of SAML token authentication: #63209
Avoid use of govmomi.Client as it only supports username+password authentication via SessionManager.Login().
Using vim25.Client directly will allow VCP to add other authentication methods,
such as SessionManager.LoginByToken().
2018-05-07 08:50:31 -07:00
David Eads cf4f7aab65 update garbage collection to use the new dynamic client 2018-05-07 09:01:39 -04:00
Kubernetes Submit Queue b976ebd56a
Merge pull request #63425 from feiskyer/azclient
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Clean up Azure clients

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

Follow up of #63278 (Use new Azure SDK APIs for load balancer and public IP operations), clean up all other clients.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Follow up of #63278

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-07 01:08:45 -07:00
Lion-Wei e90de22a5e fix ipvs fw 2018-05-07 11:22:34 +08:00
Kubernetes Submit Queue 28a19562bd
Merge pull request #61970 from sak0/dev-endpoints
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

controller/endpoint: explict log msg when syncing error

explict log msg for retrying sync

Signed-off-by: CuiHaozhi <cuihaozhi@chinacloud.com.cn>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-06 19:47:30 -07:00
Harry Zhang 8df3ab75a4 Check nodeInfo before ecache 2018-05-06 22:42:20 +08:00
Kubernetes Submit Queue b2a8ef474d
Merge pull request #63457 from fisherxu/mv
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove repeated code

**What this PR does / why we need it**:
Remove repeated code
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-05 14:20:23 -07:00
fisherxu 58cebf9bbc remove repeated code 2018-05-05 18:09:33 +08:00
juanvallejo 3ca222b2d9 wire config flags through factory 2018-05-04 17:02:20 -04:00
juanvallejo 46e827a8a5 begin building a config flags struct 2018-05-04 16:16:20 -04:00
Kubernetes Submit Queue 5f5d4fd450
Merge pull request #63439 from liggitt/from-file
Automatic merge from submit-queue (batch tested with PRs 63315, 63383, 63318, 63439). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

compute configmap/secret key correctly cross-platform

fixes #61710

```release-note
`kubectl create [secret | configmap] --from-file` now works on Windows with fully-qualified paths
```
2018-05-04 12:41:15 -07:00
Kubernetes Submit Queue 238fda9e52
Merge pull request #63318 from deads2k/cli-40-mapperfunc
Automatic merge from submit-queue (batch tested with PRs 63315, 63383, 63318, 63439). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

drive resourcebuilder from kubeconfig, allow scheme specification

This updates the resource builder to work based on a kubeconfig to allow future chaining of flags.  It also allow specification of the scheme you want for your actual decoding.


@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-04 12:41:12 -07:00
Kubernetes Submit Queue 31511f9e24
Merge pull request #63383 from liggitt/lease-reconciler
Automatic merge from submit-queue (batch tested with PRs 63315, 63383, 63318, 63439). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Re-enable lease reconciler, fix shutdown race

Fixes #63378
Fixes #57617

* Fixes the openapi script to wait for the apiserver on shutdown (like all the other scripts do)
* Fixes the apiserver shutdown to not hang forever if the kubernetes service reconciler cannot persist to etcd
* Readds https://github.com/kubernetes/kubernetes/pull/58474 to make the default the lease reconciler

```release-note
kube-apiserver: the default `--endpoint-reconciler-type` is now `lease`. The `master-count` endpoint reconciler type is deprecated and will be removed in 1.13.
```
2018-05-04 12:41:09 -07:00
Kubernetes Submit Queue d4b4f5aa8d
Merge pull request #63438 from php-coder/psp_unix_user_and_group_id
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use single struct in internal type to reduce difference with external type

**What this PR does / why we need it**:
This PR reduces the differences between internal and external types by removing leftovers after revert of one of the changes.

**Special notes for your reviewer**:
We had `IDRange` in both types prior 9440a68744 commit (https://github.com/kubernetes/kubernetes/pull/44714) that splitted it into `UserIDRange`/`GroupIDRange`. Later, in c91a12d205 commit (https://github.com/kubernetes/kubernetes/pull/47824) we had to revert these changes because they broke backward compatibility but `UserIDRange`/`GroupIDRange` structs were left in the internal type.
2018-05-04 11:43:29 -07:00
David Ashpole db99c20a9a cleanup eviction events 2018-05-04 11:02:25 -07:00
Kubernetes Submit Queue 484f62a568
Merge pull request #63333 from deads2k/api-14-snip
Automatic merge from submit-queue (batch tested with PRs 63421, 63432, 63333). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update tests to be specific about the versions they are testing

When setting up tests, you want to rely on your own scheme.  This eliminates coupling to floating versions which gives unnecessary flexibility in most cases and prevents testing all the versions you need.

@liggitt  scrubs unnecessary deps.

```release-note
NONE
```
2018-05-04 10:52:10 -07:00
Kubernetes Submit Queue 3945a241aa
Merge pull request #63432 from deads2k/cli-46-printerinterface
Automatic merge from submit-queue (batch tested with PRs 63421, 63432, 63333). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 slim printer interface down to printing

The printer interface only needs to know how to print.  This reduces it's interface to scope it to printing.

@kubernetes/sig-cli-maintainers 
@soltysh @juanvallejo  you've been active in the area

/assign @juanvallejo 

```release-note
NONE
```
2018-05-04 10:52:07 -07:00
Kubernetes Submit Queue 068b7befa9
Merge pull request #63421 from liggitt/discover-completions
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Cache preferred resources, use in kubectl resource name autocomplete

Fixes #63145
Fixes https://github.com/kubernetes/kubectl/issues/357
Alternative to #61928 

* starts to unify preferred resource logic on top of ServerGroups()/ServerResourcesForGroupVersion() methods
* allows indicating a cached list of resources is acceptable when calling `kubectl api-resources` (default is still to rediscover)
* uses `kubectl api-resources` in bash completion

```sh
$ kubectl get [TAB][TAB]
apiservices.apiregistration.k8s.io                            networkpolicies.extensions
certificatesigningrequests.certificates.k8s.io                networkpolicies.networking.k8s.io
clusterrolebindings.rbac.authorization.k8s.io                 nodes
clusterroles.rbac.authorization.k8s.io                        persistentvolumeclaims
componentstatuses                                             persistentvolumes
configmaps                                                    poddisruptionbudgets.policy
controllerrevisions.apps                                      pods
cronjobs.batch                                                podsecuritypolicies.extensions
customresourcedefinitions.apiextensions.k8s.io                podsecuritypolicies.policy
daemonsets.apps                                               podtemplates
daemonsets.extensions                                         replicasets.apps
deployments.apps                                              replicasets.extensions
deployments.extensions                                        replicationcontrollers
endpoints                                                     resourcequotas
events                                                        rolebindings.rbac.authorization.k8s.io
events.events.k8s.io                                          roles.rbac.authorization.k8s.io
horizontalpodautoscalers.autoscaling                          secrets
ingresses.extensions                                          serviceaccounts
initializerconfigurations.admissionregistration.k8s.io        services
jobs.batch                                                    statefulsets.apps
limitranges                                                   storageclasses.storage.k8s.io
mutatingwebhookconfigurations.admissionregistration.k8s.io    validatingwebhookconfigurations.admissionregistration.k8s.io
namespaces                                                    volumeattachments.storage.k8s.io
```


```release-note
NONE
```
2018-05-04 10:08:53 -07:00
David Eads a53a72e238 udpate some examples to use external types 2018-05-04 13:02:49 -04:00
David Eads b8aa7baa7d simplify resource builder usage 2018-05-04 13:02:49 -04:00
Slava Semushin a0c75d028a Update autogenerated files. 2018-05-04 18:31:42 +02:00
Slava Semushin f49a0fbd5f Replace UserIDRange/GroupIDRange by IDRange in internal type to reduce difference with external type.
We had IDRange in both types prior 9440a68744 commit that splitted it
into UserIDRange/GroupIDRange. Later, in c91a12d205 commit we had to
revert this changes because they broke backward compatibility but
UserIDRange/GroupIDRange struct left in the internal type.

This commit removes these leftovers and reduces the differences
between internal and external types.
2018-05-04 18:31:42 +02:00
Jordan Liggitt 17e62d91af
compute configmap/secret key correctly cross-platform 2018-05-04 12:00:50 -04:00
David Eads e1fca70506 slim down printer interface 2018-05-04 11:15:35 -04:00
Jordan Liggitt 0dd652cffd
Fix bash completion with --all-namespaces 2018-05-04 09:57:57 -04:00
Jordan Liggitt 4dfd26a4f2
Switch kubectl resource completion to discovery 2018-05-04 09:57:36 -04:00
Kubernetes Submit Queue 54cf942a05
Merge pull request #63399 from andyzhangx/mount-windows-test-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use TempDir func in mount_windows_test.go

**What this PR does / why we need it**:
Use `c:\tmp` dir is not correct in windows test, this PR use `ioutil.TempDir("", xx)` to create temp dir instead.

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

**Special notes for your reviewer**:

**Release note**:

```
none
```

/assign @jsafrane @msau42
2018-05-04 05:30:42 -07:00
Kubernetes Submit Queue 194e640bf1
Merge pull request #63339 from sjenning/remove-mount-success-event
Automatic merge from submit-queue (batch tested with PRs 63298, 63339). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet: volume: do not create event on mount success

xref https://github.com/openshift/origin/issues/19497

There is an argument to be made that we should not emit events on volume mount successes.  Many pods have lots of volumes that generate lots of events, especially if the pods are short lived (batch, etc). This creates load on the API server and add noise in the events.

Creating events on volume mount failures is obviously a good idea.  Seems like the absence of such events or the "Started container" event implies mount success for all volumes.

/sig node
/sig storage
/release-note-none

@smarterclayton @jsafrane @saad-ali
2018-05-04 04:42:06 -07:00
Kubernetes Submit Queue 1929e0d86d
Merge pull request #63298 from dims/kubelet-remove-unused-code
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubelet - Remove unused code

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

Looks like we have a bunch of unused methods. Let's clean them up

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-04 04:20:06 -07:00
Jan Safranek a884a00d30 Fix CSI volume detach when the volume is already detached.
"NotFound" error should be treated as successful detach.
2018-05-04 12:22:15 +02:00
Mayank Gaikwad e03a41ddf8 fixed golint error on redundant if 2018-05-04 11:58:30 +05:30
Pengfei Ni 05d0d35d32 fix fake clients and unit tests 2018-05-04 14:09:48 +08:00
Pengfei Ni 12c9d2736a use new azure clients 2018-05-04 14:09:33 +08:00
Pengfei Ni 7d9b134246 cleanup unnecessary channels in azure clients 2018-05-04 14:09:07 +08:00
Jordan Liggitt 918df97a0f
Allow api-resources to return cached data 2018-05-04 00:06:39 -04:00
Jordan Liggitt 74b7cec0c6
Make ServerPreferred[Namespaced]Resources logic and caches consistent 2018-05-04 00:06:39 -04:00
Kubernetes Submit Queue bb4745da99
Merge pull request #63407 from nicksardo/change-setsslcert
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

GCE: Pass certificate URLs instead of the certificate structs

**What this PR does / why we need it**:
Simplify callers by passing in only what's necessary - a slice of URLs.

**Special notes for your reviewer**:
/assign @MrHohn 
/cc @MrHohn 

**Release note**:
```release-note
NONE
```
2018-05-03 18:41:39 -07:00
Kubernetes Submit Queue b52ebfa28e
Merge pull request #63312 from deads2k/cli-44-encoder
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unnecessary encoder

Followups to https://github.com/kubernetes/kubernetes/pull/63105
2018-05-03 16:11:17 -07:00
Kubernetes Submit Queue 4e3efbe364
Merge pull request #61455 from liggitt/uid-conflict
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Deprecate repair-malformed-updates flag, move object meta mutation into BeforeCreate

closes #23297

```release-note
NONE
```
2018-05-03 13:41:07 -07:00
Nick Sardo f9d1f7eb75 Pass certificate URLs instead of the certificate structs 2018-05-03 13:14:55 -07:00
Kubernetes Submit Queue eaa3aa382a
Merge pull request #63398 from deads2k/cli-45-conversion
Automatic merge from submit-queue (batch tested with PRs 63258, 63398, 63403). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove unnessary kubectl conversions

Working with unstructured types means that conversion can be eliminated.  This pulls  it from places I noticed.

/assign @juanvallejo 

@kubernetes/sig-cli-misc 

```release-note
NONE
```
2018-05-03 12:48:13 -07:00
Kubernetes Submit Queue a29b4607df
Merge pull request #63258 from deads2k/cli-42-simplify-buidler
Automatic merge from submit-queue (batch tested with PRs 63258, 63398, 63403). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

stop using Info.Mappings when they may not be present

On a resource builder, you cannot logically have a RESTMapping or a Client if you're running a local action.  Reliance on the `info.Client` and `info.Mapping` is a bug we need to fix.  This updates the docs and eliminates unnecessary reliance.  Other hits I found didn't have `--local` options, so we're safe or had them and and were already broken.  I think we'll be able to help them after making our creation flow obvious.

@kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-03 12:48:10 -07:00
vikaschoudhary16 f06fca9823 Fix e2e "When checkpoint file is corrupted should complete pod sandbox clean up" 2018-05-03 14:27:49 -04:00
Kubernetes Submit Queue 33d85b01fe
Merge pull request #63098 from shubheksha/fix/62916-replace-path-with-filepath-aws-azure
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

aws, azure: replace path with filepath

**What this PR does / why we need it**:
This PR replaces usage of `path` with `filepath` as it uses OS-specific path separators.

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

**Special notes for your reviewer**:
This PR addresses the following volume plugins:
- `pkg/volume/aws_ebs`
- `pkg/volume/azure_dd`
- `pkg/volume/azure_file`

**Release note**:

```release-note
NONE
```
2018-05-03 11:16:10 -07:00
Kubernetes Submit Queue 865321c2d6
Merge pull request #61940 from alinbalutoiu/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add support for CNI on Windows Server 2016 RTM

**What this PR does / why we need it**:
Windows Server 2016 RTM has limited CNI support. This PR makes it possible for the CNI plugin to be used to setup POD networking on Windows Server 2016 RTM (build number 14393).

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

**Special notes for your reviewer**:
The old mode is not supported and tested on Windows Server 2016 RTM. This change allows the CNI plugin to be used on Windows Server 2016 RTM to retrieve the container IP instead of using workarounds (docker inspect).

CNI support has been added for Windows Server 2016 version 1709 (build number 16299), this patch will just allow the same support for older build numbers.

Windows Server 2016 RTM has a longer lifecycle (LTS) than Windows Server 2016 version 1709.
https://support.microsoft.com/en-us/lifecycle/search/19761 vs https://support.microsoft.com/en-us/lifecycle/search/20311


**Release note**:

```release-note
NONE
```
2018-05-03 10:17:03 -07:00
Kubernetes Submit Queue 592c39bccc
Merge pull request #62541 from filbranden/cgroupname1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use a []string for CgroupName, which is a more accurate internal representation

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

This is purely a refactoring and should bring no essential change in behavior.

It does clarify the cgroup handling code quite a bit.

It is preparation for further changes we might want to do in the cgroup hierarchy. (But it's useful on its own, so even if we don't do any, it should still be considered.)

**Special notes for your reviewer**:

The slice of strings more precisely captures the hierarchic nature of the cgroup paths we use to represent pods and their groupings.

It also ensures we're reducing the chances of passing an incorrect path format to a cgroup driver that requires a different path naming, since now explicit conversions are always needed.

The new constructor `NewCgroupName` starts from an existing `CgroupName`, which enforces a hierarchy where a root is always needed. It also performs checking on the component names to ensure invalid characters ("/" and "_") are not in use.

A `RootCgroupName` for the top of the cgroup hierarchy tree is introduced.

This refactor results in a net reduction of around 30 lines of code,
mainly with the demise of ConvertCgroupNameToSystemd which had fairly
complicated logic in it and was doing just too many things.

There's a small TODO in a helper `updateSystemdCgroupInfo` that was introduced to make this commit possible. That logic really belongs in libcontainer, I'm planning to send a PR there to include it there. (The API already takes a field with that information, only that field is only processed in cgroupfs and not systemd driver, we should fix that.)

Tested: By running the e2e-node tests on both Ubuntu 16.04 (with cgroupfs driver) and CentOS 7 (with systemd driver.)

**NOTE**: I only tested this with dockershim, we should double-check that this works with the CRI endpoints too, both in cgroupfs and systemd modes.

/assign @derekwaynecarr 
/assign @dashpole 
/assign @Random-Liu 

**Release note**:

```release-note
NONE
```
2018-05-03 08:16:45 -07:00
Kubernetes Submit Queue a16c348acf
Merge pull request #56137 from containscafeine/remove-punctuation-from-error
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove punctuation from the end of an error string

```release-note
NONE
```
2018-05-03 06:37:57 -07:00
andyzhangx 3db442bcd0 use TempDir func in mount_windows_test.go
fix comments
2018-05-03 12:58:32 +00:00
David Eads abe9e0d25b stop using Info.Mappings when they may not be present 2018-05-03 08:12:05 -04:00
David Eads a9a99681e4 remove unnessary kubectl conversions 2018-05-03 08:06:53 -04:00
Kubernetes Submit Queue fb85e69b9b
Merge pull request #63376 from liggitt/another-mapper-err
Automatic merge from submit-queue (batch tested with PRs 63073, 63376). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

don't reuse resource builder in describe

fixes #63363 

```release-note
NONE
```
2018-05-03 01:49:06 -07:00
Kubernetes Submit Queue 4f56127582
Merge pull request #63073 from andyxning/refactor_grpc_dial_with_dialcontext
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

refactor device plugin grpc dial with dialcontext

**What this PR does / why we need it**:
Refactor grpc `dial` with `dialContext` as `grpc.WithTimeout` has been deprecated by:
> use DialContext and context.WithTimeout instead.

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-03 01:16:34 -07:00
Kubernetes Submit Queue 456b56a2fb
Merge pull request #63227 from karataliu/nodec
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix ensure by provider id

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

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

**Special notes for your reviewer**:

cc @adnavare 

**Release note**:

```release-note
NONE
```
2018-05-03 00:08:48 -07:00
Kubernetes Submit Queue 4299a0518c
Merge pull request #63261 from dougm/cloudprovider-notimplemented
Automatic merge from submit-queue (batch tested with PRs 61725, 63261). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use cloudprovider.NotImplemented in AddSSHKeyToAllInstances

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

Minor cleanup: In looking at implementations of this method,
noticed a few providers created their own errors instead of using cloudprovider.NotImplemented

**Release note**:

```release-note
NONE
```
2018-05-02 22:16:06 -07:00
Kubernetes Submit Queue 186dd7beb1
Merge pull request #62903 from cofyc/fixfsgroupcheckinlocal
Automatic merge from submit-queue (batch tested with PRs 62657, 63278, 62903, 63375). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add more volume types in e2e and fix part of them.

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

- Add dir-link/dir-bindmounted/dir-link-bindmounted/bockfs volume types for e2e tests.
- Fix fsGroup related e2e tests partially.
- Return error if we cannot resolve volume path.
  - Because we should not fallback to volume path, if it's a symbolic link, we may get wrong results.

To safely set fsGroup on local volume, we need to implement these two methods correctly for all volume types both on the host and in container:

- get volume path kubelet can access
  - paths on the host and in container are different
- get mount references
  - for directories, we cannot use its mount source (device field) to identify mount references, because directories on same filesystem have same mount source (e.g. tmpfs), we need to check filesystem's major:minor and directory root path on it

Here is current status:

| | (A) volume-path (host) | (B) volume-path (container) | (C) mount-refs (host) | (D) mount-refs (container) |
| --- | --- | --- | --- | --- |
| (1) dir | OK | FAIL | FAIL | FAIL |
| (2) dir-link | OK | FAIL | FAIL | FAIL |
| (3) dir-bindmounted | OK | FAIL | FAIL | FAIL |
| (4) dir-link-bindmounted | OK | FAIL | FAIL | FAIL |
| (5) tmpfs| OK | FAIL | FAIL | FAIL |
| (6) blockfs| OK | FAIL | OK | FAIL |
| (7) block| NOTNEEDED | NOTNEEDED | NOTNEEDED | NOTNEEDED |
| (8) gce-localssd-scsi-fs| NOTTESTED | NOTTESTED | NOTTESTED | NOTTESTED |

- This PR uses `nsenter ... readlink` to resolve path in container as @msau42  @jsafrane [suggested](https://github.com/kubernetes/kubernetes/pull/61489#pullrequestreview-110032850). This fixes B1:B6 and D6, , the rest will be addressed in https://github.com/kubernetes/kubernetes/pull/62102.
- C5:D5 marked `FAIL` because `tmpfs` filesystems can share same mount source, we cannot rely on it to check mount references. e2e tests passes due to we use unique mount source string in tests.
- A7:D7 marked `NOTNEEDED` because we don't set fsGroup on block devices in local plugin. (TODO: Should we set fsGroup on block device?)
- A8:D8 marked `NOTTESTED` because I didn't test it, I leave it to `pull-kubernetes-e2e-gce`. I think it should be same as `blockfs`.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-02 20:13:11 -07:00
Kubernetes Submit Queue 4018211800
Merge pull request #63278 from feiskyer/azure-lb-new-interface
Automatic merge from submit-queue (batch tested with PRs 62657, 63278, 62903, 63375). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use new Azure SDK APIs for load balancer and public IP operations

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

#63063 updated Azure SDK to a stable version. After that, we should also update existing clients to use new SDK APIs.

Without this, public IP listing will be blocked forever in some case.

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

**Special notes for your reviewer**:

A following PR will be sent for other interfaces, e.g. routes and NSGs.

**Release note**:

```release-note
NONE
```
2018-05-02 20:13:07 -07:00
Kubernetes Submit Queue b5f61ac129
Merge pull request #62657 from matthyx/master
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update all script shebangs to use /usr/bin/env interpreter instead of /bin/interpreter

This is required to support systems where bash doesn't reside in /bin (such as NixOS, or the *BSD family) and allow users to specify a different interpreter version through $PATH manipulation.
https://www.cyberciti.biz/tips/finding-bash-perl-python-portably-using-env.html
```release-note
Use /usr/bin/env in all script shebangs to increase portability.
```
2018-05-02 19:44:32 -07:00
Jordan Liggitt a2ef4735cd
Let the kubernetes service reconciler timeout on shutdown 2018-05-02 22:44:28 -04:00
Dong Liu 9a6319b23c Update error assertation 2018-05-03 10:22:20 +08:00
Kubernetes Submit Queue c968d99ee5
Merge pull request #62516 from nicksardo/expand-id
Automatic merge from submit-queue (batch tested with PRs 62060, 62516). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

[GCE] Add new formats to resource parser and self link creator

**What this PR does / why we need it**:
- Expands the set of parse-able strings for resource IDs, while also simplifying the code. Note that these are acceptable values for some fields in GCP API.
  - global/networks/my-network
  - regions/us-central1/subnetworks/my-sub
  - zones/us-central1-a/instances/my-hacker-instance
- Fixes the SelfLink function to return links for regions and zones:
  - https://www.googleapis.com/compute/v1/projects/proj4/regions/us-central1
- Generates helper functions to create a ResourceID for each resource
- Generates a unit test that ensures all links can be generated and all generated links can be parsed.
- Fixes an ILB test which creates a malformed URL.

**Special notes for your reviewer**:
/assign rramkumar1

**Release note**:
```release-note
NONE
```
2018-05-02 18:12:06 -07:00
Kubernetes Submit Queue 03eb9f687f
Merge pull request #62060 from WanLinghao/namespace_miss_fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix namespace miss bug

**What this PR does / why we need it**:
This  patch fixes  the namespace miss problems.
I am not sure if this is the correct way it should be fixed.
Just offer a solution.
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #62059

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-02 18:04:06 -07:00
Jordan Liggitt ccd820d680
don't reuse resource builder in describe 2018-05-02 16:53:26 -04:00
Kubernetes Submit Queue 0d43bdec2b
Merge pull request #63294 from bertinatto/throttle_aws
Automatic merge from submit-queue (batch tested with PRs 63349, 63294). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add metric for throttled requests in AWS

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

This PR adds a metric for request throttling in AWS.

**Special notes for your reviewer**:

* Added metric.
* Moved metrics-related code to `aws_metrics.go`.
* Capitalized acronyms, e.g., `recordAwsMetric` to `recordAWSMetric`.

**Release note**:

```release-note
NONE
```
2018-05-02 11:43:10 -07:00
Kubernetes Submit Queue 96a0df6413
Merge pull request #59254 from WanLinghao/rbac_helpers_test_improve
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

	Add UT test for PolicyRuleBuilder

PolicyRuleBuilder is used to construct PolicyRule.
Add UT test to check if its construct is correct.	



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-02 06:46:59 -07:00
Fabio Bertinatto 5abe207eef Add metric for throttled requests in AWS 2018-05-02 12:35:37 +02:00
m1093782566 8b16d66b46 add some comment message 2018-05-02 17:02:07 +08:00
zhouhaibing089 6dc32c33d7 iptables: add timeout when checking rules
in cases where iptables stucks forever due to some reasons, we lost
the availability of kube-proxy, this is about adding a timeout for
the rule checking operations, as a result, it should give us a more
reliable working iptables proxy.
2018-05-02 16:25:17 +08:00
WanLinghao aec3d55c32 add UT test to PolicyRuleBuilder in file
./pkg/apis/rbac/helpers_test.go
2018-05-02 11:38:25 +08:00
WanLinghao a2c029f6c3 1.fix kubectl get * --all-namespaces
namespace miss error
	2.also add a test case
	modified:   pkg/kubectl/cmd/get/get.go
	modified:   hack/make-rules/test-cmd-util.sh
2018-05-02 11:27:22 +08:00
Cao Shufeng 5eefd7d012 not expose object detail when creating TokenRequest 2018-05-02 11:01:02 +08:00
Yecheng Fu 3748197876 Add more volume types in e2e and fix part of them.
- Add dir-link/dir-bindmounted/dir-link-bindmounted/blockfs volume types for e2e
tests.
- Return error if we cannot resolve volume path.
- Add GetFSGroup/GetMountRefs methods for mount.Interface.
- Fix fsGroup related e2e tests partially.
2018-05-02 10:31:42 +08:00
Kubernetes Submit Queue a30f459160
Merge pull request #63335 from deads2k/api-15-mappingtype
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update restmapping to indicate fully qualified resource

The resource of a restmapping is logically fully qualified and we have that value when we construct it.  Update the return value so that callers don't have to synthentically create one.

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

```release-note
NONE
```
2018-05-01 18:54:00 -07:00
Robert Krawitz 3f3c04d722 WIP: Correct kill logic for cgroup processes 2018-05-01 19:38:12 -04:00
Kubernetes Submit Queue 145f0aa5ed
Merge pull request #63091 from gonzolino/lb-member-name
Automatic merge from submit-queue (batch tested with PRs 63138, 63091, 63201, 63341). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Set names for OpenStack loadbalancer members and monitors

**What this PR does / why we need it**:
This PR sets names for OpenStack loadbalancer members and monitors.
ATM names for members and monitors are empty, making it difficult to identify where they belong.

Healthmonitors will be named `monitor_<lb_name>_<index>` and members
will be named `member_<lb_name>_<index>_<node_name>`.
This naming scheme should in sync with the naming of other LB resources, e.g. pools: `pool_<lb_name>_<index>`.

**Release note**:

```release-note
NONE
```
2018-05-01 16:00:12 -07:00
David Eads 9a48066749 update restmapping to indicate fully qualified resource 2018-05-01 16:34:49 -04:00
Kubernetes Submit Queue dc7f074213
Merge pull request #63309 from deads2k/server-13-rootscopedkind
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 remove rootscopedkinds from groupmeta

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

Since, a RESTMapping can only be determined based on a connection to a server, the only thing that needs to know the namespaced-ness of a resource is the code doing the registration.  Everything else is derived from that source of truth.  This removes the other dangling references and collapses down onto the existing namespaced-ness methods in the strategies backing the stores.

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

```release-note
NONE
```
2018-05-01 13:10:49 -07:00
Nick Sardo 8098b91951 Expand ability of ResourceID 2018-05-01 12:21:44 -07:00
Seth Jennings 2ef9e3054d kubelet: volume: do not create event on mount success 2018-05-01 14:14:42 -05:00
Kubernetes Submit Queue ed4739b36b
Merge pull request #63330 from deads2k/api-13-sparse
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add test for sparse version encoding/decoding

This adds tests that make sure the sparse version encoding and encoding work as callers will expect, with the correct version being picked from the list.  I wrote two tests, one a theoretical test not dependent on any API and another practical test using cronjobs which are currently sparse in the registry.

@liggitt turns out that because we find exact matches, sparse versions ought to work out fine.
@smarterclayton I hate that the versioner matches on type.  I'll update that separately I think.


```release-note
NONE
```
2018-05-01 12:11:35 -07:00
Kubernetes Submit Queue d39ff8e651
Merge pull request #60717 from liggitt/field-selector
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add field selector support to delete, label, annotate

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

Builds out field selector support for more bulk commands

**Release note**:
```release-note
kubectl now supports --field-selector for `delete`, `label`, and `annotate`
```
2018-05-01 11:20:24 -07:00
David Eads 94e3d94d67 update tests to be specific about the versions they are testing instead of floating 2018-05-01 13:18:41 -04:00
David Eads 8ae62517da remove rootscopedkinds from groupmeta 2018-05-01 13:08:23 -04:00
Kubernetes Submit Queue 8eb7eeef39
Merge pull request #63321 from sjenning/fix-pod-deletor
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 kubelet: force filterContainerID to empty string when removeAll is true 

fixes https://github.com/kubernetes/kubernetes/issues/57865

alternative to https://github.com/kubernetes/kubernetes/pull/62170

There is a bug in the container deletor where if `removeAll` is `true` in `deleteContainersInPod()` the `filterContainerID` is still used to filter results in `getContainersToDeleteInPod()`.  If the filter container is not found, no containers are returned for deletion.

https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/pod_container_deletor.go#L74-L77

This is the case for the delayed deletion a pod in `CrashLoopBackoff` as the death of the infra container in response to the `DELETE` is detected by PLEG and triggers an attempt to clean up all containers but uses the infra container id as a filter with `removeAll` set to `true`.  The infra container is immediately deleted and thus can not be found when `getContainersToDeleteInPod()` tries to find it.  Thus the dead app container from the previous restart attempt still exists.

`canBeDeleted()` in the status manager will return `false` until all the pod containers are deleted, delaying the deletion of the pod on the API server.

The removal of the containers is eventually forced by the API server `REMOVE` after the grace period.
2018-05-01 09:50:13 -07:00
Kubernetes Submit Queue 3f05fa21d7
Merge pull request #63299 from liggitt/kubectl-get-help
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add version/group usage and example to kubectl get

Fixes #63286 

```release-note
NONE
```
2018-05-01 08:57:54 -07:00
Filipe Brandenburger b230fb8ac4 Use a []string for CgroupName, which is a more accurate internal representation
The slice of strings more precisely captures the hierarchic nature of
the cgroup paths we use to represent pods and their groupings.

It also ensures we're reducing the chances of passing an incorrect path
format to a cgroup driver that requires a different path naming, since
now explicit conversions are always needed.

The new constructor NewCgroupName starts from an existing CgroupName,
which enforces a hierarchy where a root is always needed. It also
performs checking on the component names to ensure invalid characters
("/" and "_") are not in use.

A RootCgroupName for the top of the cgroup hierarchy tree is introduced.

This refactor results in a net reduction of around 30 lines of code,
mainly with the demise of ConvertCgroupNameToSystemd which had fairly
complicated logic in it and was doing just too many things.

There's a small TODO in a helper updateSystemdCgroupInfo that was
introduced to make this commit possible. That logic really belongs in
libcontainer, I'm planning to send a PR there to include it there.
(The API already takes a field with that information, only that field is
only processed in cgroupfs and not systemd driver, we should fix that.)

Tested by running the e2e-node tests on both Ubuntu 16.04 (with cgroupfs
driver) and CentOS 7 (with systemd driver.)
2018-05-01 08:29:06 -07:00
Kubernetes Submit Queue f03f83a20a
Merge pull request #63206 from deads2k/api-11-restmapper
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove incorrect static restmapper from type registry

A RESTMapping can only be determined by inspecting a server since discovery is the authoritative source of mapping decisions.  This removes a deceptive method from the type registry and makes the old logic available for existing tests in a separate, clearly labeled package.

@kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-cli-maintainers 

```release-note
NONE
```
2018-05-01 08:10:37 -07:00
Kubernetes Submit Queue 8e99d621e9
Merge pull request #63253 from deads2k/client-05-dynamic-update
Automatic merge from submit-queue (batch tested with PRs 63152, 63253). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make dynamic client slightly easier to use and add fakes

Tweaks the dynamic client to make it more "normal" for resources to namespaces.  Adds a fake dynamic client.

@kubernetes/sig-api-machinery-pr-reviews 
/assign @hzxuzhonghu
/assign @sttts 


```release-note
NONE
```
2018-05-01 07:36:12 -07:00
David Eads f9b32d762a add test for sparse version encoding/decoding 2018-05-01 09:34:06 -04:00
Kubernetes Submit Queue b46dad61c8
Merge pull request #63177 from smarterclayton/dependencies
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubectl should not have a direct code dependency on controllers

The dependency linkage brings in the scheduler and a lot of unrelated
code. Instead, selectively copy methods that operate on public APIs.

@liggitt
2018-05-01 05:06:35 -07:00
David Eads 1e5372b620 get the resource.Info out of the conversion business 2018-05-01 07:58:42 -04:00
David Eads 1cb797e355 acknowledge that creation of a restmapper can fail and that we cannot have a default 2018-05-01 07:52:51 -04:00
David Eads ef0d1ab819 remove incorrect static restmapper 2018-05-01 07:51:17 -04:00
Kubernetes Submit Queue 12a6236148
Merge pull request #63178 from misterikkit/ecache-locking
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

scheduler: clean up and simplify equivalence cache locking

**What this PR does / why we need it**:
This is a cleanup of the locking code for equivalence cache. There is no change to the current logic or locking. This PR has a couple of implications, though.
1. It deletes (unreachable) code that could have been used to cache predicate results that consider nominated pods.
2. Callers should no longer lock/unlock the eCache manually, so coordinating that lock with other synchronization is restricted.


**Special notes for your reviewer**:

**Release note**:
<!--  Write your release note:
1. Enter your extended release note in the below block. If the PR requires additional action from users switching to the new release, include the string "**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #
action required".
2. If no release note is required, just write "NONE".
-->
```release-note
NONE
```
/sig scheduling
/kind cleanup
2018-04-30 19:29:49 -07:00
Seth Jennings 1fb3b24b63 kubelet: fix warning message to not print pointer addrs 2018-04-30 16:38:43 -05:00
Seth Jennings 2aba27da86 kubelet: force filterContainerID to empty string when removeAll is true 2018-04-30 16:29:17 -05:00
Kubernetes Submit Queue b36743fe30
Merge pull request #63198 from soltysh/kubectl_cleaning
Automatic merge from submit-queue (batch tested with PRs 58474, 60034, 62101, 63198). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove Factory from more Run commands

/assign @juanvallejo 

**Release note**:
-->
```release-note
NONE
```
2018-04-30 13:24:15 -07:00
Kubernetes Submit Queue 15cc20630d
Merge pull request #60034 from pohly/device-manager-goroutine
Automatic merge from submit-queue (batch tested with PRs 58474, 60034, 62101, 63198). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

avoid race condition in device manager and plugin startup/shutdown: wait for goroutines

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

Commit 1325c2f worked around issue #59488, but it is still worthwhile to fix the underlying root cause properly.

**Which issue(s) this PR fixes**:
Fixes #59488

**Special notes for your reviewer**:

This is an alternative to PR #59861, which used a different approach. Personally I tend to prefer this one now.

**Release note**:
```release-note
NONE
```

/sig node
/area hw-accelerators
/assign vikaschoudhary16
2018-04-30 13:24:08 -07:00
Davanum Srinivas 4bacd77321 Remove unused code 2018-04-30 14:57:26 -04:00
David Eads 04384481cd remove unnecessary encoder 2018-04-30 14:55:15 -04:00
Maciej Szulik b7d4f15965
Remove Factory from more Run commands 2018-04-30 19:58:54 +02:00
Jordan Liggitt 32e6775a71
Add version/group usage and example to kubectl get 2018-04-30 11:11:53 -04:00
Kubernetes Submit Queue 7ffd171c29
Merge pull request #62729 from databus23/fix-os-route-deletion
Automatic merge from submit-queue (batch tested with PRs 59879, 62729). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Openstack: fix orphaned route deletion

This is a follow-up to #56258 which only got half of the work done.
The OpenStack cloud providers DeleteRoute method fails to delete routes when it can’t find the corresponding instance in OpenStack.

```release-note
OpenStack cloudprovider: Fix deletion of orphaned routes
```
2018-04-30 06:58:06 -07:00
Fabio Bertinatto 81bf821d69 Capitalize acronyms in AWS metrics-related code 2018-04-30 15:50:18 +02:00
David Eads 5ff923c7f9 make dynamic client slightly easier to use 2018-04-30 08:54:30 -04:00
WanLinghao 771882bbba clean unused variables 2018-04-30 16:39:12 +08:00
Kubernetes Submit Queue 03c5f298f3
Merge pull request #62534 from nicolasbigler/duplicate-iptables-comment
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix duplicate comment in iptables rule for non-local public-port rule

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

When kubernetes creates an iptable rule for "from-non-local public-port"
rule the rule gets created with two identical comment section.

The function `iptablesNonLocalNodePortArgs` creates a list of arguments
for the rule from iptablesCommonPortalArgs function. This function
already appends the arguments for the rules comments and therefore does
not require appending the comment again.

**Special notes for your reviewer**:

I'm actually not a go programmer at all and have no idea how your tests work.
I doubt that my fix will require adjustements on tests but I'm not 100% sure.
If additional work is needed, I would be glad if someone could point it out to me so I can take care of it.

**Release note**:
```release-note
NONE
```
2018-04-29 11:39:40 -07:00
Kubernetes Submit Queue dfba1c1f2c
Merge pull request #62497 from MrHohn/endpoint-controller-headless-ports
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix a bug that headless service without ports fails to have endpoint created.

**What this PR does / why we need it**:
Follow up of https://github.com/kubernetes/kubernetes/pull/47250. Headless service without ports fails to have corresponding endpoint created because endpoint controller deliberately attaches a dummy endpointPort with portNum=0, which will fail API validation check. Error as below:
```
endpoints_controller.go:375] Error syncing endpoints for service "default/XXX": Endpoints "XXX" is invalid: subsets[0].ports[0].port: Invalid value: 0: must be between 1 and 65535, inclusive
```

This PR makes endpoint controller not attach the dummy endpointPort for headless service.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #55158, fixes #62440 

**Special notes for your reviewer**:
cc @xiangpengzhao 

**Release note**:

```release-note
Fix a bug that headless service without ports fails to have endpoint created.
```
2018-04-29 07:45:02 -07:00
Kubernetes Submit Queue b16d054ed5
Merge pull request #62438 from MrHohn/ep-controller-owner
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add approvers to pkg/controller/endpoint

**What this PR does / why we need it**:
Promoting reviewers listed in pkg/controller/endpoint to approvers.

/assign @thockin 
cc @bowei 

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

**Release note**:

```release-note
NONE
```
2018-04-29 06:44:58 -07:00
Kubernetes Submit Queue a4d2a3a4bb
Merge pull request #63271 from ceshihao/clean_test_util
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move pkg/scheduler/util/testutil.go to pkg/scheduler/testing

**What this PR does / why we need it**:
In the package `k8s.io/kubernetes/pkg/scheduler/util`, we have testutil.go, which has an init() function. Since this package is imported in production code, we are inadvertently running test code in production.

Fortunately (depending on how you look at it) scheduler already has a package called `k8s.io/kubernetes/pkg/scheduler/testing` which would be an appropriate home for these utils.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-04-29 03:21:39 -07:00
ceshihao 7f24a7c984 run make update 2018-04-28 15:43:09 +00:00