Commit Graph

30869 Commits (11c47e18729cd1a395a85e85f8b7a435cba06e6d)

Author SHA1 Message Date
Kubernetes Submit Queue ef388fee53
Merge pull request #66948 from mohamed-mehany/anti-affinity-optimization
Automatic merge from submit-queue (batch tested with PRs 67041, 66948). 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>.

Anti affinity optimization

**What this PR does / why we need it**:
This pull request aims to optimize the performance of anti-affinity rules lookup of existing pods
This optimization maps the topology values to a list of pods running on nodes that match this value and store that map in the pod metadata. Accordingly, when validating anti-affinity rules of existing pods we will only check those running on nodes with similar topology values to the current candidate (node) for scheduling.

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

**Special notes for your reviewer**:
/sig scalability
/sig scheduling
**Release note**:

```release-note
improve performance of anti-affinity predicate of default scheduler.
```
2018-08-17 19:14:08 -07:00
yanxuean efca28f8a5 remove deplicate code for PodRequestsAndLimits
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2018-08-18 09:22:28 +08:00
Kubernetes Submit Queue c2c0d9e441
Merge pull request #67472 from islinwb/pkg_proxy_util-add-ut
Automatic merge from submit-queue (batch tested with PRs 66733, 67472). 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 for PortPart()

**What this PR does / why we need it**:
improve ut coverage

**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-08-17 17:50:05 -07:00
Kubernetes Submit Queue 8c1bfeb0cf
Merge pull request #66733 from bsalamat/subset_nodes
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 a feature to the scheduler to score fewer than all nodes in every scheduling cycle

**What this PR does / why we need it**:
Today, the scheduler scores all the nodes in the cluster in every scheduling cycle (every time a posd is attempted). This feature implements a mechanism in the scheduler that allows scoring fewer than all nodes in the cluster. The scheduler stops searching for more nodes once the configured number of feasible nodes are found. This can help improve the scheduler's performance in large clusters (several hundred nodes and larger).
This PR also adds a new structure to the scheduler's cache, called NodeTree, that allows scheduler to iterate over various nodes in different zones in a cluster. This is needed to avoid scoring the same set of nodes in every scheduling cycle.

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

**Special notes for your reviewer**:
This is a large PR, but broken into a few logical commits. Reviewing would be easier if you review by commits.

**Release note**:

```release-note
Add a feature to the scheduler to score fewer than all nodes in every scheduling cycle. This can improve performance of the scheduler in large clusters.
```
2018-08-17 17:21:32 -07:00
Ahmad Diaa b4c7d190cd using set instead of lists for topologyPairsMaps attributes 2018-08-18 01:02:48 +02:00
Ahmad Diaa 0f4c3064fd created struct for topologyPairs maps 2018-08-18 01:02:48 +02:00
Ahmad Diaa f6659e4543 further enhancements removing matchingTerms from metadata 2018-08-18 01:02:47 +02:00
Mohamed Mehany 3fb6912d08 add topologyValue map to reduce search space 2018-08-18 01:02:46 +02:00
Kubernetes Submit Queue 8b52ca1ab9
Merge pull request #67433 from deads2k/controller-02-quotadiscovery
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>.

allow failed discovery on initial quota controller start

Fixes #65005

Aggregated API servers now correctly provide 503s on discovery endpoints for groups that cannot be reached.  This means that the kube-controller-manager process is now sensitive to discovery failures in the quota controller.  This change allows discovery failures in the initial quota replenishment controller resource discovery.

@liggitt suspects similar races exist to those he found GC last release, but this pull doesn't make that better or worse.

@kubernetes/sig-api-machinery-bugs
2018-08-17 16:01:31 -07:00
Kubernetes Submit Queue 567b3025ce
Merge pull request #67194 from yue9944882/refactor/storage-object-inuse-protection-externalize
Automatic merge from submit-queue (batch tested with PRs 67194, 67540). 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>.

Externalize PV/PVC informer for StorageObjectInUseProtection & NodeAuthorizer

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

/sig api-machinery

ref: #66680

We move on and make the change happen for PV/PVC. 

> PV: NodeAuthorizer, StorageObjectInUseProtection
> PVC: StorageObjectInUseProtection

1. Externalize PV and PVC informers for `StorageObjectInUseProtection`
2. Copy utility functions for PV from `pkg/api/persistentvolume` to `pkg/api/v1/persistentvolume` and make it accept external types.
3. Bump PV informer in NodeAuthorizer

**Release note**:

```release-note
NONE
```
2018-08-17 13:23:06 -07:00
Kubernetes Submit Queue 1737a43324
Merge pull request #66876 from juanvallejo/jvallejo/prototype-plugins
Automatic merge from submit-queue (batch tested with PRs 67062, 67169, 67539, 67504, 66876). 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 the kubectl plugin mechanism

**Release note**:
```release-note
The plugin mechanism functionality to closely follow the git plugin design
```

Replace the existing plugin mechanism with the design proposed in https://github.com/kubernetes/community/pull/2437.

~~_The full implementation of the plugin mechanism itself is entirely contained within the first commit._~~

## Walkthrough

Under the new design, there is no plugin installation or loading required to use plugins.
A plugin is simply any executable file on a user's PATH whose name begins with `kubectl-`.
- Plugins receive the inherited environment from the `kubectl` binary. All environment variables
accessible by `kubectl` become accessible by the plugin.
- Plugins decide which command path they wish to implement based on their name. For example, a plugin wanting to provide a new command `foo`, would simply be named `kubectl-foo`.

### Creating a plugin

Below is an example plugin, that we will use for this walkthrough. Plugins may be written in any language, and handle arguments and flags in any way, optionally (as a convention) providing a way to retrieve their version via a `version` subcommand.

```bash
#!/bin/bash

# optional argument handling
if [[ "$1" == "version" ]]
then
    echo "1.0.0"
    exit 0
fi

# optional argument handling
if [[ "$1" == "config" ]]
then
    echo $KUBECONFIG
    exit 0
fi

echo "I am a plugin named kubectl-foo"
```

### Using a plugin

To use a plugin, simply make it executable:

```bash
sudo chmod +x ./kubectl-foo
```

and place it anywhere in your PATH:

```bash
sudo mv ./kubectl-foo /usr/local/bin
```

You may now invoke your plugin as a `kubectl` command:

```bash
$ kubectl foo
I am a plugin named kubectl-foo
```

All args and flags are passed as-is to the executable:

```bash
$ kubectl foo version
1.0.0
```

All environment variables are also passed as-is to the executable:

```bash
$ export KUBECONFIG=~/.kube/config
$ kubectl foo config
/home/<user>/.kube/config

$ KUBECONFIG=/etc/kube/config kubectl foo config
/etc/kube/config
```

Additionally, the first argument that is passed to a plugin will always be the full path to the location where it was invoked (`$0` would equal `/usr/local/bin/kubectl-foo` in our example above).

### Plugin discoverability

Seeing as how the `kubectl plugin` command is left as a no-op with this PR (perhaps it could serve as an entrypoint towards additional plugin functionality in the future), a small subcommand has been included that _lists all available plugin executables on a user's PATH_, along with any warnings it finds.

Example usage of this new subcommand is included below:

```bash
$ kubectl plugin list
The following kubectl-compatible plugins are available:

test/fixtures/pkg/kubectl/plugins/kubectl-foo
plugins/kubectl-foo
  - warning: plugins/kubectl-foo is overshadowed by a similarly named plugin: test/fixtures/pkg/kubectl/plugins/kubectl-foo
plugins/kubectl-invalid
  - warning: plugins/kubectl-invalid identified as a kubectl plugin, but it is not executable
plugins/kubectl-bar

error: 2 plugin warnings were found
```

cc @kubernetes/kubectl-maintainers @kubernetes/sig-cli-pr-reviews @soltysh @seans3 @mengqiy
2018-08-17 11:58:22 -07:00
Kubernetes Submit Queue 027d0fcfdf
Merge pull request #67062 from cofyc/fix66287
Automatic merge from submit-queue (batch tested with PRs 67062, 67169, 67539, 67504, 66876). 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>.

Double check PVC if not found in syncVolume

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

Double check PVC if not found in syncVolume.
    
If PV is bound by external PV binder (e.g. kube-scheduler), it's possible on heavy load that corresponding PVC is not synced to controller local cache yet.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Double check PVC if not found in syncVolume to prevent reclaiming PV wrongly.
```
2018-08-17 11:58:06 -07:00
Bobby (Babak) Salamat 2860743c86 Autogenerated files 2018-08-17 11:18:52 -07:00
Bobby (Babak) Salamat abb70aee98 Add a scheduler config argument to set the percentage of nodes to score 2018-08-17 11:18:51 -07:00
Tim Allclair e6eb2e7dea Add RuntimeHandler to the CRI RunPodSandboxRequest 2018-08-17 10:56:49 -07:00
Kubernetes Submit Queue 53ee2e5307
Merge pull request #67528 from andyzhangx/azuredisk-sku
Automatic merge from submit-queue (batch tested with PRs 66920, 67316, 67363, 67528, 66963). 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 storage account sku support for azure disk

add error msg



**What this PR does / why we need it**:
Original hard coded storage account sku list is not good design, swith to use `storage.PossibleSkuNameValues()` to add more sku support for azure disk

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

**Special notes for your reviewer**:

**Release note**:

```
add more storage account sku support for azure disk
```

/sig azure
@feiskyer 
FYI @khenidak
2018-08-17 10:37:17 -07:00
Kubernetes Submit Queue 4fff352371
Merge pull request #67316 from m1kola/67314_fix_regression
Automatic merge from submit-queue (batch tested with PRs 66920, 67316, 67363, 67528, 66963). 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>.

Fixes regression in kubectl logs: the --all-containers=true option didn't work

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

Fixes regression introduced in #66398 and adds unit tests for logging with `--all-containers=true`. See #67314 for more details.

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

**Special notes for your reviewer**:

I didn't cover cases with `coreinternal.PodList` and `coreinternal.Pod` in tests, because it doesn't look like we need them: I didn't manage to find any callers of the `logsForObjectWithClient` and `logsForObject` functions, so, probably, we can remove them. I'll double check and try to do that separately once this PR is merged.

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

/sig cli
2018-08-17 10:37:09 -07:00
Bobby (Babak) Salamat a5045d107e Add NodeTree to the scheduler cache 2018-08-17 09:56:51 -07:00
Bobby (Babak) Salamat c1896c97ea Add a node tree that allows iterating over nodes in regions and zones 2018-08-17 09:56:51 -07:00
Kubernetes Submit Queue b9544382ba
Merge pull request #67060 from sttts/sttts-unify-insecure-serving
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>.

kube-{apiserver,ctrl-mgr}: unify into DeprecatedInsecureServingOptions

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

```
2018-08-17 08:50:36 -07:00
David Eads 4c8e9de293 allow failed discovery on initial quota controller start 2018-08-17 11:42:54 -04:00
Kubernetes Submit Queue 40af953850
Merge pull request #67068 from sttts/sttts-non-fatal-ratelimitermetircs-reuse
Automatic merge from submit-queue (batch tested with PRs 66793, 67405, 67068, 67501, 67484). 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>.

pkg/util/metrics: make re-registration of RateLimiterMetric non-fatal

In integration tests we might register these metrics multiple times in parallel. Instead of unregistering and making somehow sure those tests can run in parallel, we just make the registration idem-potent.

Prerequisite for controller manager integration tests https://github.com/kubernetes/kubernetes/pull/64149.
2018-08-17 05:05:17 -07:00
Kubernetes Submit Queue c927968903
Merge pull request #67405 from MorrisLaw/default_load_balancer_name_comment
Automatic merge from submit-queue (batch tested with PRs 66793, 67405, 67068, 67501, 67484). 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>.

Updated comment for DefaultLoadBalancerName to provide further context

**What this PR does / why we need it**:
Updates the comment for DefaultLoadBalancerName to provide better context and also as a reminder that it should eventually be removed.

**Release note**:

```release-note
NONE
```
2018-08-17 05:05:13 -07:00
choury 36b92b9b29 cpumanager: rollback state if updateContainerCPUSet failed 2018-08-17 18:08:58 +08:00
Kubernetes Submit Queue 5a4e9d11f0
Merge pull request #67498 from hanxiaoshuai/addut0816
Automatic merge from submit-queue (batch tested with PRs 66209, 67380, 67499, 67437, 67498). 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 unit test for pkg/kubeapiserver/options/authentication.go

**What this PR does / why we need it**:
add unit test for pkg/kubeapiserver/options/authentication.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-08-17 03:01:20 -07:00
Kubernetes Submit Queue b345cee91a
Merge pull request #67437 from fisherxu/sourcecode
Automatic merge from submit-queue (batch tested with PRs 66209, 67380, 67499, 67437, 67498). 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 versioned api in kube-proxy

**What this PR does / why we need it**:
Now in kube-proxy someplace still use the internal version api, change to use versioned api. 

**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-08-17 03:01:16 -07:00
Kubernetes Submit Queue 4819c65028
Merge pull request #67380 from tianshapjq/nits-in-manager.go
Automatic merge from submit-queue (batch tested with PRs 66209, 67380, 67499, 67437, 67498). 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>.

nits in manager.go

**What this PR does / why we need it**:
just found some nits in the manager.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-08-17 03:01:09 -07:00
Kubernetes Submit Queue eeb3389f3b
Merge pull request #63260 from misterikkit/ecache-metrics
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: add metrics to equivalence cache

This adds counters to equiv. cache reads & writes. Reads are labeled by
hit/miss, while writes are labeled to indicate whether the write was
discarded.

This will give us visibility into,
- hit rate of cache reads
- ratio of reads to writes
- rate of discarded writes



**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 https://github.com/kubernetes/kubernetes/issues/63259

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-17 01:10:51 -07:00
Dr. Stefan Schimanski e8300dea52 pkg/util/metrics: idem-potent registration of RateLimiterMetric and never cleanup 2018-08-17 09:15:33 +02:00
Dr. Stefan Schimanski c2724793e8 Update bazel 2018-08-17 08:57:21 +02:00
Dr. Stefan Schimanski d787213d1b kube-apiserver: switch apiserver's DeprecatedInsecureServingOptions 2018-08-17 08:56:47 +02:00
Dr. Stefan Schimanski 1d9a896066 apiserver: move controller-manager's insecure config into apiserver 2018-08-17 08:56:46 +02:00
andyzhangx aa4594ffae add more sku support for azure disk
add error msg

update bazel
2018-08-17 06:52:46 +00:00
yue9944882 e7d0983707 externalize pv informer in node authorizer 2018-08-17 11:14:43 +08:00
yue9944882 b497570e50 util for external pv
prune unused pv utils and its test
2018-08-17 11:14:42 +08:00
Cheng Xing e5cf6f5c71 Added set and map structural validation for AllowedTopologies 2018-08-16 16:27:24 -07:00
Kubernetes Submit Queue d17bbf8d38
Merge pull request #67372 from tanshanshan/priority-814
Automatic merge from submit-queue (batch tested with PRs 67137, 67372, 67505, 67373, 67357). 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 apiserver crashed when priority classs already exists

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

when priority classs already exists , ignore error 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-16 10:34:15 -07:00
Kubernetes Submit Queue d3a0bb6a84
Merge pull request #67137 from juanvallejo/jvallejo/usability-fix-kube-get
Automatic merge from submit-queue (batch tested with PRs 67137, 67372, 67505, 67373, 67357). 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>.

prevent "No resources found" output on forbidden error

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

This was originally fixed in https://github.com/kubernetes/kubernetes/pull/35115, but made its way back. Added a small test

cc @soltysh
2018-08-16 10:34:11 -07:00
Kubernetes Submit Queue 3817e21c03
Merge pull request #55840 from yanxuean/v1-configmap-test
Automatic merge from submit-queue (batch tested with PRs 67399, 67471, 66815, 67301, 55840). 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 unit test for v1.configmap and remove replicate code

**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-08-16 09:03:21 -07:00
Kubernetes Submit Queue 21c2af131e
Merge pull request #67301 from dixudx/use_apimachinery_NameIsDNSSubdomain
Automatic merge from submit-queue (batch tested with PRs 67399, 67471, 66815, 67301, 55840). 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 NameIsDNSSubdomain validation from staging

**What this PR does / why we need it**:
> // TODO update all references to these functions to point to the apimachineryvalidation ones

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

**Special notes for your reviewer**:
/cc seans3
@kubernetes/sig-apps-pr-reviews 
@kubernetes/sig-api-machinery-pr-reviews 

**Release note**:

```release-note
None
```
2018-08-16 09:03:16 -07:00
Kubernetes Submit Queue 46fd351b89
Merge pull request #66815 from fseldow/dev
Automatic merge from submit-queue (batch tested with PRs 67399, 67471, 66815, 67301, 55840). 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 load balancer IP change when updating service

**What this PR does / why we need it**:
To fix bug in azure load balancer. Change frontend IP Configuration while updating service without changing its internal annotation

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

```release-note
NONE
```
2018-08-16 09:03:13 -07:00
Kubernetes Submit Queue 4ccee77fad
Merge pull request #67399 from deads2k/cli-04-patch
Automatic merge from submit-queue (batch tested with PRs 67399, 67471, 66815, 67301, 55840). 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 patch to work with --local and avoid extra requests

--local wasn't being respected by the resourcebuilder and then the later refreshes were unnecessary and violated --local in some cases.

@kubernetes/sig-cli-maintainers 
@juanvallejo 

```release-note
kubectl patch now respects --local
```
2018-08-16 09:03:06 -07:00
Kubernetes Submit Queue 2744f264f5
Merge pull request #67451 from janetkuo/deploy-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>.

replace mfojtik as approver of Deployment

**Release note**:

```release-note
NONE
```
2018-08-16 06:29:42 -07:00
hangaoshuai cacf18f859 add unit test for func ToAuthenticationConfig 2018-08-16 19:24:11 +08:00
hangaoshuai 4157f5a1ae add unit test for Authentication Validate 2018-08-16 18:13:58 +08:00
Xinhe Li 006310b78e fix load balancer IP change when updating service 2018-08-16 16:49:07 +08:00
Kubernetes Submit Queue 59fdc02b13
Merge pull request #67353 from yguo0905/tpu-api-timeout
Automatic merge from submit-queue (batch tested with PRs 67375, 67353). 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>.

Allow passing timeout on TPU API operations via context

The caller will provide a context with timeout attached.

**Release note**:

```release-note
None
```

/assign @vishh
2018-08-16 00:54:59 -07:00
linyouchong b4c27a1501 Remove incorrect comment 2018-08-16 15:52:00 +08:00
andyzhangx 3013df9e9e change default value of kind for azure disk 2018-08-16 07:13:01 +00:00
Pengfei Ni 680e64f6ae Add unit tests for InstanceID 2018-08-16 14:38:30 +08:00
Pengfei Ni a09bcb20c7 Reduce API calls for Azure instance metadata 2018-08-16 14:38:04 +08:00
Kubernetes Submit Queue da3f1a3ea1
Merge pull request #64445 from squeed/more-cni-capabilities
Automatic merge from submit-queue (batch tested with PRs 64445, 67459, 67434). 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>.

dockershim/network: pass ipRange CNI capabilities

**What this PR does / why we need it**:
Updates the dynamic (capability args) passed from Kubernetes to the CNI plugin. This means CNI plugin authors can offer more features and / or reduce their dependency on the APIServer.

Currently, we only pass the `portMappings` capability. CNI now supports `bandwidth` for bandwidth limiting and `ipRanges` for preferred IP blocks. This PR adds support for these two new capabilities.

Bandwidth limits are provided - as implemented in kubenet - via the pod annotations `kubernetes.io/ingress-bandwidth` and `kubernetes.io/egress-bandwidth`.

The ipRanges field simply passes the PodCIDR. This does mean that we need to change the NodeReady algorithm. Previously, we would only set NodeNotReady on missing PodCIDR when using Kubenet. Now, if the CNI configuration includes the `ipRanges` capability, we need to do the same.

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

**Release note**:

```release-note
The dockershim now sets the "bandwidth" and "ipRanges" CNI capabilities (dynamic parameters). Plugin authors and administrators can now take advantage of this by updating their CNI configuration file. For more information, see the [CNI docs](https://github.com/containernetworking/cni/blob/master/CONVENTIONS.md#dynamic-plugin-specific-fields-capabilities--runtime-configuration)
```
2018-08-15 22:54:07 -07:00
Morten Torkildsen 8e497274c9 Better error message when checking rollout status for StatefulSet with OnDelete strategy type 2018-08-15 21:39:14 -07:00
Kubernetes Submit Queue cffa2aed0e
Merge pull request #64601 from hzxuzhonghu/cm-dynamic-loglevel-set
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>.

Other components support set log level dynamically

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

#63777 introduced a way to set glog.logging.verbosity dynamically. 
We should enable this for all other components, which is specially useful in debugging. 


**Release note**:

```release-note
Expose `/debug/flags/v` to allow kubelet dynamically set glog logging level.  If want to change glog level to 3, you only have to send a PUT request like `curl -X PUT http://127.0.0.1:8080/debug/flags/v -d "3"`.
```
2018-08-15 21:32:46 -07:00
Weibin Lin 2f30751db3 add ut for PortPart() 2018-08-16 11:49:48 +08:00
Kubernetes Submit Queue 825548df95
Merge pull request #67464 from misterikkit/deadcode
Automatic merge from submit-queue (batch tested with PRs 67461, 67464, 67416). 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>.

Delete dead code in pkg/scheduler

**What this PR does / why we need it**:
This is just some cleanup. I found some unused code while evaluating the scheduler 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
```
/kind cleanup
/sig scheduling
2018-08-15 20:09:09 -07:00
Kubernetes Submit Queue ccef02e04f
Merge pull request #67461 from janetkuo/ds-collision-count
Automatic merge from submit-queue (batch tested with PRs 67461, 67464, 67416). 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 unnecessary DaemonSet collisionCount bump

**What this PR does / why we need it**: Sometimes DaemonSet controller will bump its collisionCount more than necessary when the collisionCount of the DaemonSet in the cache store hasn't been updated. This won't affect users, as collisionCount is only used for creating unique hash and the number doesn't matter as long as it changes. This fix avoids the unnecessary collisionCount updates and de-flakes the DaemonSet test for collisionCount. 

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

**Special notes for your reviewer**: @kubernetes/sig-apps-pr-reviews 

**Release note**:

```release-note
NONE
```
2018-08-15 20:09:05 -07:00
yanxuean 9770ff9082 improve GetExistingContainerStatus
remove duplicate

Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2018-08-16 11:03:12 +08:00
Yecheng Fu 493502d0ae Double check PVC if not found in syncVolume.
If PV is bound by external PV binder (e.g. kube-scheduler), it's
possible on heavy load that corresponding PVC is not synced to
controller local cache yet.
2018-08-16 10:33:28 +08:00
fisherxu 5a9bea0353 update bazel 2018-08-16 09:59:33 +08:00
x00416946 fisherxu 79e17e6cd7 use versioned api in kube-proxy 2018-08-16 09:59:33 +08:00
Kubernetes Submit Queue 92fc828d63
Merge pull request #67456 from Huang-Wei/pods-incresing-issue
Automatic merge from submit-queue (batch tested with PRs 65561, 67109, 67450, 67456, 67402). 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 an issue in NodeInfo.Clone()

- usedPorts is a map-in-map struct, add fix to ensure it's deep copied
- updated unit test

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

Due to PR "Refactor HostIP predicate algorithm #55910", internal `usedPorts` data structure was changed from "map[string]bool" to "map[string]map[ProtocolPort]struct{}".

However, it breaks behavior of `NodeInfo.Clone()`: in the before, one loop `for k, v := range usedPorts` worked fine because it's a safe assignment, but it's not safe any more for a map-in-map using original code. A similar go playground sample is here: https://play.golang.org/p/puqMN71cmSO.

**Which issue(s) this PR fixes**:
Fixes #67453 (_Might_ also related with #66568)

**Special notes for your reviewer**:
- No matter pod preemption is enabled or disabled, #67453 can be triggered.
- As #55910 was introduced in 1.10, this fix needs to back ported to 1.10 and 1.11 release branches.

**Release note**:
```release-note
Fix an issue that pods using hostNetwork keep increasing.
```
2018-08-15 18:15:16 -07:00
Kubernetes Submit Queue b904a3dc48
Merge pull request #67109 from MHBauer/error-typo
Automatic merge from submit-queue (batch tested with PRs 65561, 67109, 67450, 67456, 67402). 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>.

error text refers to wrong stream type

**What this PR does / why we need it**:
clarify error text

**Special notes for your reviewer**:
I think this was a copy and paste error.

**Release note**:
```release-note
NONE
```
2018-08-15 18:15:10 -07:00
Kubernetes Submit Queue 6faf115870
Merge pull request #65561 from k82cn/k8s_65372_1
Automatic merge from submit-queue (batch tested with PRs 65561, 67109, 67450, 67456, 67402). 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>.

Compared preemption by priority in Kubelet

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

**Release note**:
```release-note
None
```
2018-08-15 18:15:06 -07:00
morrislaw df4f26ef39 Updated cloud providers with todo comment if using DefaultLoadBalancerName 2018-08-15 21:03:44 -04:00
morrislaw 4f8fe9d922 Update DefaultLoadBalancerName method and add that its deprecated 2018-08-15 20:54:29 -04:00
tanshanshan a99b619c11 fix apiserver crashed when priority classs already exists 2018-08-16 08:46:55 +08:00
Jonathan Basseri fbf3d2b84c Delete dead code in pkg/scheduler.
This deletes some unused functions from the `Configurator` interface.
2018-08-15 17:14:38 -07:00
Jonathan Basseri a77e3bd16b Delete dead code.
This removes a fake Cache implementation that is not used anywhere
(anymore).
2018-08-15 17:14:37 -07:00
Janet Kuo fd7a694440 Avoid unnecessary DaemonSet collisionCount bump 2018-08-15 16:16:41 -07:00
Jonathan Basseri b874d2789b Add metrics to equivalence cache.
This adds counters to equiv. cache reads & writes. Reads are labeled by
hit/miss, while writes are labeled to indicate whether the write was
discarded.

This will give us visibility into,
- hit rate of cache reads
- ratio of reads to writes
- rate of discarded writes
2018-08-15 15:51:13 -07:00
Kubernetes Submit Queue c1f7df2b0e
Merge pull request #65309 from tnozicka/add-ds-recreate-backoff
Automatic merge from submit-queue (batch tested with PRs 62441, 66702, 67254, 67421, 65309). 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 backoff for DS's pod deletion to limit fighting with kubelet failing the pod repeatedly

**What this PR does / why we need it**:
Limits consequences of DS controller on hot loop fighting with kubelet.

**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 https://github.com/kubernetes/kubernetes/issues/65240

**Release note**:
```release-note
DaemonSet controller is now using backoff algorithm to avoid hot loops fighting with kubelet on pod recreation when a particular DaemonSet is misconfigured.
```

TODO:
 - [x] Export the backoff settings as args or constants
 - [x] Add test a case

/cc @mfojtik 
(Will add more folks when it's ready, to avoid spamming them.)
2018-08-15 15:30:27 -07:00
Kubernetes Submit Queue f01be5031c
Merge pull request #67421 from islinwb/minor-fix
Automatic merge from submit-queue (batch tested with PRs 62441, 66702, 67254, 67421, 65309). 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 glog.V().Infof() for formatting output; return nil when err's nil

**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-08-15 15:30:24 -07:00
Kubernetes Submit Queue 8f63f7b010
Merge pull request #67254 from andrewsykim/doc-instance-stopped
Automatic merge from submit-queue (batch tested with PRs 62441, 66702, 67254, 67421, 65309). 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>.

document expectations for stopped/shutdown instances in cloudprovider.Instances interface

**What this PR does / why we need it**:
Add comments which outline expectations for how cloud providers should handle nodes that are stopped/shutdown/sleeping. 

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
It doesn't fix https://github.com/kubernetes/kubernetes/issues/46442 since some providers still delete node resources for stopped instances (though there are PRs already open to fix this) but we've (mostly?) agreed that not deleting node resources for stopped instances is the correct behavior, or at least the behavior that we want consistent across providers at the moment. 

**Special notes for your reviewer**:

```release-note
NONE
```

/sig cloud-provider
2018-08-15 15:30:21 -07:00
Kubernetes Submit Queue 939f08a24e
Merge pull request #62441 from chentao1596/certificate_controller_utils_ut
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>.

UT case of certificate_controller
2018-08-15 15:04:59 -07:00
Wei Huang 976797c0b8
fix an issue in NodeInfo.Clone()
- usedPorts is a map-in-map struct, add fix to ensure it's deep copied
- updated unit test
2018-08-15 13:31:16 -07:00
Janet Kuo 3fa639f775 Add mfojtik as approver of Deployment 2018-08-15 12:15:22 -07:00
juanvallejo 4bdc636380
add updated plugin mechanism 2018-08-15 15:06:29 -04:00
juanvallejo df0077f362
prevent "No resources found" output on forbidden error 2018-08-15 13:54:23 -04:00
Kubernetes Submit Queue 4414ae3d75
Merge pull request #66666 from bertinatto/metrics_ad_controller
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 more metrics for A/D Controller:

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

This PR adds a few metrics described in the [Metrics Spec](https://docs.google.com/document/d/1Fh0T60T_y888LsRwC51CQHO75b2IZ3A34ZQS71s_F0g/edit#heading=h.ys6pjpbasqdu):

* Number of Volumes in ActualStateOfWorld and DesiredStateOfWorld
* Number of times A/D Controller performs force detach

**Release note**:

```release-note
NONE
```
2018-08-15 09:42:06 -07:00
Casey Callendrello 5d9ec20d7e kubelet/dockershim/network: pass ipRange dynamically to the CNI plugin
CNI now supports passing ipRanges dynamically. Pass podCIDR so that
plugins no longer have to look it up.
2018-08-15 17:41:09 +02:00
Kubernetes Submit Queue c5d15cb0b8
Merge pull request #66115 from jasonrichardsmith/add-serviceAccount-fieldselector
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>.

added serviceAccountName to field selectors

What this PR does / why we need it:

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

Special notes for your reviewer:

```release-note
NONE
```
2018-08-15 08:24:57 -07:00
Kubernetes Submit Queue 2a81c37d4c
Merge pull request #67229 from feiskyer/unzoned-disks
Automatic merge from submit-queue (batch tested with PRs 66884, 67410, 67229, 67409). 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 node affinity for Azure unzoned managed disks

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

Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).

Add node affinity for Azure unzoned managed disks, so that unzoned disks only scheduled to unzoned nodes.

This is required because Azure doesn't allow attaching unzoned disks to zoned VMs.

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

Unzoned nodes would label `failure-domain.beta.kubernetes.io/zone=0` and the value is fault domain ( while availability zone is used for zoned nodes). So fault domain is used to populate unzoned disks.

Since there are at most 3 fault domains in each region, the PR adds 3 terms for them:

```yaml
kubectl describe pv pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
Name:              pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
Labels:            <none>
Annotations:       pv.kubernetes.io/bound-by-controller=yes
                   pv.kubernetes.io/provisioned-by=kubernetes.io/azure-disk
                   volumehelper.VolumeDynamicallyCreatedByKey=azure-disk-dynamic-provisioner
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      azuredisk-unzoned
Status:            Bound
Claim:             default/unzoned-pvc
Reclaim Policy:    Delete
Access Modes:      RWO
Capacity:          5Gi
Node Affinity:     
  Required Terms:  
    Term 0:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [0]
    Term 1:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [1]
    Term 2:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [2]
Message:           
Source:
    Type:         AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
    DiskName:     k8s-5b3d7b8f-dynamic-pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
    DiskURI:      /subscriptions/<subscription>/resourceGroups/<rg-name>/providers/Microsoft.Compute/disks/k8s-5b3d7b8f-dynamic-pvc-bdf93a67-9c45-11e8-ba6f-000d3a07de8c
    Kind:         Managed
    FSType:       
    CachingMode:  None
    ReadOnly:     false
Events:           <none>
```

**Release note**:

```release-note
Add node affinity for Azure unzoned managed disks
```

/sig azure
/kind feature

/cc @brendandburns @khenidak @andyzhangx @msau42
2018-08-15 07:10:15 -07:00
Kubernetes Submit Queue c5e74d128d
Merge pull request #66884 from NickrenREN/attacher-detacher-refactor
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>.

Attacher/Detacher refactor for local storage

Proposal link: https://github.com/kubernetes/community/pull/2438

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

Attacher/Detacher refactor for the plugins which just need to mount device, but do not need to attach, such as local storage plugin.

**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
Attacher/Detacher refactor for local storage
```

/sig storage
/kind feature
2018-08-15 07:03:48 -07:00
Tomas Nozicka b0b1629e8d Update Bazel 2018-08-15 16:03:42 +02:00
Tomas Nozicka 63656da296 Add backoff for DS's pod deletion to limit fighting with kubelet failing the pod repeatedly 2018-08-15 16:03:39 +02:00
andrewsykim 6ea5053531 document expectations for stopped/shutdown instances in cloudprovider.Instances interface 2018-08-15 09:15:24 -04:00
Kubernetes Submit Queue 5aea00d885
Merge pull request #67097 from chakri-nelluri/EIO-Unmountfix
Automatic merge from submit-queue (batch tested with PRs 67396, 67097, 67395, 67365, 67099). 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>.

Ignore EIO error in unmount path

**What this PR does / why we need it**:
This PR ignores EIO in unmount path. XFS shuts down filesystem when the target is down and it returns EIO for the stat calls used in unmount path.

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

**Special notes for your reviewer**:
We already handle ESTALE & ENOTCONN errors in isCorruptedMnt Call. Adding EIO to that list covers the XFS shutdown case.

Also Flexvolume doesn't check for these errors in its current form. Updated Flexvolume code to handle it.

```release-note
NONE
```
2018-08-15 05:45:17 -07:00
Tomas Nozicka dc2cfd5d20 Update Bazel 2018-08-15 13:34:31 +02:00
Tomas Nozicka e434f3189e Deprecate ListWatchUntil, fix it and call places 2018-08-15 13:34:31 +02:00
Kubernetes Submit Queue a8fbaf95f9
Merge pull request #67385 from nikhita/patch-no-op-msg
Automatic merge from submit-queue (batch tested with PRs 67347, 67307, 67358, 67364, 67385). 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: update message for a no-op patch

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

/cc liggitt juanvallejo soltysh timoreimann 
/sig cli

**Release note**:

```release-note
NONE
```
2018-08-15 04:23:24 -07:00
xuzhonghu 815799638b run update all 2018-08-15 17:18:27 +08:00
xuzhonghu c867bf9cab kubelet support dynamically set glog log level --v 2018-08-15 17:18:25 +08:00
Kubernetes Submit Queue c65f65cf6a
Merge pull request #65065 from sjenning/reduce-backoff-logging
Automatic merge from submit-queue (batch tested with PRs 66177, 66185, 67136, 67157, 65065). 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: reduce logging for backoff situations

xref https://bugzilla.redhat.com/show_bug.cgi?id=1555057#c6

Pods that are in `ImagePullBackOff` or `CrashLoopBackOff` currently generate a lot of logging at the `glog.Info()` level.  This PR moves some of that logging to `V(3)` and avoids logging in situations where the `SyncPod` only fails because pod are in a BackOff error condition.

@derekwaynecarr @liggitt
2018-08-15 02:09:20 -07:00
Fabio Bertinatto 4ce2058ef6 Add more metrics for A/D Controller:
* Number of Volumes in ActualStateofWorld and DesiredStateofWorld
* Numer of times A/D Controller performs force detach
2018-08-15 10:01:57 +02:00
Kubernetes Submit Queue fba4cf6f4c
Merge pull request #67334 from fqsghostcloud/indent-error-flow
Automatic merge from submit-queue (batch tested with PRs 67294, 67320, 67335, 67334, 67325). 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>.

indent error flow
2018-08-15 00:07:18 -07:00
Kubernetes Submit Queue cfb4a5e95a
Merge pull request #67039 from mortent/AvoidDuplicateRevisionsForStatefulSet
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). 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 for duplicate revisions created by StatefulSet

**What this PR does / why we need it**: This PR replaces PR #65038 as a fix to issue #55159. The statefulset controller can in some situations create more controller revisions than necessary and this change makes sure the controller checks with the API server and only create new revision if the raw data is different.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Avoid creating new controller revisions for statefulsets when cache is stale
```
2018-08-14 22:43:29 -07:00
Kubernetes Submit Queue aad9f0536a
Merge pull request #67276 from seans3/kubectl-extract-2
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). 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 dependency within kubernetes core to staging

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

This PR moves a dependency from with Kubernetes core (k8s.io/kubernetes/pkg/apis/core) to staging

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

Helps Fix: Remove Kubectl dependencies on kubernetes/pkg/api and kubernetes/pkg/apis

https://github.com/kubernetes/kubectl/issues/83

**Release note**:

```release-note
NONE
```
2018-08-14 22:43:25 -07:00
Kubernetes Submit Queue 698eb760d9
Merge pull request #66722 from luxas/reference_new_generic_structs
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). 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 references to the structs that have moved to their own packages

**What this PR does / why we need it**:
Follows-up https://github.com/kubernetes/kubernetes/pull/66058 and  https://github.com/kubernetes/kubernetes/pull/66059 to remove the structs that now aren't needed in `pkg/apis/componentconfig`

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
xref https://github.com/kubernetes/community/pull/2354

**Special notes for your reviewer**:

This PR depends on:
 - [x] https://github.com/kubernetes/kubernetes/pull/67090
 - [x] https://github.com/kubernetes/kubernetes/pull/67149
 - [x] https://github.com/kubernetes/kubernetes/pull/67159
 - [x] https://github.com/kubernetes/kubernetes/pull/67207

**Only review commit 'Remove references to the structs that have moved to their own packages' please**

**Release note**:

```release-note
NONE
```
/kind cleanup
/assign @sttts @thockin @jbeda @liggitt
2018-08-14 22:43:22 -07:00
Kubernetes Submit Queue b6f0aed056
Merge pull request #66906 from tnozicka/rename-until
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). 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>.

#50102 Task 1: Move apimachinery/pkg/watch.Until into client-go/tools/watch.UntilWithoutRetry

**What this PR does / why we need it**:
This is a split off from https://github.com/kubernetes/kubernetes/pull/50102 to go in smaller pieces.

Moves `apimachinery/pkg/watch.Until` into `client-go/tools/watch.UntilWithoutRetry` and adds context so it is cancelable.

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

**Dev release note**:
```dev-release-note
`apimachinery/pkg/watch.Until` has been moved to `client-go/tools/watch.UntilWithoutRetry`.
While switching please consider using the new `client-go/tools/watch.UntilWithSync` or `client-go/tools/watch.Until`.
```

/cc @smarterclayton @kubernetes/sig-api-machinery-pr-reviews 
/milestone v1.12
/priority important-soon
/kind bug
(bug after the main PR which is this split from)
2018-08-14 22:43:19 -07:00
Kubernetes Submit Queue bc60801d18
Merge pull request #66895 from ctriple/master
Automatic merge from submit-queue (batch tested with PRs 61212, 66369, 66446, 66895, 66969). 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>.

pkg/volume/cephfs: fix doc typo, nfs -> cephfs
2018-08-14 21:18:15 -07:00
Kubernetes Submit Queue b4bfb1847c
Merge pull request #66446 from bertinatto/metrics_volume_manager
Automatic merge from submit-queue (batch tested with PRs 61212, 66369, 66446, 66895, 66969). 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 metrics for Volume Manager

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

This PR adds a few metrics described in the [Metrics Spec](https://docs.google.com/document/d/1Fh0T60T_y888LsRwC51CQHO75b2IZ3A34ZQS71s_F0g/edit#heading=h.ys6pjpbasqdu):

* Number of volumes in ActualStateofWorld and DesiredStateofWorld
* Number of times ReconstructVolume Spec on kubelet failed

**Release note**:

```release-note
NONE
```
2018-08-14 21:18:12 -07:00
Weibin Lin c702a24182 use glog.V().Infof() for formatting output; return nil when err's nil 2018-08-15 11:48:59 +08:00
Kubernetes Submit Queue 1f86c1cf26
Merge pull request #61212 from charrywanganthony/duplicated_import
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 duplicated import

**Release note**:

```release-note
NONE
```
2018-08-14 20:18:00 -07:00
Kubernetes Submit Queue 99053fbf33
Merge pull request #64877 from AdamDang/patch-11
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>.

Typo fix in returned message: utilites->utilities

Line 250: utilites->utilities
2018-08-14 18:57:50 -07:00
Kubernetes Submit Queue d655c9a873
Merge pull request #66923 from jarrpa/pvc-protect-until-pod-delete
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). 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>.

PVC Protection: Wait for Pod delete

Currently, the PVC protection controller will remove its finalizer when
all Pods using a PVC reach at least a Terminating state. However,
certain volumes cannot be guaranteed to be umounted until a Pod is
deleted. Only Pods not in the current pods list can be considered
deleted, so we're removing the exception to not check Terminating Pods.

```release-note
NONE
```

Resolves: #65552

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2018-08-14 17:55:17 -07:00
Kubernetes Submit Queue d7634dcf23
Merge pull request #66856 from charrywanganthony/scheduler_space
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). 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 space for output

**Release note**:
```release-note
NONE
```
2018-08-14 17:55:11 -07:00
Kubernetes Submit Queue af2f72af47
Merge pull request #66587 from feiskyer/revert-63905
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). 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>.

Revert #63905: Setup dns servers and search domains for Windows Pods

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

From https://github.com/kubernetes/kubernetes/pull/63905#issuecomment-396709775:

> I don't think this change does anything on Windows. On windows, the network endpoint configuration is taken care of completely by CNI. If you would like to pass on the custom dns polices from the pod spec, it should be dynamically going to the cni configuration that gets passed to CNI. From there, it would be passed down to platform and would be taken care of appropriately by HNS.

> etc\resolve.conf is very specific to linux and that should remain linux speicfic implementation. We should be trying to move away from platform specific code in Kubelet.
Docker is not managing the networking here for windows. So it doens't really care about any network settings. So passing it to docker shim's hostconfig also doens;t make sense here.

DNS for Windows containers will be set by CNI plugins.  And this change also introduced two endpoints for sandbox container.  So this PR reverts #63905 .


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

The PR should also be cherry-picked to release-1.11.

Also, https://github.com/kubernetes/kubernetes/issues/66588 is opened to track the process of pushing this to CNI.

**Release note**:

```release-note
Revert #63905: Setup dns servers and search domains for Windows Pods. DNS for Windows containers will be set by CNI plugins.
```

/sig windows
/sig node
/kind bug
2018-08-14 17:55:07 -07:00
Kubernetes Submit Queue 61226bdd7b
Merge pull request #66491 from Lion-Wei/ipvs-nodeip
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). 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>.

optimize ipvs get nodeIP

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

Optimize ipvs get nodeIP.

The original ipvs `NodeIPs` need first get all local type address to set1, then get address of dummy device `kube-ipvs0` to set2, then do diff of set1 and set2 to get local addresses we need.
This work gonna result in unnecessary resource consumption, especially for large cluster, will have lots address in dummy device `kube-ipvs0`. 

This pr optimized the workaround.

**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-08-14 17:55:04 -07:00
tianshapjq 81081dc9e7 nits in manager.go 2018-08-15 08:16:04 +08:00
Kubernetes Submit Queue 101bf89ae2
Merge pull request #67404 from janetkuo/workloads-owners
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 workloads controller owner files

**Release note**:

```release-note
NONE
```
2018-08-14 16:21:25 -07:00
morrislaw 522db8fce8 Updated comment for DefaultLoadBalancerName to provide further context 2018-08-14 18:20:03 -04:00
Janet Kuo 1fca77dc12 Update workloads controller owner files 2018-08-14 14:20:34 -07:00
Kubernetes Submit Queue cd786bda64
Merge pull request #66863 from cofyc/fix64549
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>.

attachdetach controller: attach volumes immediately when Pod's PVCs are bound

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

Let attachdetach controller to attach volumes immediately when Pod's PVCs are bound.

Current attachdetach controller calls `util.ProcessPodVolume` to add pod volumes into `desiredStateOfWorld` on these events:

- podAdd event
- podUpdate event
- podDelete event
- periodical `desiredStateOfWorldPopulator.findAndAddActivePod`

But if a pod is created with PVCs not bound, no volumes will be added into `desiredStateOfWorld` [because PVCs not bound](https://github.com/kubernetes/kubernetes/blob/v1.12.0-alpha.0/pkg/controller/volume/attachdetach/util/util.go#L99). When pv controller binds PVCs successfully, attachdetach controller will not add pod volumes immediately because it does not watch on PVC events.

It will wait until a pod update event is triggered (normally will not happen because no new status will be reported by kubelet) or `desiredStateOfWorldPopulator.findAndAddActivePod` is called (maybe 0~3 minutes later, see [timer configs](https://github.com/kubernetes/kubernetes/blob/v1.12.0-alpha.0/pkg/controller/volume/attachdetach/attach_detach_controller.go)).

In bad case, pod start time will be very long (~3 minutes + ~2 minutes (kubelet max exponential backoff)), for example: https://github.com/kubernetes/kubernetes/issues/64549#issuecomment-409440546.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
attachdetach controller attaches volumes immediately when Pod's PVCs are bound
```
2018-08-14 13:46:35 -07:00
David Eads 562209d632 update patch to work with --local and avoid extra requests 2018-08-14 15:53:47 -04:00
Kubernetes Submit Queue 76434bd62a
Merge pull request #66780 from NetApp/volumeresize
Automatic merge from submit-queue (batch tested with PRs 66780, 67330). 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>.

Changed admission controller to allow volume expansion for all volume plugins

**What this PR does / why we need it**:
There are two motivations for this change:

1. CSI plugins are soon going to support volume expansion. For such plugins, admission controller doesn't know whether the plugins are capabale of supporting volume expansion or not.
2. Currently, admission controller rejects PVC updates for in-tree plugins that don't support volume expansion (e.g., NFS, iSCSI). This change allows external controllers to expand volumes similar to how external provisioners are accommodated.

**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**:
This PR mimics the behavior of the PV controller when PVs are provisioned externally by logging and setting a new event for PVs that are being expanded externally. As SIG Storage is planning new types of operations on PVs, it may make more sense to a have a single event for all actions taken by external controllers.

**Release note**:

```release-note
The check for unsupported plugins during volume resize has been moved from the admission controller to the two controllers that handle volume resize.
```
/sig storage
/assign @gnufied @jsafrane @wongma7
2018-08-14 12:22:00 -07:00
Lucas Käldström db855a2b2d
autogenerated 2018-08-14 19:02:18 +03:00
Lucas Käldström 4bef926218
Remove references to the config structs that have moved to their own shared packages 2018-08-14 19:02:06 +03:00
Nikhita Raghunath 3d33301332
kubectl: update message for a no-op patch 2018-08-14 18:42:27 +05:30
tianshapjq 27c5ced809 should not event directly 2018-08-14 14:35:47 +08:00
Pengfei Ni dbdfd0fab2 Set nodeAffinity for unmanaged disks 2018-08-14 14:25:15 +08:00
Pengfei Ni cf4981fc80 Update bazel 2018-08-14 14:14:01 +08:00
Pengfei Ni 028f155b9e Add node affinity for unzoned managed disks 2018-08-14 14:14:01 +08:00
NickrenREN 55784f88d4 add UTs for devicemountable conditions 2018-08-14 11:13:02 +08:00
NickrenREN 81e360d20f update volume plugins accordingly 2018-08-14 11:12:54 +08:00
NickrenREN c7e4466873 attacher/detacher refactor 2018-08-14 11:12:41 +08:00
Di Xu 3157ff0230 use NameIsDNSSubdomain validation from staging 2018-08-14 10:38:23 +08:00
liangwei 8a8b5845a9 optimize ipvs get nodeIP 2018-08-14 09:14:15 +08:00
Yang Guo c776cf4296 Allow passing timeout on TPU API operations via context 2018-08-13 16:08:10 -07:00
Jose A. Rivera 13462bf341 PVC Protection: Wait for Pod delete
Currently, the PVC protection controller will remove its finalizer when
all Pods using a PVC reach at least a Terminating state. However,
certain volumes cannot be guaranteed to be umounted until a Pod is
deleted. Only Pods not in the current pods list can be considered
deleted, so we're removing the exception to not check Terminating Pods.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2018-08-13 13:57:36 -05:00
Yecheng Fu 5fafae11d8 attachdetach controller: attach volumes immediately when Pod's PVCs are bound
- Use queue to process PVCs on add/update events
- Index pods by PVC key then we don't need to iterate to find pods
2018-08-14 01:03:13 +08:00
Morten Torkildsen 31f1972c52 Fix for duplicate revisions created by StatefulSet 2018-08-13 09:42:53 -07:00
Fabio Bertinatto 376a94e039 Add more metrics for Volume Manager
Specifically:

* Number of volumes in ActualStateofWorld and DesiredStateofWorld
* Number of times ReconstructVolume Spec on kubelet failed
2018-08-13 17:36:36 +02:00
Kubernetes Submit Queue f35065bf44
Merge pull request #67306 from dougm/vcp-test-ca
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>.

vsphere: enable TestInvalidCaCert

This test can be enabled now with the govmomi vendor update in 5c44fd871f

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

Enables a test that had been skipped due to vendor dependency.

```release-note
NONE
```
2018-08-13 03:41:58 -07:00
fqsghostcloud 21f9ac0e7e
indent error flow
indent error flow
2018-08-13 17:31:31 +08:00
Kenjiro Nakayama 32117163e4 Support mount options for cephfs with ceph-fuse mount
When cephfs uses ceph-fuse for the mount command, mount option and
readOnly options are disregarded. This patch adds to ceph-fuse as
well.
2018-08-13 18:09:28 +09:00
Kubernetes Submit Queue 4492337dbf
Merge pull request #65803 from honkiko/ipvs-add-addrtype-match
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>.

ipvs: add addrtype match for nodeport

**What this PR does / why we need it**:
before this PR:
```
-A KUBE-SERVICES -m comment --comment "Kubernetes nodeport TCP port for masquerade purpose" -m set --match-set KUBE-NODE-PORT-TCP dst -j KUBE-NODE-PORT
-A KUBE-SERVICES -m comment --comment "Kubernetes service cluster ip + port for masquerade purpose" -m set --match-set KUBE-CLUSTER-IP dst,dst -j KUBE-MARK-MASQ
-A KUBE-SERVICES -m set --match-set KUBE-CLUSTER-IP dst,dst -j ACCEPT
-A KUBE-NODE-PORT -p tcp -m comment --comment "Kubernetes nodeport TCP port with externalTrafficPolicy=local" -m set --match-set KUBE-NODE-PORT-LOCAL-TCP dst -j RETURN
-A KUBE-NODE-PORT -j KUBE-MARK-MASQ
```
after this PR:
```
-A KUBE-NODE-PORT -p tcp -m comment --comment "Kubernetes nodeport TCP port with externalTrafficPolicy=local" -m set --match-set KUBE-NODE-PORT-LOCAL-TCP dst -j RETURN
-A KUBE-NODE-PORT -p tcp -m comment --comment "Kubernetes nodeport TCP port for masquerade purpose" -m set --match-set KUBE-NODE-PORT-TCP dst -j KUBE-MARK-MASQ
-A KUBE-SERVICES -m comment --comment "Kubernetes service cluster ip + port for masquerade purpose" -m set --match-set KUBE-CLUSTER-IP dst,dst -j KUBE-MARK-MASQ
-A KUBE-SERVICES -m set --match-set KUBE-CLUSTER-IP dst,dst -j ACCEPT
-A KUBE-SERVICES -m addrtype --dst-type LOCAL -j KUBE-NODE-PORT
```

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

**Special notes for your reviewer**:
manually tested cases:
- ClusterIP distributed to pod on same node
- ClusterIP distributed to pod on other node
- NodePort distributed to pod on same node
- NodePort distributed to pod on other node

**Release note**:

```release-note

```
2018-08-13 00:28:43 -07:00
Mikalai Radchuk 89dd809ee3 Adds tests for --all-containers=true
Fixes regression in kubectl logs --all-containers=true
2018-08-13 08:23:10 +01:00
Kubernetes Submit Queue 6274590518
Merge pull request #66656 from wackxu/fixappversion
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 apps/v1 version for scheduler

/kind cleanup

**Release note**:

```release-note
NONE
```
2018-08-11 23:25:33 -07:00
Doug MacEachern 35c37d5584 vsphere: enable TestInvalidCaCert
This test can be enabled now with the govmomi vendor update in 5c44fd871f
2018-08-11 10:39:20 -07:00
Sylvain Rabot 7e7b01fa31 Log real file's name and line
pkg/kubectl/util/logs & staging/src/k8s.io/apiserver/pkg/util/logs
use `glog.info(...)` but this function is not made to be wrapped because
the underlying mechanism use a fixed call trace length to determine
where the log has been emited.

This results is having `logs.go:49` in the logs which is in the body
of the wrapper function and thus useless.

Instead use `glog.infoDepth(1, ...)` which tells the underlying mechanism
to go back 1 more level in the call trace to determine where the log
has been emitted.

Signed-off-by: Sylvain Rabot <sylvain@abstraction.fr>
2018-08-11 14:57:45 +02:00
Kubernetes Submit Queue 29232e3edc
Merge pull request #67285 from yujuhong/add-ctx-logs
Automatic merge from submit-queue (batch tested with PRs 67274, 67285). 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: plumb context for log requests

This allows kubelets to stop the necessary work when the context has
been canceled (e.g., connection closed), and not leaking a goroutine
and inotify watcher waiting indefinitely.



**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)*:
Partially fixes #64315

**Special notes for your reviewer**:

**Release note**:

```release-note
Fix kubelet to not leak goroutines/intofiy watchers on an inactive connection if it's closed
```
2018-08-10 23:19:05 -07:00
Kubernetes Submit Queue 1574e0b958
Merge pull request #67274 from seans3/kubectl-extract-1
Automatic merge from submit-queue (batch tested with PRs 67274, 67285). 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 dependency from k/k/pkg/apis/core to staging

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

This PR moves a dependency from with Kubernetes core (k8s.io/kubernetes/pkg/apis/core) to staging

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

Helps Fix: Remove Kubectl dependencies on kubernetes/pkg/api and kubernetes/pkg/apis
https://github.com/kubernetes/kubectl/issues/83

**Release note**:

```release-note
NONE
```
2018-08-10 23:19:03 -07:00
Kubernetes Submit Queue d427a23842
Merge pull request #67236 from andyzhangx/azuredisk-create-failure
Automatic merge from submit-queue (batch tested with PRs 66984, 67236, 67216, 62721, 67106). 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 azure disk create failure due to sdk upgrade

**What this PR does / why we need it**:
fix azure storage account creation failure, this happens only on unmanaged k8s cluster on Azure.

This bug is due to azure-sdk-for-go API change introduced in v1.11:
fbe7db0e3f/services/storage/mgmt/2017-10-01/storage/models.go (L381-L382)

there is a new field `Kind` which is required, so any sdk upgrade from and old version would break the storage account creation since old code won't use `Kind`. I have filed an issue to azure-sdk-for-go: https://github.com/Azure/azure-sdk-for-go/issues/2182
**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 #67234

**Special notes for your reviewer**:

**Release note**:

```
fix azure disk create failure due to sdk upgrade
```

/kind bug
/sig azure

/assign @feiskyer 
FYI @khenidak @brendandburns
2018-08-10 18:59:08 -07:00
Yu-Ju Hong 390b158db9 kubelet: plumb context for log requests
This allows kubelets to stop the necessary work when the context has
been canceled (e.g., connection closed), and not leaking a goroutine
and inotify watcher waiting indefinitely.
2018-08-10 17:35:46 -07:00
Kubernetes Submit Queue 1dfe2e8bff
Merge pull request #67140 from NetApp/multipath-race-fix
Automatic merge from submit-queue (batch tested with PRs 67017, 67190, 67110, 67140, 66873). 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 wait loop for multipath devices to appear

It takes a variable amount of time for the multipath daemon
to create /dev/dm-XX in response to new LUNs being discovered.
The old iscsi_util code only discovered the multipath device
if it was created quickly enough, but in a significant number
of cases, kubelet would grab one of the individual paths and
put a filesystem it on before multipathd could construct a
multipath device.

This change waits for the multipath device to get created for
up to 10 seconds, but only if the PV actually had more than
one portal.

fixes #60894

```release-note
Dynamic provisions that create iSCSI PVs can ensure that multipath is used by specifying 2 or more target portals in the PV, which will cause kubelet to wait up to 10 seconds for the multipath device. PVs with just one portal continue to work as before, with kubelet not waiting for the multipath device and just using the first disk it finds.
```
2018-08-10 17:01:16 -07:00
Kubernetes Submit Queue 032a096d86
Merge pull request #67110 from verult/kubelet-nodeid
Automatic merge from submit-queue (batch tested with PRs 67017, 67190, 67110, 67140, 66873). 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>.

CSI plugin now calls NodeGetInfo() to get driver's node ID

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
/sig storage
@sbezverk @vladimirvivien @saad-ali
2018-08-10 17:01:13 -07:00
Kubernetes Submit Queue 819253dd2d
Merge pull request #67275 from spiffxp/owners-label-kind-api-change
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 OWNERS-based labeling for kind/api-change

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

This replaces the following path-label munger config, except
we're using kind/api-change for everything instead of two
different kind/ labels

```
^pkg/api/([^/]+/)?types.go$    kind/api-change
^pkg/api/([^/]+/)?register.go$ kind/new-api
^pkg/apis/[^/]+/([^/]+/)?types.go$    kind/api-change
^pkg/apis/[^/]+/([^/]+/)?register.go$ kind/new-api
```

This fixes https://github.com/kubernetes/test-infra/issues/9007

**Special notes for your reviewer**:
This can be merged independently of us turning path-label off of
mungegithub. While both labeling options are active, they won't
clash, just race. 

```release-note
NONE
```
2018-08-10 15:19:54 -07:00
Kubernetes Submit Queue 6696ae39ee
Merge pull request #66332 from jianglingxia/jlx-k8s-201807181704
Automatic merge from submit-queue (batch tested with PRs 66602, 67178, 67207, 67125, 66332). 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 to RBD volume test of TestGetAccessModes and TestRequiresRemount

**What this PR does / why we need it**:
Add UT to RBD volume test of TestGetAccessModes and TestRequiresRemount
**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-08-10 14:13:19 -07:00
Kubernetes Submit Queue 0e62573d60
Merge pull request #66602 from dixudx/kubectl_apply_force_invalid
Automatic merge from submit-queue (batch tested with PRs 66602, 67178, 67207, 67125, 66332). 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: recreating resources for immutable fields when force is applied

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

**Special notes for your reviewer**:
/assign soltysh juanvallejo
/cc @kubernetes/sig-cli-bugs 

**Release note**:

```release-note
kubectl: recreating resources for immutable fields when force is applied
```
2018-08-10 14:13:05 -07:00
Aaron Crickenberger d0b259597a Use OWNERS-based labeling for kind/api-change
This replaces the following path-label munger config, except
we're using kind/api-change for everything instead of two
different kind/ labels

```
^pkg/api/([^/]+/)?types.go$    kind/api-change
^pkg/api/([^/]+/)?register.go$ kind/new-api
^pkg/apis/[^/]+/([^/]+/)?types.go$    kind/api-change
^pkg/apis/[^/]+/([^/]+/)?register.go$ kind/new-api
```
2018-08-10 13:48:56 -07:00
Sean Sullivan d4e9233875 moved dependency within kubernetes core to staging 2018-08-10 13:45:17 -07:00
Sean Sullivan 083f0e3d72 Move dependency from k/k/pkg/apis/core to staging 2018-08-10 12:56:03 -07:00
Kubernetes Submit Queue df439192d7
Merge pull request #65420 from jsoref/issue-61739
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 --interactive flag from kubectl logs

fixes #61739

```release-note
Remove deprecated --interactive flag from kubectl logs.
```
2018-08-10 11:30:33 -07:00
Kubernetes Submit Queue 8174d841f8
Merge pull request #67219 from seans3/rbac-dependency
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 validation dependency from pkg/apis/core/validation to staging

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

Moves a dependency in metricsutil from `pkg/apis/core/validation` to the staging dependency.

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

Helps Fix: **Remove Kubectl dependencies on kubernetes/pkg/api and kubernetes/pkg/apis**
https://github.com/kubernetes/kubectl/issues/83

**Special notes for your reviewer**:

```release-note
NONE
```
2018-08-10 10:14:00 -07:00
Tomas Nozicka 4d7747a5a3 Update Bazel 2018-08-10 09:55:41 +02:00
Tomas Nozicka 3d4a02abb5 Rename Until to UntilWithoutRetry and move to using context so it's
cancelable
2018-08-10 09:55:41 +02:00
andyzhangx 292226195b fix azure disk create failure due to sdk upgrade 2018-08-10 05:35:50 +00:00
Kubernetes Submit Queue ecc64f2e6e
Merge pull request #66953 from Huang-Wei/fix-#66348
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>.

ensure ScheduleDSPods respects tainted nodes

- add PodToleratesNodeTaints to ~~nodeSelectionPredicates()~~ checkNodeFitness()
- add integration testcase

Fixes #66348, and would keep the behavior consistent with it was when ScheduleDSPods is disabled.

```release-note
NONE
```
2018-08-09 21:35:55 -07:00
Kubernetes Submit Queue 6c77dce9be
Merge pull request #67220 from verult/vsphere-panic
Automatic merge from submit-queue (batch tested with PRs 67058, 67083, 67220, 67222, 67209). 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 unsafe type cast in vSphere volume plugin

**What this PR does / why we need it**: Fixes the controller manager panic caused by vSphere volumes being used on the wrong cloud provider.

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

**Release note**:

```release-note
NONE
```

/assign @saad-ali
2018-08-09 20:58:10 -07:00
Kubernetes Submit Queue a1b3133b46
Merge pull request #67077 from vikaschoudhary16/scope-selectors-beta
Automatic merge from submit-queue (batch tested with PRs 67161, 67093, 67077). 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>.

Graduate ResourceQuotaScopeSelectors to beta

All the pre-requisite items listed in the tracker issue, https://github.com/kubernetes/kubernetes/issues/66673, have got merged. Therefore, opening this PR to graduate scope selectors field in the resource quota spec.

**Release note**:

```release-note
Graduate Resource Quota ScopeSelectors to beta, and enable it by default.
```
/cc @derekwaynecarr @deads2k @smarterclayton
2018-08-09 19:31:04 -07:00
Wei Huang deb6d85470
ensure ScheduleDSPods respects tainted nodes
- add PodToleratesNodeTaints to nodeSelectionPredicates()
- add integration testcases
2018-08-09 18:01:51 -07:00
Kubernetes Submit Queue e26f5d19d4
Merge pull request #66476 from mortent/IntegrationTestForDaemonSetHashCollision
Automatic merge from submit-queue (batch tested with PRs 67090, 67159, 66866, 62111, 66476). 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 to handle hash collisions correctly for DaemonSets

**What this PR does / why we need it**: This adds an integration test for the case where there is a hash collision when creating a ControllerRevision for a DaemonSet. It also fixes a shadowed variable that prevented this functionality from working as intended.

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

**Special notes for your reviewer**:
/sig apps

**Release note**:

```release-note
Fixes issue when updating a DaemonSet causes a hash collision.
```
2018-08-09 16:30:58 -07:00
Cheng Xing 85c3de40e5 Fixed vsphere volume plugin unsafe type cast; added unit tests 2018-08-09 16:15:59 -07:00
Sean Sullivan d91c82a30d Move validation dependency from pkg/apis/core/validation to staging 2018-08-09 15:52:59 -07:00
Kubernetes Submit Queue 876e77ed95
Merge pull request #62111 from k82cn/k8s_62109_1
Automatic merge from submit-queue (batch tested with PRs 67160, 67090, 67159, 66866, 62111). 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>.

Upgraded TaintNodesByCondition to beta.

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)*:
part of #62109 

**Release note**:
```release-note
Upgraded TaintNodesByCondition to beta.
```
2018-08-09 15:11:11 -07:00
Kubernetes Submit Queue 8ef73ecf99
Merge pull request #67090 from luxas/fixup_componentconfig_pkg
Automatic merge from submit-queue (batch tested with PRs 67160, 67090, 67159, 66866, 62111). 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 references to `pkg/apis/componentconfig/install` and fix inconsistencies

**What this PR does / why we need it**:
This PR fixes a bunch of problems with the (deprecated, monolithic, to be removed) componentconfig API group:
 - As discussed with @liggitt, the current structure of k-c-m componentconfig types is really bad, and we don't want anyone to think it can be serialized (not that we have any such code, but anyway). So we deciided to remove all JSON tags from the types to be consistent, register the violations, then move types out, get the structure right, and **first then** add JSON tags.
 - There should not be an `install` package for componentconfigs that installs stuff in `legacyscheme`,  removed the package and references to it.
 - Added myself and @sttts to approvers for `pkg/apis/componentconfig`, which we intend to remove in favor for dedicated API groups in different staging repos.
 - Removed the componentconfig types from the API testing in `pkg/api/testing`, that roundtrip and defaulting testing will exist in the dedicated API groups instead. Added a TODO to add roundtrip, defaulting and type tag testing later.
 - Made the `register.go` files more consistent to the common template.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref https://github.com/kubernetes/community/pull/2354

**Special notes for your reviewer**:

This PR must merge before https://github.com/kubernetes/kubernetes/pull/66722 and https://github.com/kubernetes/kubernetes/pull/66993

**Release note**:

```release-note
NONE
```
@kubernetes/sig-api-machinery-pr-reviews @kubernetes/sig-cluster-lifecycle-pr-reviews 
/assign @sttts @thockin @jbeda @liggitt
2018-08-09 15:11:01 -07:00
Kubernetes Submit Queue a0e5df4968
Merge pull request #67160 from seans3/rbac-dependency
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>.

Removes dependency on RBAC within kubernetes core

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

Removes an unneeded dependency. Kubectl should depend on repo "k8s.io/api/rbac"; not "k8s.io/kubernetes/pkg/apis/rbac"

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

https://github.com/kubernetes/kubectl/issues/91

```release-note
NONE
```
2018-08-09 15:06:15 -07:00
Kubernetes Submit Queue facc84752b
Merge pull request #67184 from linyouchong/pr-0809
Automatic merge from submit-queue (batch tested with PRs 67195, 67184). 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 redundant code in aws_ebs_block.go

**What this PR does / why we need it**:
Remove redundant code in aws_ebs_block.go
There is the same code in aws_ebs.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)*:
NONE

**Special notes for your reviewer**:
NONE

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

/sig storage
2018-08-09 12:18:21 -07:00
Kubernetes Submit Queue 9419f1d93e
Merge pull request #67195 from mkimuram/issue/67146
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 provision fail issue for aws provisioner if fsType specified

**What this PR does / why we need it**:
Fix provision fail issue for aws provisioner if fsType specified

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

**Special notes for your reviewer**:
/sig storage
@ddebroy

**Release note**:
```release-note
NONE
```
2018-08-09 12:17:57 -07:00
Kubernetes Submit Queue 31d19098eb
Merge pull request #66652 from charrywanganthony/clusterinfo_dump
Automatic merge from submit-queue (batch tested with PRs 66652, 67034). 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 cluster-info dump error

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

**Release note**:
```release-note
NONE
```
2018-08-09 10:03:06 -07:00
Lucas Käldström 0db3021112
autogenerated 2018-08-09 19:35:03 +03:00
Lucas Käldström e50340ee23
Remove references to 'pkg/apis/componentconfig/install' and fix inconsistencies 2018-08-09 18:45:27 +03:00
Kubernetes Submit Queue 44d6de79e7
Merge pull request #67116 from yue9944882/refactor/node-admission-controller-externalize
Automatic merge from submit-queue (batch tested with PRs 65297, 67179, 67116, 67011, 66842). 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>.

Externalize node admission controller

**Release note**:

```release-note
NONE
```



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

/sig api-machinery

under unbrella: #66680

We start with injecting external informer/lister into node admission controller for that it's slightly simpler than the others.

Here is the thing I actually did in this pull:

1. Enable plugin initializer to inject external/internal clientset/informers into the admission controllers.
2. Receive external informer in node admission controller.
3. Create a `AdmissionConfig` following how we did in `AuthenticationConfig` and `AuthorizationConfig` and creates the actual plugin initializers and the admission post-start hook in its `New()` method
2018-08-09 08:39:31 -07:00
Kubernetes Submit Queue 636fc880da
Merge pull request #67179 from SneakyFish5/print-error
Automatic merge from submit-queue (batch tested with PRs 65297, 67179, 67116, 67011, 66842). 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 print error

**What this PR does / why we need it**:
Fixes a print error in convert.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-08-09 08:39:28 -07:00
Kubernetes Submit Queue 4b2408459e
Merge pull request #65297 from xlgao-zju/improve-kubectl-completion-help
Automatic merge from submit-queue (batch tested with PRs 65297, 67179, 67116, 67011, 66842). 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 kubectl completion help

**What this PR does / why we need it**:
Add note that 'bash-completion' is required on Linux too.

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

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

**Release note**:

```release-note
NONE
```
2018-08-09 08:39:25 -07:00
Di Xu 0af6faed09 kubectl: recreating resources for immutable fields when force is applied 2018-08-09 22:59:02 +08:00
Masaki Kimura d03434e370 Fix provision fail issue for aws provisioner if fsType specified
fixes: #67146
2018-08-09 13:32:34 +00:00
Kubernetes Submit Queue 8ebc84e71d
Merge pull request #66507 from verb/pid-beta
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>.

Promote ShareProcessNamespace to beta

**What this PR does / why we need it**: The ability to configure PID namespace sharing per-pod was added as an alpha feature in 1.10. This promotes the feature to beta and makes the feature available by default.

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

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

**Release note**:

```release-note
The PodShareProcessNamespace feature to configure PID namespace sharing within a pod has been promoted to beta.
```
2018-08-09 05:01:01 -07:00
Chao Wang 6ca446c5a0 fix cluster-info dump error 2018-08-09 19:43:55 +08:00
Kubernetes Submit Queue 41d66aaf87
Merge pull request #67171 from feiskyer/fix-zoned
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>.

AzureDisk: Parse zoned first before using it

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

`zoned` should be parsed first before using.

**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 https://github.com/kubernetes/kubernetes/pull/67121#discussion_r208639436

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```

/cc @ddebroy @khenidak @andyzhangx
2018-08-09 01:05:26 -07:00
linyouchong 5472f445dc Remove redundant code in aws_ebs_block.go 2018-08-09 15:57:05 +08:00
Kubernetes Submit Queue 57bb26911d
Merge pull request #53042 from chentao1596/support-unit-test-case-for-pod-format
Automatic merge from submit-queue (batch tested with PRs 67177, 53042). 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 unit tests to methods of pod's format

What this PR does / why we need it:

Add unit test cases, thank you!
2018-08-08 23:49:06 -07:00
Kubernetes Submit Queue e59c09e07d
Merge pull request #67177 from justaugustus/azure-owners
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 `pkg/cloudprovider/providers/azure/OWNERS`

* Remove Jaice
* Remove Cole
* Add Stephen as reviewer

Signed-off-by: Stephen Augustus <foo@agst.us>

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

/sig azure
2018-08-08 22:43:46 -07:00
SneakyFish5 1fdb5d9722
Fix print error 2018-08-08 23:35:18 -05:00
Kubernetes Submit Queue c343fa4937
Merge pull request #66917 from dougm/cloud-doc
Automatic merge from submit-queue (batch tested with PRs 67026, 62945, 66917). 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>.

Cloud Provider Zones doc fixups

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

A few godoc fixups for Cloud Provider Zones.

```release-note
NONE
```
2018-08-08 20:53:06 -07:00
Kubernetes Submit Queue bd0de223da
Merge pull request #62945 from nak3/all-resource-create-role
Automatic merge from submit-queue (batch tested with PRs 67026, 62945, 66917). 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 create {clusterrole,role}`'s `--resources` flag support asterisk to specify all resources

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

Currently `kubectl create (cluster)role`'s `--resources` flag does not support asterisk to specify all resources.

```
# kubectl create clusterrole superrole --verb=get  --resource=*
the server doesn't have a resource type "*"
```

As an user, we create a role with `--resources=*` sometimes, so this PR supports it.

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

**Special notes for your reviewer**:

- This patch does not support `--resource=*` for `SpecialVerbs` - e.g `kubectl create role foo --verb=impersonate  --resource=*`, because current code also does not support `kubectl create role foo --verb=impersonate  --resource=users,pods`

**Release note**:

```release-note
`kubectl create {clusterrole,role}`'s `--resources` flag supports asterisk to specify all resources.
```
2018-08-08 20:53:02 -07:00
Stephen Augustus ac920453ff Update `pkg/cloudprovider/providers/azure/OWNERS`
* Remove Jaice
* Remove Cole
* Add Stephen as reviewer

Signed-off-by: Stephen Augustus <foo@agst.us>
2018-08-08 23:32:18 -04:00
yue9944882 bc1fb1f7e8 node authz/ad externalization 2018-08-09 10:57:30 +08:00
Pengfei Ni 7962954053 Parse zoned first before using it 2018-08-09 10:23:53 +08:00
Kenjiro Nakayama 9cb24c4680 `kubectl create {clusterrole,role}`'s `--resources` flag support asterisk to specify all resources 2018-08-09 08:40:12 +09:00
Kubernetes Submit Queue a205089cff
Merge pull request #67149 from luxas/clientconfig_kubeconfig
Automatic merge from submit-queue (batch tested with PRs 67061, 66589, 67121, 67149). 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>.

Rename KubeConfigFile to Kubeconfig in ClientConnectionConfiguration

**What this PR does / why we need it**:
As discussed with @liggitt we should make the field name and JSON tag consistent, and we concluded `Kubeconfig` and `kubeconfig` is the most consistent naming we have (e.g. wrt `--kubeconfig`), so we're going with that naming for the `ClientConnectionConfiguration` struct. Also, this preserves backwards-compat wrt existing serialized configuration. This fixes the API violation.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
ref: https://github.com/kubernetes/community/pull/2354

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
/assign  @liggitt @sttts
2018-08-08 16:32:14 -07:00
Kubernetes Submit Queue ae351f1184
Merge pull request #67121 from feiskyer/azdisk-affinity
Automatic merge from submit-queue (batch tested with PRs 67061, 66589, 67121, 67149). 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 DynamicProvisioningScheduling and VolumeScheduling support for Azure managed disks

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

Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).

This PR adds `VolumeScheduling` and `DynamicProvisioningScheduling` support to Azure managed disks.

When feature gate `VolumeScheduling` disabled, no NodeAffinity set for PV:

```yaml
kubectl describe pv
Name:              pvc-d30dad05-9ad8-11e8-94f2-000d3a07de8c
Labels:            failure-domain.beta.kubernetes.io/region=southeastasia
                   failure-domain.beta.kubernetes.io/zone=southeastasia-2
Annotations:       pv.kubernetes.io/bound-by-controller=yes
                   pv.kubernetes.io/provisioned-by=kubernetes.io/azure-disk
                   volumehelper.VolumeDynamicallyCreatedByKey=azure-disk-dynamic-provisioner
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      default
Status:            Bound
Claim:             default/pvc-azuredisk
Reclaim Policy:    Delete
Access Modes:      RWO
Capacity:          5Gi
Node Affinity:
  Required Terms:
    Term 0:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [southeastasia-2]
Message:
Source:
    Type:         AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
    DiskName:     k8s-5b3d7b8f-dynamic-pvc-d30dad05-9ad8-11e8-94f2-000d3a07de8c
    DiskURI:      /subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Compute/disks/k8s-5b3d7b8f-dynamic-pvc-d30dad05-9ad8-11e8-94f2-000d3a07de8c
    Kind:         Managed
    FSType:
    CachingMode:  None
    ReadOnly:     false
Events:           <none>
```

When feature gate `VolumeScheduling` enabled, NodeAffinity will be populated for PV:

```yaml
kubectl describe pv
Name:              pvc-0284337b-9ada-11e8-a7f6-000d3a07de8c
Labels:            failure-domain.beta.kubernetes.io/region=southeastasia
                   failure-domain.beta.kubernetes.io/zone=southeastasia-2
Annotations:       pv.kubernetes.io/bound-by-controller=yes
                   pv.kubernetes.io/provisioned-by=kubernetes.io/azure-disk
                   volumehelper.VolumeDynamicallyCreatedByKey=azure-disk-dynamic-provisioner
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      default
Status:            Bound
Claim:             default/pvc-azuredisk
Reclaim Policy:    Delete
Access Modes:      RWO
Capacity:          5Gi
Node Affinity:
  Required Terms:
    Term 0:        failure-domain.beta.kubernetes.io/region in [southeastasia]
                   failure-domain.beta.kubernetes.io/zone in [southeastasia-2]
Message:
Source:
    Type:         AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
    DiskName:     k8s-5b3d7b8f-dynamic-pvc-0284337b-9ada-11e8-a7f6-000d3a07de8c
    DiskURI:      /subscriptions/<subscription-id>/resourceGroups/<rg-name>/providers/Microsoft.Compute/disks/k8s-5b3d7b8f-dynamic-pvc-0284337b-9ada-11e8-a7f6-000d3a07de8c
    Kind:         Managed
    FSType:
    CachingMode:  None
    ReadOnly:     false
Events:           <none>
```

When both  `VolumeScheduling` and `DynamicProvisioningScheduling` are enabled, storage class also supports `allowedTopologies` and `volumeBindingMode: WaitForFirstConsumer` for volume topology aware dynamic provisioning:

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
  name: managed-disk-dynamic
parameters:
  cachingmode: None
  kind: Managed
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowedTopologies:
- matchLabelExpressions:
  - key: failure-domain.beta.kubernetes.io/zone
    values:
    - southeastasia-2
    - southeastasia-1
```

**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
DynamicProvisioningScheduling and VolumeScheduling is not supported for Azure managed disks. Feature gates DynamicProvisioningScheduling and VolumeScheduling should be enabled before using this feature.
```

/kind feature
/sig azure
/cc @brendandburns @khenidak @andyzhangx
/cc @ddebroy @msau42 @justaugustus
2018-08-08 16:32:10 -07:00
Kubernetes Submit Queue dd4ab76f05
Merge pull request #66589 from MorrisLaw/get_load_balancer_name_per_provider
Automatic merge from submit-queue (batch tested with PRs 67061, 66589, 67121, 67149). 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>.

Get load balancer name per provider

**What this PR does / why we need it**:
GetLoadBalancerName() should be implemented per cloud provider as opposed to one neutral implementation.

This PR will address this by moving `cloudprovider.GetLoadBalancerName()` to the `LoadBalancer interface` and then provide an implementation for each cloud provider, while maintaining previously expected functionality.

**Which issue(s) this PR fixes**:
Fixes  [#43173](https://github.com/kubernetes/kubernetes/issues/43173)

**Special notes for your reviewer**:
This is a work in progress. Looking for feedback as I work on this, from any interested parties.

**Release note**:

```release-note
NONE
```
2018-08-08 16:32:07 -07:00
Sean Sullivan ff6113dfc8 Removes dependency on RBAC within kubernetes core 2018-08-08 13:58:35 -07:00
Morten Torkildsen a93ea43e15 Fix to handle hash collisions correctly for DaemonSet 2018-08-08 13:43:43 -07:00
Cheng Xing 7fa120c18c CSI plugin now calls NodeGetInfo() to get driver's node ID 2018-08-08 13:15:43 -07:00
Jiaying Zhang 7b1ae66432 Fail container start if its requested device plugin resource doesn't
have cached option state to make sure the device plugin resource is
in ready state when we start the container.
2018-08-08 13:11:36 -07:00
Lucas Käldström 2ff9bd6699
Rename the KubeConfigFile field to Kubeconfig in ClientConnectionConfiguration 2018-08-08 22:25:55 +03:00
Kubernetes Submit Queue e38efdcce6
Merge pull request #66698 from WanLinghao/token_projected_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>.

refuse serviceaccount projection volume request when pod has no servceaccount bounded

**What this PR does / why we need it**:
Currently, if user starts a cluster with ServiceAccount admission plugin disabled, then creates a Pod 
like this:
```
kind: Pod 
apiVersion: v1
metadata:
  labels:
    run: nginx
  name: busybox2
spec:
      containers:
      - image: gcr.io/google-containers/nginx
        name: nginx
        volumeMounts:
        - mountPath: /var/run/secrets/tokens
          name: token
      - image: ubuntu
        name: ttt 
        volumeMounts:
        - mountPath: /var/run/secrets/tokens
          name: token
        command: [ "/bin/bash", "-c", "--" ]
        args: [ "while true; do sleep 30; done;" ]
      volumes:
      - name: token
        projected:
          sources:
          - serviceAccountToken:
              path: tokenPath
              expirationSeconds: 6000
              audience: gakki-audiences
```
The pod creation will fail with error info like:
Events:
```
  Type     Reason       Age               From                Message
  ----     ------       ----              ----                -------
  Normal   Scheduled    23s               default-scheduler   Successfully assigned office/busybox2 to 127.0.0.1
  Warning  FailedMount  8s (x6 over 23s)  kubelet, 127.0.0.1  MountVolume.SetUp failed for volume "token" : failed to fetch token: resource name may not be empty
```
We should refuse the projection request earlier. This patch fix this.


**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-08-08 07:46:17 -07:00
Kubernetes Submit Queue 15c2dd906e
Merge pull request #66888 from yue9944882/refactor/promote-informers-into-master-cfg
Automatic merge from submit-queue (batch tested with PRs 66394, 66888, 66932). 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>.

Promote internal/external informers into master.Config

**Release note**:

```release-note
NONE
```
xref #66386

Shorten `BuildGenericConfig`'s return list. 
Put the internal and external informers into master.Config. Previous art:


[60614d5cdc/staging/src/k8s.io/apiserver/pkg/server/config.go (L196))
2018-08-08 07:00:08 -07:00
Kubernetes Submit Queue 28b2b21287
Merge pull request #65891 from CaoShuFeng/audit_v1_stable
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>.

upgrade Audit api version to stable

Partial Fix: https://github.com/kubernetes/kubernetes/issues/65266

TODO:
    use v1 version of advanced audit policy in [kubeadm](86b9a53226/cmd/kubeadm/app/util/audit/utils.go (L29)), [gce script](86b9a53226/cluster/gce/gci/configure-helper.sh (L743)), [kubemark](86b9a53226/test/kubemark/resources/start-kubemark-master.sh (L349))



**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
audit.k8s.io api group is upgraded from v1beta1 to v1.
Deprecated element metav1.ObjectMeta and Timestamp are removed from audit Events in v1 version.
Default value of option --audit-webhook-version and --audit-log-version will be changed from `audit.k8s.io/v1beta1` to `audit.k8s.io/v1` in release 1.13
```
2018-08-08 02:17:24 -07:00
Pengfei Ni 30fe79d63f Add DynamicProvisioningScheduling and VolumeScheduling support for AzureDisk 2018-08-08 17:05:46 +08:00
Ben Swartzlander 39e52ddae5 Add wait loop for multipath devices to appear
It takes a variable amount of time for the multipath daemon
to create /dev/dm-XX in response to new LUNs being discovered.
The old iscsi_util code only discovered the multipath device
if it was created quickly enough, but in a significant number
of cases, kubelet would grab one of the individual paths and
put a filesystem it on before multipathd could construct a
multipath device.

This change waits for the multipath device to get created for
up to 10 seconds, but only if the PV actually had more than
one portal.
2018-08-08 00:44:45 -04:00
Kubernetes Submit Queue fc89a80934
Merge pull request #63572 from haz-mat/aws-lb-sg-scope-icmp
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>.

scope AWS LoadBalancer security group ICMP rules to spec.loadBalancerSourceRanges

/sig aws
**What this PR does / why we need it**:
Make the client CIDR ranges for MTU consistent with what [the documentation appears to describe](https://kubernetes.io/docs/concepts/services-networking/service/#type-loadbalancer), where the ranges should be equal to `spec.loadBalancerSourceRanges` if supplied.

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

**Release note**:
```release-note
scope AWS LoadBalancer security group ICMP rules to spec.loadBalancerSourceRanges
```
2018-08-07 20:49:15 -07:00
WanLinghao 5a27ee9282 refuse serviceaccount projection volume request when pod has no serviceaccount bounded 2018-08-08 10:29:07 +08:00
yue9944882 6bac6fafa0 promote informers into master.Config
review:

1. move informers into master extra config
2. move one post start hook into New()

fixes npe from master integration test
2018-08-08 09:35:45 +08:00
Morgan Bauer 0b709dcf7d
error text refers to wrong stream type 2018-08-07 18:20:24 -07:00
Chakri Nelluri 93a19fce28 Ignore EIO error in unmount path 2018-08-07 21:04:39 -04:00
Kubernetes Submit Queue 9d260ff163
Merge pull request #66795 from jiatongw/zones_vendor
Automatic merge from submit-queue (batch tested with PRs 67052, 67094, 66795). 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 zones support for vSphere cloud provider(in-tree)

**What this PR does / why we need it**:
This PR added zones(built-in node labels) support for vSphere cloud provider(in-tree).  More details can be found in the issue as below.

**Which issue(s) this PR fixes** :
Partially fixes phase 1 of issue #64021 

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-07 17:16:04 -07:00
Kubernetes Submit Queue e5e047674e
Merge pull request #67094 from aveshagarwal/master-rhbz-1611988
Automatic merge from submit-queue (batch tested with PRs 67052, 67094, 66795). 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>.

Output volumes (capacity, requested) along with cpu and memory when BalanceAttachedNodeVolumes is enabled. 

This PR has 2 commits: 

One commit fixes incorrect reporting of total request of cpu and memory. Without this commit, see the erroneous output where total request is more than capacity when the pod is allowed to admit. 

```
BalancedResourceAllocation, capacity 4000 millicores 15495647232 memory bytes, total request 4850 millicores 17248866304 memory bytes, score 9
```

The other commit adds outputting volumes (capacity, requested) too along with cpu and memory when BalanceAttachedNodeVolumes is enabled. 

@kubernetes/sig-scheduling-pr-reviews @bsalamat @k82cn @ravisantoshgudimetla 

```release-note
None.
```
2018-08-07 17:16:00 -07:00
Kubernetes Submit Queue 32cf28f642
Merge pull request #67052 from liangwenguo/optimize_log
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>.

make the log about HPA more readable

**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-08-07 17:01:34 -07:00
Kubernetes Submit Queue 04ca0d5411
Merge pull request #66894 from WanLinghao/token_projected_validation_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>.

improve serviceaccount projected volume validation error info

**What this PR does / why we need it**:
Fix a small bug here;
We should use srcPath instead fldPath here like other projection volume do which could give info 
about which source triggered the error.
**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-08-07 15:42:04 -07:00
Kubernetes Submit Queue 00bf292cdc
Merge pull request #66480 from Huang-Wei/stateless-MatchNodeSelectorTerms
Automatic merge from submit-queue (batch tested with PRs 67042, 66480, 67053). 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>.

ensure MatchNodeSelectorTerms() runs statelessly

**What this PR does**:

Fix sorting behavior in selector.go:

- move sorting from NewRequirement() out to String()
- add related unit tests
- add unit tests in one of outer callers (pkg/apis/core/v1/helper)

**Why we need it**:
- Without this fix, scheduling and daemonset controller doesn't work well in some (corner) cases

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

**Special notes for your reviewer**:
Parameter `nodeSelectorTerms` in method MatchNodeSelectorTerms() is a slice, which is fundamentally a {*elements, len, cap} tuple - i.e. it's passing in a pointer. In that method, NodeSelectorRequirementsAsSelector() -> NewRequirement() is invoked, and the `matchExpressions[*].values` is passed into and **modified** via `sort.Strings(vals)`.

This will cause following daemonset pod fall into an infinite create/delete loop:

```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: problem
spec:
  selector:
    matchLabels:
      app: sleeper
  template:
    metadata:
      labels:
        app: sleeper
    spec:
      affinity:
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
              - key: kubernetes.io/hostname
                operator: In
                values:
                - 127.0.0.2
                - 127.0.0.1
      containers:
      - name: busybox
        image: busybox
        command: ["/bin/sleep", "7200"]
```

(the problem can be stably reproduced on a local cluster started by `hack/local-up-cluster.sh`)

The first time daemonset yaml is handled by apiserver and persisted in etcd with original format (original order of values was kept - 127.0.0.2, 127.0.0.1). After that, daemonset controller tries to schedule pod, and it reuses the predicates logic in scheduler component - where the values are **sorted** deeply. This not only causes the pod to be created in sorted order (127.0.0.1, 127.0.0.2), but also introduced a bug when updating daemonset - internally ds controller use a "rawMessage" (bytes of an object) to calculate hash acting as a "controller-revision-hash" to control revision rollingUpdate/rollBack, so it keeps killing "old" pod and spawning "new" pod back and forth, and fall into an infinite loop.

The issue exists in `master`, `release-1.11` and `release-1.10`.

**Release note**:
```release-note
NONE
```
2018-08-07 14:27:59 -07:00
Avesh Agarwal be741feb1a Ouput volumes (total capacity and requests) too along with cpu and memory
when the feature BalanceAttachedNodeVolumes is used.
2018-08-07 15:40:33 -04:00
Avesh Agarwal ea7f711ae2 Fix incorrect reporting of total request including current pod in the
resource allocation priority function.
2018-08-07 15:37:55 -04:00
Kubernetes Submit Queue d1636b8019
Merge pull request #66807 from caesarxuchao/remove-connectrequest
Automatic merge from submit-queue (batch tested with PRs 66196, 67016, 66807, 67023). 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 admission webhooks conversion convert CONNECT body correctly

Fix #59759.

1. Make apiserver pass connectRequest.Options directly to the admission layer. All other information in rest.ConnectRequest is present in admission attributes.
2. Make the scope.Kind of pod/attach, pod/exec, pod/portforward, node/proxy, service/proxy to their respective options Kind, instead of the parent Kind.

I've tested it locally, the conversion is working correctly for "kubectl attach". I'll add e2e tests.

I'll keep this to myself until I add the tests, but cc @mikedanese @liggitt RE. https://github.com/kubernetes/kubernetes/pull/66633.
2018-08-07 11:44:10 -07:00
Kubernetes Submit Queue 5ed156d67b
Merge pull request #66196 from tanshanshan/fixspell1
Automatic merge from submit-queue (batch tested with PRs 66196, 67016, 66807, 67023). 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 spelling  mistakes

**What this PR does / why we need it**:
fix spelling  mistakes

**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-08-07 11:44:02 -07:00
Wei Huang e5e0de1b9d fix sorting behavior in selector.go
- move sorting from NewRequirement() out to String()
- add related unit tests
- add unit tests in one of outer callers (pkg/apis/core/v1/helper)

Closes #66298
2018-08-07 10:36:16 -07:00
vikaschoudhary16 79f2328f7b Graduate ResourceQuotaScopeSelectors to beta 2018-08-07 09:04:39 -04:00
Kubernetes Submit Queue 83f6efcec0
Merge pull request #66736 from hanxiaoshuai/cleanup0728
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 func WaitForCompletionRef replace of deprecated func WaitForCompletion

**What this PR does / why we need it**:
use func WaitForCompletionRef replace of deprecated func WaitForCompletion

```
// WaitForCompletion will return when one of the following conditions is met: the long
// running operation has completed, the provided context is cancelled, or the client's
// polling duration has been exceeded.  It will retry failed polling attempts based on
// the retry value defined in the client up to the maximum retry attempts.
// Deprecated: Please use WaitForCompletionRef() instead.
func (f Future) WaitForCompletion(ctx context.Context, client autorest.Client) error {
	return f.WaitForCompletionRef(ctx, client)
}
```

**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-08-07 03:34:28 -07:00
Harry Zhang 17d0190706 Use sync.map to scale ecache better 2018-08-07 14:06:09 +08:00
Kubernetes Submit Queue db9545e69e
Merge pull request #66386 from yue9944882/refactor/etcd-options-config
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 storage factory config with Complete().New() flow

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

1. Split `BuildStorageFactory` constructor into `Complete().New()` flow to build an instance for etcd storage.

2. Put `EtcdOptions` and `StorageSerializationOptions` into a `StorageFactoryOptions` for a more reasonable structured config object.

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

Generally, my idea is to split the huge code in [https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-apiserver/app/server.go](https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-apiserver/app/server.go) into somewhere else making more sense :)

**Release note**:

```release-note
NONE
```
2018-08-06 20:26:02 -07:00
Kubernetes Submit Queue 60ac433922
Merge pull request #66946 from LinEricYang/unused-variable
Automatic merge from submit-queue (batch tested with PRs 66512, 66946, 66083). 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/cm/cpumanager: Fix unused variable "skipIfPermissionsError"

The variable "skipIfPermissionsError" is not needed even when
permission error happened.
2018-08-06 19:44:04 -07:00
liangwenguo 8f8a7bb83f make the log more readable 2018-08-07 10:00:31 +08:00
Chao Xu 64bd0e4589 Fix scope.Kind of CONNECT subresources.
Make scope.Kind of pod/attach, pod/exec, pod/portforward, node/proxy,
service/proxy to their respective subresource Kind, instead of the
parent Kind. The kind is used by the admission webhook controller to
determine how to convert the object.
2018-08-06 18:59:52 -07:00
Kubernetes Submit Queue dda37a52ec
Merge pull request #67033 from juanvallejo/jvallejo/add-corev1-pod-kubectl-conditions
Automatic merge from submit-queue (batch tested with PRs 58058, 67033, 66921, 66956). 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>.

expose default LogsForObject consumeRequest func

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

Expose the `consumeRequest` func to make it reusable for other consumers of the `LogsForObject` polymorphic func
2018-08-06 17:01:08 -07:00
Kubernetes Submit Queue d114692a58
Merge pull request #58058 from tianshapjq/cleanup-useless-var-deviceplugin/types.go
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 useless variables in deviceplugin/types.go

**What this PR does / why we need it**:
some variables is useless for reasons, I think we need a clean 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-08-06 16:33:54 -07:00
jiatongw af5084ea75 Add TestZone() 2018-08-06 15:19:10 -07:00
Kubernetes Submit Queue 72860eb2bd
Merge pull request #66958 from yue9944882/chore/homogenize-controller-keyfunc
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>.

Reference common keyfunc in endpoints controller

**What this PR does / why we need it**:
As the title
**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-08-06 13:40:12 -07:00
juanvallejo 0c4bb64304
expose default LogsForObject consumeRequest func 2018-08-06 16:23:18 -04:00
Kubernetes Submit Queue 554418735a
Merge pull request #66692 from m1kola/66456_waitcmd__error_for_selectors
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>.

Makes kubectl wait exit with status 1 and print an error message, if there is no resources matching selectors

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

It makes the `kubectl wait` command print an error message and exit with exit code 1, if there is no resource matching users's query. This can happen when user specifies selectors. Example:

```
kubectl wait deployment -l app=something-that-does-not-exist --for condition=available --timeout=5s
```

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

**Special notes for your reviewer**:

This is my first contribution into the project (except one line change in docs) and don't have much experience with Go. I learned a lot while working on this (about resource finders and the `Visitor` interface and it's implementations), but it is very likely that I'm doing something wrong :)

I'm keen to continue contributing into the project (into the cli part for now), so I will really appreciate detailed feedback, if you have a chance to provide it (point me into a right direction and/or explain why it's not a good idea to do something in a certain way).

Thanks!

**Release note**:
```release-note
kubectl: the wait command now prints an error message and exits with the code 1, if there is no resources matching selectors
```
2018-08-06 10:31:57 -07:00
Kubernetes Submit Queue b759b0026e
Merge pull request #66998 from WanLinghao/more_legacy_clean
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>.

snip more legacy scheme uses we don't need

**What this PR does / why we need it**:
snip more legacy scheme uses we don't need
ref:https://github.com/kubernetes/kubernetes/pull/66926
**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-08-06 09:13:28 -07:00
yue9944882 e8ae7887a5 This is a combination of 3 commits.
refactor storage factory options

review: minor changes

1. make storage factory config complete with options
2. make BuildGenericConfig private

review: move codes
2018-08-06 22:29:10 +08:00
Kubernetes Submit Queue 397b84205e
Merge pull request #66883 from tallclair/validation
Automatic merge from submit-queue (batch tested with PRs 66351, 66883, 66156). 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 coordination.Lease validation

Fix a couple issues I noticed in the coordination.Lease validation logic which copying it for a new API:

- Field path should use the json path names (`objectMeta` -> `matadata`)
- ObjectMeta should be validated on update

**Release note**:
```release-note
NONE
```
2018-08-06 07:13:18 -07:00
Kubernetes Submit Queue e5b8e891e9
Merge pull request #66351 from vikaschoudhary16/fix-scopeselector-exist-operator
Automatic merge from submit-queue (batch tested with PRs 66351, 66883, 66156). 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 unit tests to cover scopes and scope selectors during quota sync logic

**What this PR does / why we need it**:
Adds unit tests to cover scopes and scope selectors fields in the quota spec. Existing unit test for quota sync does not cover scopes.

Also while adding tests found a minor issue with 'Exists' scope selector operator. This is also being fixed in this PR.

**Special notes for your reviewer**:

**Release note**:

```release-note
Unit tests for scopes and scope selectors in the quota spec
```
/cc @derekwaynecarr @sjenning @bsalamat @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-node-pr-reviews
2018-08-06 07:13:14 -07:00
Kubernetes Submit Queue 14bcbb9450
Merge pull request #66553 from feiskyer/azure-disk-availablity-zone
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 availability zones support to Azure managed disks

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

Continue of [Azure Availability Zone feature](https://github.com/kubernetes/features/issues/586).

This PR adds availability zone support for Azure managed disks and its storage class. Zoned managed disks is enabled by default if there are zoned nodes in the cluster.

The zone could also be customized by `zone` or `zones` parameter, e.g.

```yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
  name: managed-disk-zone-1
parameters:
  zone: "southeastasia-1"
  # zones: "southeastasia-1,"southeastasia-2"
  cachingmode: None
  kind: Managed
  storageaccounttype: Standard_LRS
provisioner: kubernetes.io/azure-disk
reclaimPolicy: Delete
volumeBindingMode: Immediate
```

All zoned AzureDisk PV will also be labeled with its availability zone, e.g.

```sh
$ kubectl get pvc pvc-azuredisk-az-1
NAME                 STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS          AGE
pvc-azuredisk-az-1   Bound     pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            managed-disk-zone-1   2h

$ kubectl get pv pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c --show-labels
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS    CLAIM                        STORAGECLASS          REASON    AGE       LABELS
pvc-5ad0c7b8-8f0b-11e8-94f2-000d3a07de8c   5Gi        RWO            Delete           Bound     default/pvc-azuredisk-az-1   managed-disk-zone-1             2h        failure-domain.beta.kubernetes.io/region=southeastasia,failure-domain.beta.kubernetes.io/zone=southeastasia-1
```

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

See also the [KEP](https://github.com/kubernetes/community/pull/2364).

DynamicProvisioningScheduling feature would be added in a following PR.

**Release note**:

```release-note
Azure managed disks now support availability zones and new parameters `zoned`, `zone` and `zones` are added for AzureDisk storage class.
```

/kind feature
/sig azure
/assign @brendandburns @khenidak @andyzhangx
2018-08-06 02:02:54 -07:00
WanLinghao 5db028612d snip more legacy scheme uses we don't need
ref:https://github.com/kubernetes/kubernetes/pull/66926
2018-08-06 09:44:04 +08:00
jiatongw 5c44fd871f Update vmware/govmomi vendor: add vapi package
Zones implementation for vSphere cloud provider needs dependencies
which are not included in current vmware/govmomi vendor. So this
update added "vapi" package to support zones.
2018-08-03 22:11:42 -07:00
morrislaw 6ecec23690 Implement GetLoadBalancerName per provider and add DefaultLoadBalancerName. 2018-08-04 00:36:48 -04:00
Da K. Ma a75d625cc3 Compared preemption by priority.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-08-04 11:33:07 +08:00
Kubernetes Submit Queue 929c8459c3
Merge pull request #66466 from apelisse/dry-run-struct
Automatic merge from submit-queue (batch tested with PRs 64815, 66823, 66473, 66466). 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>.

dry-run: Use dry-runnable structure

Creates a structures that decides to either by-pass persistence and tries to reproduce the same behavior (without persistence), or just pass along to storage.

This is obviously not finished, I'm would like to get feedback on the direction, is this the direction we'd like to go?

**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-08-03 18:03:07 -07:00
Kubernetes Submit Queue c526d6fa84
Merge pull request #66473 from fisherxu/remove_code
Automatic merge from submit-queue (batch tested with PRs 64815, 66823, 66473, 66466). 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 unused code

**What this PR does / why we need it**:
Clean up the unused duplicate 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-08-03 18:03:04 -07:00
Kubernetes Submit Queue cb1ef9f7e8
Merge pull request #64815 from dixudx/hostname_empty
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>.

error out empty hostname

**What this PR does / why we need it**:
For linux, the hostname is read from file `/proc/sys/kernel/hostname` directly, which can be overwritten with whitespaces.

Should error out such invalid hostnames.

**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/kubeadm#835

**Special notes for your reviewer**:
/cc luxas timothysc 

**Release note**:

```release-note
nodes: improve handling of erroneous host names
```
2018-08-03 17:13:32 -07:00
Antoine Pelisse 68937c4934 dry-run: Use dry-runnable structure 2018-08-03 14:30:50 -07:00
Kubernetes Submit Queue f4b2abe9fe
Merge pull request #66933 from deads2k/kubectl-07-rollout
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>.

switching rolling update to external clients

Switches rolling update to use external clients.  This is a pretty strange looking command.

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

```release-note
NONE
```
2018-08-03 14:00:32 -07:00
jiatongw 99abd4bc79 Add zones support for vSphere cloud provider (in-tree) 2018-08-03 13:24:42 -07:00
Kubernetes Submit Queue 0c8fe56ea4
Merge pull request #66484 from k82cn/rm_unused_funcs
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>.

Removed unused functions.

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 #

**Special notes for your reviewer**:

**Release note**:
```release-note
None
```
2018-08-03 12:40:35 -07:00
David Eads 029b4388fe switching rolling update to external clients 2018-08-03 13:18:14 -04:00
Kubernetes Submit Queue dab04dc6e0
Merge pull request #66967 from deads2k/kubectl-09-naughty
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 adding internal types to external schemes

at some point someone starting internal types to external schemes in kubectl tests.  This fixes that mistake.

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

```release-note
NONE
```
2018-08-03 10:07:47 -07:00