Commit Graph

19385 Commits (27259358cbbadd7c3c0aaaeb1471ac3daebfba21)

Author SHA1 Message Date
Solly Ross 592f5c091f HPA: Don't mutate the shared informer cache
Conversions can mutate the underlying object (and ours were).
Make a deepcopy before our first conversion at the very start
of the reconciler method in order to avoid mutating the shared
informer cache during conversion.

Fixes #41768
2017-02-21 11:57:08 -05:00
Eric Chiang a0df658b20 kube-apiserver: add a bootstrap token authenticator for TLS bootstrapping 2017-02-21 08:43:55 -08:00
Kubernetes Submit Queue a67e78e4fa Merge pull request #40317 from kpgriffith/recycle-vol-plug-cleanup
Automatic merge from submit-queue (batch tested with PRs 41364, 40317, 41326, 41783, 41782)

changes to cleanup the volume plugin for recycle

**What this PR does / why we need it**:
Code cleanup. Changing from creating a new interface from the plugin, that then calls a function to recycle a volume, to adding the function to the plugin itself.

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

**Special notes for your reviewer**:
Took same approach from closed PR #28432.

Do you want the approach to be the same for NewDeleter(), NewMounter(), NewUnMounter() and should they be in this same PR or submit different PR's for those?

**Release note**:

```NONE
```
2017-02-21 07:45:40 -08:00
riverzhang 5156b7f8cf Fix some typos 2017-02-21 07:15:40 -06:00
zhengchuan hu e3b697097d Fix comment for struct DeploymentBasicGeneratorV1 2017-02-21 20:47:06 +08:00
Kubernetes Submit Queue e65ac460eb Merge pull request #37237 from jpeeler/implementation-volumeaio
Automatic merge from submit-queue (batch tested with PRs 41709, 41685, 41754, 41759, 37237)

Projected volume plugin

This is a WIP volume driver implementation as noted in the commit for https://github.com/kubernetes/kubernetes/pull/35313.
2017-02-21 04:27:51 -08:00
Kubernetes Submit Queue 41bee6de16 Merge pull request #41754 from jbeda/bootstrap-secret-name
Automatic merge from submit-queue (batch tested with PRs 41709, 41685, 41754, 41759, 37237)

Ignore Bootstrap Token secrets that don't use predictable names.
2017-02-21 04:27:48 -08:00
Kubernetes Submit Queue 43fec5afb5 Merge pull request #41685 from liggitt/edit-refactor-unknown-field
Automatic merge from submit-queue (batch tested with PRs 41709, 41685, 41754, 41759, 37237)

Tolerate unknown fields in strategic merge patch

When using `apply` or `edit` with an object that has a compiled-in struct, if an unknown server-side field is sent, or is present in a provided file, the strategic merge patch computation fails looking up type info from the go struct

If the field only exists in one side of the patch (is being added or removed), or is identical in both sides of the patch, we should tolerate missing type info, since it doesn't affect the patch.
2017-02-21 04:27:46 -08:00
Kubernetes Submit Queue 4ace781a78 Merge pull request #41709 from luxas/kubeadm_hide_fuzz_flag
Automatic merge from submit-queue

kubeadm: Hide the unnecessary --fuzz-iters flag

super straightforward. We don't want this flag to leak into our UX.

cc @jbeda @dmmcquay @deads2k
2017-02-21 04:26:35 -08:00
shiywang 557c18694a Add apply view last-applied subcommand
change to GetOriginalConfiguration

add bazel

refactor apply view-last-applied command

update some changes

minor change

add unit tests, update

update some codes and genreate docs

update LongDesc
2017-02-21 20:08:25 +08:00
Di Xu 49098d08b7 fix issue #41746 2017-02-21 18:41:27 +08:00
Kubernetes Submit Queue 1cb737fb97 Merge pull request #41576 from deads2k/cli-04-remove-outputversion
Automatic merge from submit-queue (batch tested with PRs 41706, 39063, 41330, 41739, 41576)

deprecate and disconnect --output-version

For at least two releases, there haven't been multiple versions of API groups and we don't plan to support conversions in commands other than `kubectl convert`.  This disconnects the `--output-version` option to be consistent with conversion agnostic command before it becomes an issue.

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

```release-note
`--output-version` is ignored for all commands except `kubectl convert`.  This is consistent with the generic nature of `kubectl` CRUD commands and the previous removal of `--api-version`.  Specific versions can be specified in the resource field: `resource.version.group`, `jobs.v1.batch`.
```
2017-02-21 02:24:45 -08:00
Kubernetes Submit Queue 98962212a3 Merge pull request #41330 from feiskyer/fix
Automatic merge from submit-queue (batch tested with PRs 41706, 39063, 41330, 41739, 41576)

Fix regex match doc of procfs.PidOf

Fixes #41247.

cc @bboreham
2017-02-21 02:24:41 -08:00
NickrenREN 6899dd85d4 fix some typos and var style 2017-02-21 17:08:14 +08:00
Wojciech Tyczynski a21b08d00f Revert "Use watch param instead of deprecated /watch/ prefix" 2017-02-21 08:37:51 +01:00
Jordan Liggitt f8d2e4fa1c
Add 'kubectl edit' testcase for unknown field in known group/version/kind 2017-02-20 20:40:03 -05:00
Kubernetes Submit Queue 9c0e46bdff Merge pull request #40843 from luomiao/photon-cloud-provider-authentication-update
Automatic merge from submit-queue (batch tested with PRs 41756, 36344, 34259, 40843, 41526)

Update Photon Controller cloud provider for authentication support

Resolve Issue: [#40755](https://github.com/kubernetes/kubernetes/issues/40755)
1. Update the configuration file for Photon Controller cloud provider
2. Only master nodes can communicate with Photon Controller endpoint
3. Enable support for authentication-enabled Photon Controller endpoint
4. Update NodeAddresses function for query from local node

New format of photon controller config file:
```
[Global]
target = https://[LOAD_BALANCER_IP]:443
project = [PROJECT ID]
overrideIP = true
vmID = [LOCAL VM ID]
authentication = true
```
This config file will be automatically created by Photon Controller cluster management.

If authentication file is set to true, then a pc_login_info file should be placed under /etc/kubernetes with username and password.
This file can be created by user directly.
Or the user can choose to use kubernetes secret and a handling pod to avoid directly login to master nodes. This usage will be available with Photon Controller 1.2.
This is a temporary solution before metadata service becomes available in Photon Controller.
2017-02-20 13:39:39 -08:00
Kubernetes Submit Queue 8738e36c70 Merge pull request #34259 from liggitt/node-dns
Automatic merge from submit-queue (batch tested with PRs 41756, 36344, 34259, 40843, 41526)

add InternalDNS/ExternalDNS node address types

This PR adds internal/external DNS names to the types of NodeAddresses that can be reported by the kubelet.

will spawn follow up issues for cloud provider owners to include these when possible

```release-note
Nodes can now report two additional address types in their status: InternalDNS and ExternalDNS. The apiserver can use `--kubelet-preferred-address-types` to give priority to the type of address it uses to reach nodes.
```
2017-02-20 13:39:37 -08:00
Kubernetes Submit Queue 79bef05f2d Merge pull request #36344 from anguslees/gophercloud
Automatic merge from submit-queue (batch tested with PRs 41756, 36344, 34259, 40843, 41526)

Migrate rackspace/gophercloud -> gophercloud/gophercloud

`gophercloud` is the go library we use to interact with openstack.  It has recently been renamed and incorporated a number of breaking code cleanups.  This change migrates the Kubernetes openstack code (openstack provider, keystone auth, cinder volumes) to the new library.

Fixes #30404

```release-note
The openstack cloud provider config no longer supports the deprecated `api-key` option. 
```

Note this PR doesn't change the rackspace provider.  It uses some rackspace-specific APIs and continues to use the older rackspace/gophercloud library.
2017-02-20 13:39:36 -08:00
Jordan Liggitt 893928c194
generated files 2017-02-20 16:20:57 -05:00
Jordan Liggitt beb291d6d2
Include all user.Info data in CSR object 2017-02-20 16:20:57 -05:00
Joe Beda 3a3c2fa0c8
Ignore Bootstrap Token secrets that don't use predictable names.
This aligns with spec changes coming in https://github.com/kubernetes/community/pull/381.

Signed-off-by: Joe Beda <joe.github@bedafamily.com>
2017-02-20 11:38:21 -08:00
Kubernetes Submit Queue dfacc61c5f Merge pull request #41722 from liggitt/watch-prefix
Automatic merge from submit-queue (batch tested with PRs 41421, 41440, 36765, 41722)

Use watch param instead of deprecated /watch/ prefix

Switches clients to use watch param instead of /watch/ prefix

```release-note
Clients now use the `?watch=true` parameter to make watch API calls, instead of the `/watch/` path prefix
```
2017-02-20 10:37:44 -08:00
Jeff Peeler ec701a65e8 Generated files for projected volume driver 2017-02-20 13:09:41 -05:00
Jeff Peeler 8fb1b71c66 Implements projected volume driver
Proposal: kubernetes/kubernetes#35313
2017-02-20 12:56:04 -05:00
Lucas Käldström 66e35af569
Move the kubeadm fuzzing into a separate package not imported by cmd/kubeadm 2017-02-20 19:41:29 +02:00
Derek Carr 9a1e30f776 BestEffort QoS class has min cpu shares 2017-02-20 12:28:00 -05:00
Julien Balestra 89e1382dd9 Remove else if else 2017-02-20 18:24:41 +01:00
Michail Kargakis 7a8259c6a1 controller: fix requeueing progressing deployments
Drop the secondary queue and add either ratelimited or after the
required amount of time that we need to wait directly in the main
queue. In this way we can always be sure that we will sync back
the Deployment if its progress has yet to resolve into a complete
(NewReplicaSetAvailable) or TimedOut condition.
2017-02-20 18:19:23 +01:00
Julien Balestra ff8fbd4c8b Fix a typo 2017-02-20 18:16:41 +01:00
Kubernetes Submit Queue af41d2f57c Merge pull request #41661 from liggitt/satoken
Automatic merge from submit-queue

Make controller-manager resilient to stale serviceaccount tokens

Now that the controller manager is spinning up controller loops using service accounts, we need to be more proactive in making sure the clients will actually work.

Future additional work:
* make a controller that reaps invalid service account tokens (c.f. https://github.com/kubernetes/kubernetes/issues/20165)
* allow updating the client held by a controller with a new token while the controller is running (c.f. https://github.com/kubernetes/kubernetes/issues/4672)
2017-02-20 08:39:31 -08:00
Harry Zhang cba9a90fd1 Ignore file start with dots 2017-02-20 21:49:42 +08:00
Kubernetes Submit Queue 2f0e5ba786 Merge pull request #41272 from DirectXMan12/feature/hpa-v2-controller
Automatic merge from submit-queue

Convert HPA controller to support HPA v2 mechanics

This PR converts the HPA controller to support the mechanics from HPA v2.
The HPA controller continues to make use of the HPA v1 client, but utilizes
the conversion logic to work with autoscaling/v2alpha1 objects internally.

It is the follow-up PR to #36033 and part of kubernetes/features#117.

**Release note**:
```release-note
NONE
```
2017-02-20 01:52:19 -08:00
Solly Ross caa78e0b3e Fix HPA v1 Conversion Bug
There was a bug in the HPA v1 conversion logic that would occur when
a custom metric and a metric that was encoded in v1 as
targetCPUUtilizationPercentage were used at the same time.  In this
case, the custom metric could overwrite the CPU metric, or vice versa.

This fixes that bug, and ensures that the fuzzer tests round-tripping
with multiple metrics.
2017-02-20 01:45:49 -05:00
Jordan Liggitt 029cf08e6f
regenerate clients 2017-02-19 23:51:59 -05:00
Jordan Liggitt f950171003
Switch watch prefixes to params 2017-02-19 23:51:58 -05:00
Vishnu kannan 26f9598279 admit critical pods under resource pressure\n evict critical pods that are not static
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-02-19 19:19:09 -08:00
Jordan Liggitt 308fdcd13f
Pass typed options to dynamic client 2017-02-19 22:12:55 -05:00
Angus Lees c077c30004 Migrate rackspace/gophercloud -> gophercloud/gophercloud
This change migrates the 'openstack' provider and 'keystone'
authenticator plugin to the newer gophercloud/gophercloud library.

Note the 'rackspace' provider still uses rackspace/gophercloud.

Fixes #30404
2017-02-20 11:03:05 +11:00
Kubernetes Submit Queue 4a75c1b2aa Merge pull request #41617 from timothysc/affinity_annotations_flaggate
Automatic merge from submit-queue (batch tested with PRs 39373, 41585, 41617, 41707, 39958)

Feature-Gate affinity in annotations 

**What this PR does / why we need it**:
Adds back basic flaggated support for alpha Affinity annotations

**Special notes for your reviewer**:
Reconcile function is placed in the lowest common denominator, which in this case is schedulercache, because you can't place flag-gated functions in apimachinery. 

**Release note**:

```
NONE
```

/cc @davidopp
2017-02-19 13:50:40 -08:00
Kubernetes Submit Queue 7236af6162 Merge pull request #39373 from apprenda/fix_configmap
Automatic merge from submit-queue (batch tested with PRs 39373, 41585, 41617, 41707, 39958)

Fix ConfigMaps for Windows

**What this PR does / why we need it**: ConfigMaps were broken for Windows as the existing code used linux specific file paths. Updated the code in `kubelet_getters.go` to use `path/filepath` to get the directories. Also reverted back the code in `secret.go` as updating `kubelet_getters.go` to use `path/filepath` also fixes `secrets`

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes https://github.com/kubernetes/kubernetes/issues/39372

```release-note
Fix ConfigMap for Windows Containers.
```

cc: @pires
2017-02-19 13:50:37 -08:00
Kubernetes Submit Queue 070ebfe622 Merge pull request #41414 from kevin-wangzefeng/tolerationseconds-admission-controller
Automatic merge from submit-queue (batch tested with PRs 41043, 39058, 41021, 41603, 41414)

add defaultTolerationSeconds admission controller

**What this PR does / why we need it**:
Splited from #34825, add a new admission-controller that
1. adds toleration (with tolerationSeconds = 300) for taint `notReady:NoExecute` to every pod that does not already have a toleration for that taint, and
2. adds toleration (with tolerationSeconds = 300) for taint `unreachable:NoExecute` to every pod that does not already have a toleration for that taint.

**Which issue this PR fixes**: 
Related issue: #1574
Related PR: #34825

**Special notes for your reviewer**:

**Release note**:

```release-note
add defaultTolerationSeconds admission controller
```
2017-02-19 00:58:47 -08:00
Kubernetes Submit Queue eb8e1dd5f1 Merge pull request #41021 from jcbsmpsn/rotate-certificate
Automatic merge from submit-queue (batch tested with PRs 41043, 39058, 41021, 41603, 41414)

Rotate the kubelet certificate when about to expire.

Changes the kubelet so it doesn't use the cert/key files directly for
starting the TLS server. Instead the TLS server reads the cert/key from
the new CertificateManager component, which is responsible for
requesting new certificates from the Certificate Signing Request API on
the API Server.
2017-02-19 00:58:45 -08:00
Justin Santa Barbara bba343d066 Allow multiple mounts in StatefulSet volume zone placement
We have some heuristics that ensure that volumes (and hence stateful set
pods) are spread out across zones.  Sadly they forgot to account for
multiple mounts.  This PR updates the heuristic to ignore the mount name
when we see something that looks like a statefulset volume, thus
ensuring that multiple mounts end up in the same AZ.

Fix #35695
2017-02-19 02:20:04 -05:00
Kevin 83545a65f1 add defaultTolerationSeconds admission controller 2017-02-18 23:48:03 +08:00
Timothy St. Clair 2bcd63c524 Cleanup work to enable feature gating annotations 2017-02-18 09:25:57 -06:00
Robert Rati 32c4683242 Feature-Gate affinity in annotations 2017-02-18 09:08:38 -06:00
Jordan Liggitt 66dec96735 Revert "Generate valid container id in fake docker client." 2017-02-18 10:06:24 -05:00
Humble Chirammal 1fd341ee72 Update reviewer list for iscsi volume plugin.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-18 13:12:03 +05:30
Jordan Liggitt b83e6f7d91
Make controller-manager resilient to stale serviceaccount tokens 2017-02-17 23:59:00 -05:00
Kubernetes Submit Queue 4d11cbc577 Merge pull request #39364 from zhouhaibing089/nodeports
Automatic merge from submit-queue

nodeports usage should be part of LoadBalancer service type

Since a creation of Service of type LoadBalancer will allocate NodePorts as well, so it makes more sense to account for the NodePort usage in the LoadBalancer switch case.

check here: https://github.com/kubernetes/kubernetes/blob/master/pkg/registry/core/service/rest.go#L553 for the logic on whether it should assign a nodeport for the service.
2017-02-17 20:34:32 -08:00
Kubernetes Submit Queue 112aa327ac Merge pull request #41521 from spiffxp/osx-make-test
Automatic merge from submit-queue (batch tested with PRs 41401, 41195, 41664, 41521, 41651)

Allow `make test` to pass on OSX

**What this PR does / why we need it**: `make test` doesn't pass on my OSX setup (10.11.6, go1.7, docker 1.13.1) on `master`, `release-1.5`, nor `release-1.4`.  Our [docs on unit tests](https://github.com/kubernetes/community/blob/master/contributors/devel/testing.md#unit-tests) say they should always pass on OS X.  This PR allows them to pass.

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

ref: #24717 for the motivation behind dereferencing mount symlinks

/cc @kubernetes/sig-testing-pr-reviews
2017-02-17 19:46:42 -08:00
Kubernetes Submit Queue 97921ff38e Merge pull request #41195 from wojtek-t/remove_default_failure_domains
Automatic merge from submit-queue (batch tested with PRs 41401, 41195, 41664, 41521, 41651)

Remove default failure domains from anti-affinity feature

Removing it is necessary to make performance of this feature acceptable at some point.

With default failure domains (or in general when multiple topology keys are possible), we don't have transitivity between node belonging to a topology. And without this, it's pretty much impossible to solve this effectively.

@timothysc
2017-02-17 19:46:40 -08:00
Kubernetes Submit Queue 5edac4f840 Merge pull request #41401 from wojtek-t/detect_bad_unstructured_conversions
Automatic merge from submit-queue (batch tested with PRs 41401, 41195, 41664, 41521, 41651)

Detect bad unstructured conversions

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

This PR also speed up the conversion:
before:
```
BenchmarkToFromUnstructured-12           	    1000	   1201132 ns/op	   15335 B/op	     268 allocs/op
BenchmarkToFromUnstructuredViaJSON-12    	    1000	   2127384 ns/op	   29669 B/op	     457 allocs/op
```
after:
```
BenchmarkToFromUnstructured-12           	    2000	    911243 ns/op	   10472 B/op	     196 allocs/op
BenchmarkToFromUnstructuredViaJSON-12    	    1000	   2243216 ns/op	   29665 B/op	     457 allocs/op
```
2017-02-17 19:46:38 -08:00
Kubernetes Submit Queue 34bf25fe49 Merge pull request #41524 from Random-Liu/fix-cri-kubemark
Automatic merge from submit-queue

Generate valid container id in fake docker client.

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

This PR generates valid container id by hashing container name. So that dockershim checkpoint won't report `checkpoint key XXX is not valid` error.

This PR also reverts #41460.

@yujuhong @freehan /cc @kubernetes/sig-node-pr-reviews
2017-02-17 17:45:14 -08:00
Jacob Simpson 855627e5cb Rotate the kubelet certificate when about to expire.
Changes the kubelet so it doesn't use the cert/key files directly for
starting the TLS server. Instead the TLS server reads the cert/key from
the new CertificateManager component, which is responsible for
requesting new certificates from the Certificate Signing Request API on
the API Server.
2017-02-17 17:42:35 -08:00
Minhan Xia 4f21b0280d initialize directory while creating checkpoint file store 2017-02-17 16:56:46 -08:00
Kubernetes Submit Queue 7bbafd259c Merge pull request #41626 from derekwaynecarr/improve-kubelet-volume-logging
Automatic merge from submit-queue (batch tested with PRs 41649, 41658, 41266, 41371, 41626)

Understand why kubelet cannot cleanup orphaned pod dirs

**What this PR does / why we need it**:
Understand if we are unable to clean up orphaned pod directories due to a failure to read the directory versus paths still existing to improve ability to debug error situations.
2017-02-17 16:38:41 -08:00
Kubernetes Submit Queue abcff2dfc1 Merge pull request #41371 from jcbsmpsn/split-request-node-certificate
Automatic merge from submit-queue (batch tested with PRs 41649, 41658, 41266, 41371, 41626)

Split request node certificate

Split the `RequestNodeCertificate` function so the behavior can also be used by non-node callers.
2017-02-17 16:38:40 -08:00
Kubernetes Submit Queue b584e9419d Merge pull request #41658 from janetkuo/cronjob-panic
Automatic merge from submit-queue (batch tested with PRs 41649, 41658, 41266, 41371, 41626)

Fix cronjob controller panic on status update failure

#41655

@kubernetes/sig-apps-bugs @soltysh @erictune
2017-02-17 16:38:35 -08:00
juanvallejo a76ed0284b add --ignore-not-found option 2017-02-17 17:40:37 -05:00
Random-Liu ac97fc22f6 Revert #41460. 2017-02-17 14:08:57 -08:00
Random-Liu 201866af20 Small bug fixes in fake docker client. 2017-02-17 14:08:57 -08:00
Kubernetes Submit Queue 56afb95641 Merge pull request #41465 from bruceauyeung/k8s-branch-fix-kubectl-create-configmap-help-messages
Automatic merge from submit-queue

fix kubectl create configmap help messages

Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>

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

1. the first example command actually doesn't specify any keys. i think `with keys for each file` is incorrect.
2. `names on disk` is confusing.  in usage the word `NAME` means configmap, so i think it's better saying `file basenames on disk`
3. in this context, `--from-file` can be specified multiple times, but in each occurance only one key file can be specified, besides we should keep consistent with the later case (key is specified). so i changed words in this sentence to singular. and to avoid confusing, i use `key` instead of `name`
2017-02-17 13:56:36 -08:00
Wojciech Tyczynski 924e9a5b3a Unified unstructured converter interface and setup 2017-02-17 21:07:04 +01:00
Janet Kuo 6753544949 Fix cronjob panic on status update failure 2017-02-17 11:29:39 -08:00
Wojciech Tyczynski edb36d4df7 Minor cleanup in unstructured converter 2017-02-17 18:56:55 +01:00
Andy Goldstein 99313cc394 Switch namespace controller to shared informer 2017-02-17 12:34:27 -05:00
Kubernetes Submit Queue 58ec5cce28 Merge pull request #41355 from ncdc/shared-informers-09-service
Automatic merge from submit-queue

Switch service controller to shared informers

Originally part of #40097 

cc @deads2k @smarterclayton @gmarek @wojtek-t @timothysc @sttts @liggitt @kubernetes/sig-scalability-pr-reviews
2017-02-17 09:04:28 -08:00
Jacob Simpson b9f3e91041 Split `RequestNodeCertificate` function.
Split the `RequestNodeCertificate` function so it can be called with
different arguments.
2017-02-17 07:40:48 -08:00
Kubernetes Submit Queue b2df7e5397 Merge pull request #41547 from xilabao/remove-validNonResourceVerbs-in-create-role
Automatic merge from submit-queue (batch tested with PRs 41604, 41273, 41547)

remove validNonResourceVerbs in create role

non-resource-url is only reasonable for clusterroles
2017-02-17 07:20:39 -08:00
Kubernetes Submit Queue 7da78faf06 Merge pull request #41273 from wongma7/pv-controller-shared
Automatic merge from submit-queue (batch tested with PRs 41604, 41273, 41547)

Switch pv controller to shared informer

This is WIP because I still need to do something with bazel? and add 'get storageclasses' to the controller-manager rbac role

@jsafrane PTAL and make sure I did not break anything in the PV controller. Do we need to clone the volumes/claims we get from the shared informer before we use them? I could not find a place where we modify them but you would know for certain.

cc @ncdc because I copied what you did in your other PRs.
2017-02-17 07:20:35 -08:00
Derek Carr f1b7621f42 kubelet volumes cleanupOrphanedPodDirs does not distinguish error from found volume paths 2017-02-17 09:07:54 -05:00
Kubernetes Submit Queue 22e6bd4c8d Merge pull request #40915 from tanshanshan/api-groupversion-unittest
Automatic merge from submit-queue

Improve code coverage for pkg/api/util

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

Improve code coverage for pkg/api/util .

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-16 23:15:43 -08:00
Kubernetes Submit Queue 1aa0606a81 Merge pull request #41163 from janetkuo/deployment-cleanup
Automatic merge from submit-queue (batch tested with PRs 41517, 41494, 41163)

Deployment: filter out old RSes that are deleted or with non-zero replicas before cleanup

Fixes #36379

cc @zmerlynn @yujuhong @kargakis @kubernetes/sig-apps-bugs
2017-02-16 21:16:04 -08:00
Kubernetes Submit Queue f0b58a7bed Merge pull request #41570 from deads2k/cli-03-tolerate-missing-shortcut
Automatic merge from submit-queue

only construct shortcutmapper when we have the discovery client

Resource shortnames come from the discoveryclient, so we should only wrap with that mapper when we have the information we need.
2017-02-16 19:45:44 -08:00
Random-Liu de922962de Generate valid container id in fake docker client. 2017-02-16 17:10:33 -08:00
Kubernetes Submit Queue 34ffba6cd2 Merge pull request #40726 from humblec/gluster-provclean
Automatic merge from submit-queue (batch tested with PRs 40505, 34664, 37036, 40726, 41595)

Rename provisioner config struct
2017-02-16 17:05:15 -08:00
Kubernetes Submit Queue 98d1cffe05 Merge pull request #37036 from dcbw/docker-gc-teardown-pods
Automatic merge from submit-queue (batch tested with PRs 40505, 34664, 37036, 40726, 41595)

dockertools: call TearDownPod when GC-ing infra pods

The docker runtime doesn't tear down networking when GC-ing pods.
rkt already does so make docker do it too. To ensure this happens,
infra pods are now always GC-ed rather than gating them by
containersToKeep.

This prevents IPAM from leaking when the pod gets killed for
some reason outside kubelet (like docker restart) or when pods
are killed while kubelet isn't running.

Fixes: https://github.com/kubernetes/kubernetes/issues/14940
Related: https://github.com/kubernetes/kubernetes/pull/35572
2017-02-16 17:05:12 -08:00
Kubernetes Submit Queue 4f6b229fdf Merge pull request #34664 from ymqytw/filter_annotation_for_describe_secret
Automatic merge from submit-queue (batch tested with PRs 40505, 34664, 37036, 40726, 41595)

filter lastAppliedConfig annotation for describe secret

Temporarily addresses: #23564.
This patch filters out the lastAppliedConfig annotation when describing a secret.

```release-note
kubectl describe no longer prints the last-applied-configuration annotation for secrets.
```
2017-02-16 17:05:10 -08:00
xilabao 367006bea4 remove validNonResourceVerbs in create role 2017-02-17 08:52:59 +08:00
Kubernetes Submit Queue 9443d85c4b Merge pull request #40505 from brendandburns/i18n5
Automatic merge from submit-queue

Extract strings from the rollout command.

@fabianofranz @kubernetes/sig-cli-pr-reviews
2017-02-16 16:45:32 -08:00
Kubernetes Submit Queue 05c05de798 Merge pull request #41569 from yujuhong/add_healthcheck
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

Report node not ready on failed PLEG health check

Report node not ready if PLEG health check fails.
2017-02-16 15:49:18 -08:00
Kubernetes Submit Queue 6376ad134d Merge pull request #39606 from NickrenREN/kubelet-pod
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

optimize killPod() and syncPod() functions

make sure that one of the two arguments must be non-nil: runningPod, status ,just like the function note says
and judge the return value in syncPod() function before setting podKilled
2017-02-16 15:49:17 -08:00
Kubernetes Submit Queue 4515f72824 Merge pull request #38101 from CaoShuFeng/haripin_nsenter
Automatic merge from submit-queue (batch tested with PRs 38101, 41431, 39606, 41569, 41509)

[hairpin] fix argument of nsenter

**Release note**:

```release-note
None
```

We should use:
	nsenter --net=netnsPath -- -F some_command
instend of:
	nsenter -n netnsPath -- -F some_command
Because "nsenter -n netnsPath" get an error output:
	# nsenter -n /proc/67197/ns/net ip addr
	nsenter: neither filename nor target pid supplied for ns/net

If we really want use -n, we need to use -n in such format:
	# sudo nsenter -n/proc/67197/ns/net ip addr
2017-02-16 15:49:10 -08:00
Anthony Yeh 70bd5fdfe5 Refactor ControllerRefManager
To prepare for implementing ControllerRef across all controllers,
this pushes the common adopt/orphan logic into ControllerRefManager
so each controller doesn't have to duplicate it.

This also shares the adopt/orphan logic between Pods and ReplicaSets,
so it lives in only one place.
2017-02-16 15:09:17 -08:00
Janet Kuo a265186aaa Deployment: filter out old RSes that are deleted or with non-zero replicas before cleanup 2017-02-16 14:48:10 -08:00
Kubernetes Submit Queue 4ac2749af6 Merge pull request #41022 from thockin/proxy-defer-on-update-events
Automatic merge from submit-queue (batch tested with PRs 41505, 41484, 41544, 41514, 41022)

Proxy defer on update events

This PR is a series of discrete movements in refactoring some of kube-proxy's twistier code in prep to be more async.  It should be reviewed one commit at a time.  Each commit is a smallish movement, which should be easier to examine.  I added significant tests along the way, which, unsurprisingly, found some bugs.
2017-02-16 14:28:24 -08:00
Kubernetes Submit Queue f2888c0a30 Merge pull request #41544 from sttts/sttts-core-group-announce-registered
Automatic merge from submit-queue (batch tested with PRs 41505, 41484, 41544, 41514, 41022)

pkg/api/install: use apimachinery/announce+registered

Make core group a little bit less special.
2017-02-16 14:28:19 -08:00
Solly Ross 7846827fc0 Convert HPA controller to use autoscaling/v2alpha1
This commit converts the HPA controller over to using the new version of
the HorizontalPodAutoscaler object found in autoscaling/v2alpha1.  Note
that while the autoscaler will accept requests for object metrics, the
scale client will return an error on attempts to get object metrics
(since that requires the new custom metrics API, which is not yet
implemented).

This also enables the HPA object in v2alpha1 as a retrievable API
version by default.
2017-02-16 15:03:14 -05:00
Dan Williams 20e1cdb97c dockertools: tear down dead infra containers in SyncPod()
Dead infra containers may still have network resources allocated to
them and may not be GC-ed for a long time.  But allowing SyncPod()
to restart an infra container before the old one is destroyed
prevents network plugins from carrying the old network details
(eg IPAM) over to the new infra container.
2017-02-16 13:51:19 -06:00
Dan Williams 4d7d7faa81 dockertools: clean up networking when garbage-collecting pods
The docker runtime doesn't tear down networking when GC-ing pods.
rkt already does so make docker do it too. To ensure this happens,
networking is always torn down for the container even if the
container itself is not deleted.

This prevents IPAM from leaking when the pod gets killed for
some reason outside kubelet (like docker restart) or when pods
are killed while kubelet isn't running.

Fixes: https://github.com/kubernetes/kubernetes/issues/14940
Related: https://github.com/kubernetes/kubernetes/pull/35572
2017-02-16 13:51:19 -06:00
Dan Williams dc2fd511ab dockertools: use network PluginManager to synchronize pod network operations
We need to tear down networking when garbage collecting containers too,
and GC is run from a different goroutine in kubelet.  We don't want
container network operations running for the same pod concurrently.
2017-02-16 13:51:19 -06:00
Dan Williams 4c3cc67385 rkt: use network PluginManager to synchronize pod network operations 2017-02-16 13:51:19 -06:00
Dan Williams aafd5c9ef6 dockershim: use network PluginManager to synchronize pod network operations 2017-02-16 13:51:19 -06:00
Dan Williams 60525801c1 kubelet/network: move mock network plugin to pkg/kubelet/network/testing 2017-02-16 13:48:32 -06:00
Dan Williams 5633d7423a kubelet: add network plugin manager with per-pod operation locking
The PluginManager almost duplicates the network plugin interface, but
not quite since the Init() function should be called by whatever
actually finds and creates the network plugin instance.  Only then
does it get passed off to the PluginManager.

The Manager synchronizes pod-specific network operations like setup,
teardown, and pod network status.  It passes through all other
operations so that runtimes don't have to cache the network plugin
directly, but can use the PluginManager as a wrapper.
2017-02-16 13:48:32 -06:00
deads2k d3da1d102d deprecate and disconnect --output-version 2017-02-16 13:23:59 -05:00
Kubernetes Submit Queue 3c606cdd20 Merge pull request #41456 from dashpole/pod_volume_cleanup
Automatic merge from submit-queue (batch tested with PRs 41466, 41456, 41550, 41238, 41416)

Delay Deletion of a Pod until volumes are cleaned up

#41436 fixed the bug that caused #41095 and #40239 to have to be reverted.  Now that the bug is fixed, this shouldn't cause problems.

 @vishh @derekwaynecarr @sjenning @jingxu97 @kubernetes/sig-storage-misc
2017-02-16 10:14:05 -08:00
Yu-Ju Hong 5bb43a3a24 Report node not ready on failed PLEG health check 2017-02-16 09:00:22 -08:00
deads2k 9b5acdbb88 only construct shortcutmapper when we have the discovery client 2017-02-16 11:38:52 -05:00
Kubernetes Submit Queue f07112f78a Merge pull request #41461 from humblec/humble-reviewer
Automatic merge from submit-queue

Updating reviewer list.
2017-02-16 08:33:12 -08:00
Matthew Wong 33f98d4db3 Switch pv controller to shared informers 2017-02-16 10:08:23 -05:00
Shyam JVS 2ed7acfbcc Revert "Remove alpha provisioning" 2017-02-16 13:53:55 +01:00
Wojciech Tyczynski 3de7195cf8 Remove default failure domains from anti-affinity feature 2017-02-16 13:32:34 +01:00
Kubernetes Submit Queue 8ecc256e88 Merge pull request #41014 from gmarek/promote_helpers
Automatic merge from submit-queue

Promote taint helpers from e2e/framework to util/taints

cc @kevin-wangzefeng
2017-02-16 02:43:27 -08:00
Dr. Stefan Schimanski 9156981e73 pkg/api/install: use apimachinery/announce+registered 2017-02-16 11:20:43 +01:00
Kubernetes Submit Queue 8faa9b5d4e Merge pull request #40000 from jsafrane/storage-ga-remove-alpha
Automatic merge from submit-queue

Remove alpha provisioning

This is the first part of https://github.com/kubernetes/features/issues/36

@kubernetes/sig-storage-misc 

**Release note**:
```release-note
Alpha version of dynamic volume provisioning is removed in this release. Annotation
"volume.alpha.kubernetes.io/storage-class" does not have any special meaning. A default storage class
and  DefaultStorageClass admission plugin can be used to preserve similar behavior of Kubernetes cluster,
see https://kubernetes.io/docs/user-guide/persistent-volumes/#class-1 for details.
```
2017-02-16 01:02:06 -08:00
gmarek 6b20bb790f generated 2017-02-16 09:25:27 +01:00
gmarek e1e4370ecd Promote taint addition/removal to api/v1/helpers.go 2017-02-16 09:25:27 +01:00
Kubernetes Submit Queue df4e69bb3b Merge pull request #36718 from k82cn/filed_err_msg
Automatic merge from submit-queue

Replace raw string with const var.

Replace raw string with const string var.
2017-02-16 00:12:15 -08:00
Kubernetes Submit Queue 11bf535e03 Merge pull request #41434 from freehan/cri-kubenet-error
Automatic merge from submit-queue (batch tested with PRs 41531, 40417, 41434)

[CRI] beef up network teardown in  StopPodSandbox

1. Added CheckpointNotFound error to allow dockershim to conduct error handling
2. Retry network teardown if failed

ref: https://github.com/kubernetes/kubernetes/issues/41225
2017-02-15 23:01:09 -08:00
Kubernetes Submit Queue ddf4a0cad5 Merge pull request #40417 from jsravn/fix-reconciler-external-updates-race
Automatic merge from submit-queue (batch tested with PRs 41531, 40417, 41434)

Always detach volumes in operator executor

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

Instead of marking a volume as detached immediately in Kubelet's
reconciler, delegate the marking asynchronously to the operator
executor. This is necessary to prevent race conditions with other
operations mutating the same volume state.

An example of one such problem:

1. pod is created, volume is added to desired state of the world
2. reconciler process starts
3. reconciler starts MountVolume, which is kicked off asynchronously via
   operation_executor.go
4. MountVolume mounts the volume, but hasn't yet marked it as mounted
5. pod is deleted, volume is removed from desired state of the world
6. reconciler reaches detach volume section, detects volume is no longer in desired state of world,
   removes it from volumes in use
7. MountVolume tries to mark mount, throws an error because
   volume is no longer in actual state of world list. After this, kubelet isn't aware of the mount
   so doesn't try to unmount again.
8. controller-manager tries to detach the volume, this fails because it
   is still mounted to the OS.
9. EBS gets stuck indefinitely in busy state trying to detach.



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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-15 23:01:07 -08:00
Kubernetes Submit Queue 2a7c50add6 Merge pull request #41311 from gmarek/taints-comments
Automatic merge from submit-queue

Apply davidopps comments to TaintController PR

Fix #41318

cc @timothysc @kevin-wangzefeng
2017-02-15 21:38:09 -08:00
Kubernetes Submit Queue 84bab780d6 Merge pull request #41425 from ncdc/shared-informers-10-serviceaccount
Automatic merge from submit-queue

Switch serviceaccounts controller to generated shared informers

Originally part of #40097 

cc @deads2k @sttts @liggitt @smarterclayton @gmarek @wojtek-t @timothysc @kubernetes/sig-scalability-pr-reviews
2017-02-15 20:54:17 -08:00
Kubernetes Submit Queue 97212f5b3a Merge pull request #37953 from liggitt/automount
Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953)

Add field to control service account token automounting

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

* adds an `automountServiceAccountToken *bool` field to `ServiceAccount` and `PodSpec`
* if set in both the service account and pod, the pod wins
* if unset in both the service account and pod, we automount for backwards compatibility

```release-note
An `automountServiceAccountToken *bool` field was added to ServiceAccount and PodSpec objects. If set to `false` on a pod spec, no service account token is automounted in the pod. If set to `false` on a service account, no service account token is automounted for that service account unless explicitly overridden in the pod spec.
```
2017-02-15 20:05:13 -08:00
Kubernetes Submit Queue 6823803772 Merge pull request #41239 from vmware/e2eTestsUpdate-v2
Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953)

e2e test for storage class diskformat verification for vsphere cloud provider

**What this PR does / why we need it**:
This PR adds a new e2e test for vsphere cloud provider.
Test is to verify diskformat specified in storage-class is being honored while volume creation.

Steps:

1. Create StorageClass with diskformat set to valid type (supported options are `eagerzeroedthick`, `zeroedthick` and `thin`)
2. Create PVC which uses the StorageClass created in step 1.
3. Wait for PV to be provisioned.
4. Wait for PVC's status to become Bound
5. Create POD using PVC on specific node.
6. Wait for Disk to be attached to the node.
7. Get node VM's devices and find PV's Volume Disk.
8. Get Backing Info of the Volume Disk and obtain Property of `VirtualDiskFlatVer2BackingInfo` - `EagerlyScrub` and `ThinProvisioned`
9. Based on the value of `EagerlyScrub` and `ThinProvisioned`, verify if diskformat is correct.
10. Delete POD and Wait for Volume Disk to be detached from the Node.
11. Delete PVC, PV and Storage Class



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

**Special notes for your reviewer**:
Test is executed against v1.6.0-alpha.1
Test is failing on v1.4.8

**Release Note**
```release-note
NONE
```
@kerneltime @BaluDontu @abrarshivani please review this PR
2017-02-15 20:05:09 -08:00
Alejandro Escobar 024d750370 making log statement clearer. 2017-02-15 19:49:52 -08:00
NickrenREN b40e575076 optimize killPod() and syncPod() functions
make sure that one of the two arguments must be non-nil: runningPod, status ,just like the function note says
and judge the return value in syncPod() function before setting podKilled
2017-02-16 09:13:23 +08:00
Kubernetes Submit Queue 92360ffc5f Merge pull request #41439 from deads2k/apiserver-12-sample-fuzz
Automatic merge from submit-queue (batch tested with PRs 41104, 41245, 40722, 41439, 41502)

add sample fuzzing tests

Make fuzzing tests as simple as possible from both the API installer and the scheme, so its easy to add for api groups and so that I can build a scheme and then make sure I got it right.

@kubernetes/sig-api-machinery-pr-reviews @sttts @mikedanese
2017-02-15 16:28:11 -08:00
Aaron Crickenberger ddc8d8c400 fix FakeMounter to work with OSX
OSX 10.11.x has `/var` symlinked to `/private/var`, which was tripping
up logic in `mount.GetMountRefs`

This fixes unit tests for pkg/volume/fc and pkg/volume/iscsi
2017-02-15 16:14:33 -08:00
Kubernetes Submit Queue d60d8a7b92 Merge pull request #41104 from apprenda/kubeadm_client-go_move
Automatic merge from submit-queue

kubeadm: Migrate to client-go

**What this PR does / why we need it**: Finish the migration for kubeadm to use client-go wherever possible

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

**Special notes for your reviewer**: /cc @luxas @pires 

**Release note**:
```release-note
NONE
```
2017-02-15 16:01:22 -08:00
Kubernetes Submit Queue a1afc024cb Merge pull request #34931 from nhlfr/cadvisor-container-info-table
Automatic merge from submit-queue

kubelet: Make cadvisor GetContainerInfo tests table driven
2017-02-15 15:14:28 -08:00
Kubernetes Submit Queue e73e25422f Merge pull request #40907 from cblecker/clientgo-pem-functions
Automatic merge from submit-queue

Move private key parsing from serviceaccount/jwt.go to client-go/util/cert

**What this PR does / why we need it**:
Unify private key parsing from serviceaccount/jwt.go into the client-go library.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:
Partial fix to #40807 - only private key functions.

**Special notes for your reviewer**:

**Release note**:

```release-note
Move private key parsing from serviceaccount/jwt.go to client-go/util/cert
```
2017-02-15 14:26:34 -08:00
Derek McQuay 70e7d64b46 kubeadm: moved import to client-go, where possible
Some imports dont exist yet (or so it seems) in client-go (examples
being:

  - "k8s.io/kubernetes/pkg/api/validation"
  - "k8s.io/kubernetes/pkg/util/initsystem"
  - "k8s.io/kubernetes/pkg/util/node"

one change in kubelet to import to client-go
2017-02-15 13:06:15 -08:00
Jordan Liggitt 0c9fd4fbe7
generated files 2017-02-15 16:04:10 -05:00
Jordan Liggitt 0d6e877de2
Add automountServiceAccountToken field to PodSpec and ServiceAccount types 2017-02-15 16:04:09 -05:00
Kubernetes Submit Queue 3bc575c91f Merge pull request #33550 from rtreffer/kubelet-allow-multiple-dns-server
Automatic merge from submit-queue

Allow multipe DNS servers as comma-seperated argument for kubelet --dns

This PR explores how kubectls "--dns" could be extended to specify multiple DNS servers for in-cluster PODs. Testing on the local libvirt-coreos cluster shows that multiple DNS server are injected without issues.

Specifying multiple DNS servers increases resilience against
- Packet drops
- Single server failure

I am debugging services that do 50+ DNS requests for a single incoming interactive request, thus highly increase the chance of a slowdown (+5s) due to a single packet drop. Switching to two DNS servers will reduce the impact of the issues (roughly +1s on glibc, 0s on musl, error-rate goes down to error-rate^2).

Note that there is no need to change any runtime related code as far as I know. In the case of "default" dns the /etc/resolv.conf is parsed and multiple DNS server are send to the backend anyway. This only adds the same capability for the clusterFirst case.

I've heard from @thockin that multiple DNS entries are somehow considered. I've no idea what was considered, though. This is what I would like to see for our production use, though.

```release-note
NONE
```
2017-02-15 12:45:32 -08:00
Tim Hockin 1ce3395e7f Simplify stale-connection detection in kube-proxy 2017-02-15 12:39:49 -08:00
Kubernetes Submit Queue 1ad5cea24e Merge pull request #41261 from ncdc/shared-informers-07-resourcequota
Automatic merge from submit-queue

Switch resourcequota controller to shared informers

Originally part of #40097 

I have had some issues with this change in the past, when I updated `pkg/quota` to use the new informers while `pkg/controller/resourcequota` remained on the old informers. In this PR, both are switched to using the new informers. The issues in the past were lots of flakey test failures in the ResourceQuota e2es, where it would randomly fail to see deletions and handle replenishment. I am hoping that now that everything here is consistently using the new informers, there won't be any more of these flakes, but it's something to keep an eye out for.

I also think `pkg/controller/resourcequota` could be cleaned up. I don't think there's really any need for `replenishment_controller.go` any more since it's no longer running individual controllers per kind to replenish. It instead just uses the shared informer and adds event handlers to it. But maybe we do that in a follow up.

cc @derekwaynecarr @smarterclayton @wojtek-t @deads2k @sttts @liggitt @timothysc @kubernetes/sig-scalability-pr-reviews
2017-02-15 11:37:04 -08:00
Tim Hockin 7046c7efcb Prep to move guts of OnEnpointsUpdate to sync
This makes it more obvious that they run together and makes the upcoming
rate-limited syncs easier.

Also make test use ints for ports, so it's easier to see when a port is
a literal value vs a name.
2017-02-15 10:37:05 -08:00
Tim Hockin cddda17d42 Make healthcheck an interface 2017-02-15 10:37:05 -08:00
Tim Hockin 6069d49d49 Add tests for updateEndpoints 2017-02-15 10:37:05 -08:00
Tim Hockin 8d24fc3984 Simplify maps which had almost the exact same info 2017-02-15 10:37:05 -08:00
Tim Hockin 48ea304711 Sanitize newEndpoints semantics, remove a dup arg 2017-02-15 10:37:05 -08:00
Tim Hockin 9507af3c79 Refactor OnEndpointsUpdate for testing
This is a weird function, but I didn't want to change any semantics
until the tests are in place.  Testing exposed one bug where stale
connections of renamed ports were not marked stale.

There are other things that seem wrong here, more will follow.
2017-02-15 10:37:05 -08:00
Tim Hockin d578105a44 Simple cleanup before refactoring 2017-02-15 10:37:05 -08:00
Tim Hockin 1c180e0865 Simplify "is local" detection
Move the feature test to where we are activating the feature, rather
than where we detect locality.  This is in service of better tests,
which is in service of less-frequent resyncing, which is going to
require refactoring.
2017-02-15 10:37:05 -08:00
Minhan Xia 4ca2642dd3 update bazel 2017-02-15 10:06:49 -08:00
Minhan Xia 3cc837878f retry StopPodSandbox on Network teardown failure 2017-02-15 10:06:41 -08:00
Kubernetes Submit Queue fbc94c0896 Merge pull request #41343 from p0lyn0mial/kubectl_get_short_names_from_discovery_api
Automatic merge from submit-queue

shortcut expander will take the list of short names from the api ser…

**What this PR does / why we need it**: the shortcut expander will take the list of short names for resources from the API server during the discovery. For backward compatibility a hardcoded list of short names will always be appended while evaluating a short name.
2017-02-15 09:07:51 -08:00
David Ashpole 1d38818326 Revert "Merge pull request #41202 from dashpole/revert-41095-deletion_pod_lifecycle"
This reverts commit ff87d13b2c, reversing
changes made to 46becf2c81.
2017-02-15 08:44:03 -08:00
Andy Goldstein 726f18524b Switch service controller to shared informers 2017-02-15 11:21:01 -05:00
deads2k 2d5fe9d855 add sample fuzzing tests 2017-02-15 10:34:44 -05:00
Michal Rostecki 4ed087e01f kubelet: Make cadvisor GetContainerInfo tests table driven 2017-02-15 16:15:21 +01:00
Kubernetes Submit Queue 17e745631a Merge pull request #41455 from gnufied/fix-aws-device-allocator
Automatic merge from submit-queue

Fix AWS device allocator to only use valid device names

According to
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
we can only use /dev/xvd[b-c][a-z] as device names - so we can only
allocate upto 52 ebs volumes on a node.

fixes #41453 

cc @justinsb  @kubernetes/sig-storage-pr-reviews
2017-02-15 06:47:07 -08:00
Kubernetes Submit Queue 61ec96781b Merge pull request #41313 from sttts/sttts-apiserver-server-storage
Automatic merge from submit-queue (batch tested with PRs 41134, 41410, 40177, 41049, 41313)

apiserver: further cleanup of apiserver storage plumbing

- move kubeapiserver`s `RESTOptionsFactory` back to EtcdOptions by adding a `AddWithStorageFactoryTo`
- factor out storage backend `Config` construction from EtcdOptions
- move all `StorageFactory` related code into server/storage subpackage.

In short: remove my stomach ache about `kubeapiserver.RESTOptionsFactory`.

approved based on #40363
2017-02-15 05:58:32 -08:00
Kubernetes Submit Queue 66529d51ba Merge pull request #41352 from mikedanese/testapi-kubeadm
Automatic merge from submit-queue (batch tested with PRs 41360, 41423, 41430, 40647, 41352)

move kubeadm api group testing to kubeadm package

I think this is sufficient to at least preserve round trip testing.
2017-02-15 05:06:13 -08:00
Kubernetes Submit Queue dd696683b7 Merge pull request #40647 from NickrenREN/secretManager
Automatic merge from submit-queue (batch tested with PRs 41360, 41423, 41430, 40647, 41352)

optimize NewSimpleSecretManager and cleanupOrphanedPodCgroups
2017-02-15 05:06:11 -08:00
Kubernetes Submit Queue d47ffa08c7 Merge pull request #41423 from yujuhong/better_logging
Automatic merge from submit-queue (batch tested with PRs 41360, 41423, 41430, 40647, 41352)

kubelet: reduce extraneous logging for pods using host network

For pods using the host network, kubelet/shim should not log
error/warning messages when determining the pod IP address.
2017-02-15 05:06:08 -08:00
Kubernetes Submit Queue 3a6fa67f59 Merge pull request #39179 from NickrenREN/killpod
Automatic merge from submit-queue (batch tested with PRs 41196, 41252, 41300, 39179, 41449)

record ReduceCPULimits result err info if err returned

record ReduceCPULimits result err info if err returned for debug
2017-02-15 04:14:15 -08:00
Kubernetes Submit Queue b3a34af30f Merge pull request #41300 from kargakis/minor-fixes
Automatic merge from submit-queue (batch tested with PRs 41196, 41252, 41300, 39179, 41449)

controller: cleanup workload controllers a bit

* Switches glog.Errorf to utilruntime.HandleError in DS and RC controllers
* Drops a couple of unused variables in the DS, SS, and Deployment controllers
* Updates some comments

@kubernetes/sig-apps-misc
2017-02-15 04:14:14 -08:00
Kubernetes Submit Queue beed2ea460 Merge pull request #41252 from kargakis/drop-unnecessary-helper
Automatic merge from submit-queue (batch tested with PRs 41196, 41252, 41300, 39179, 41449)

Remove redundant pod helper
2017-02-15 04:14:12 -08:00
Kubernetes Submit Queue a50ea2fc37 Merge pull request #41196 from bigstepinc/master
Automatic merge from submit-queue

Fix for Premature iSCSI logout #39202.

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

Modifies the iSCSI volume plugin code to prevent premature iSCSI logouts and the establishment of multiple iSCSI connections to the same target in certain cases.

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

**Special notes for your reviewer**:

The existing iSCSI connections are now rescanned on every AttachDisk call to discover newly created LUNs.

The disk mount points now contain an additional directory in the path corresponding to the disk iface that is later used for iSCSI logout.

The device prefixes that are used to count the existing references to the portal-target pair now contain the whole path including the mount point until the lun index.

**Release note**:
```release-note
Fixed issues #39202, #41041 and #40941 that caused the iSCSI connections to be prematurely closed when deleting a pod with an iSCSI persistent volume attached and that prevented the use of newly created LUNs on targets with preestablished connections.
```
2017-02-15 04:11:55 -08:00
Kubernetes Submit Queue eab039d746 Merge pull request #39735 from NickrenREN/openstack-code-optimize
Automatic merge from submit-queue (batch tested with PRs 40297, 41285, 41211, 41243, 39735)

fix variables in openstack.go to keep camel casing and remove unused var
2017-02-15 03:25:16 -08:00
Kubernetes Submit Queue 438054f52f Merge pull request #40297 from resouer/fix-hash
Automatic merge from submit-queue (batch tested with PRs 40297, 41285, 41211, 41243, 39735)

Use fnv.New32a() in hash instead adler32

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

Benchmark results: https://github.com/kubernetes/kubernetes/pull/39527

NOTE: I leave  `GetPodTemplateSpecHash` as it is since we have unit test to test its un-normal behaviour.
2017-02-15 03:25:08 -08:00
gmarek 5fbb966e3e generated 2017-02-15 12:20:24 +01:00
gmarek 3c555f2ca4 apply comments 2017-02-15 12:20:24 +01:00
Dr. Stefan Schimanski 0e9c1f75bf Update bazel 2017-02-15 10:25:15 +01:00
Dr. Stefan Schimanski 5e77d01897 k8s.io/apiserver: straighten EtcdOptions, backend Config and kube RESTOptionsFactory 2017-02-15 10:24:59 +01:00
Dr. Stefan Schimanski 27e01b5c46 k8s.io/apiserver: fixup imports and renamed packages 2017-02-15 10:24:58 +01:00
bruceauyeung a410a63dc7 fix kubectl create configmap help messages
Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
2017-02-15 16:57:38 +08:00
gmarek de6c9bd535 Apply davidopps comments to TaintController PR 2017-02-15 09:37:26 +01:00
p0lyn0mial 98068b6367 shortcut expander will take the list of short names from the api server. 2017-02-15 09:06:47 +01:00
Humble Chirammal 5b1aa04ccc Updating reviewer list.
Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
2017-02-15 13:19:51 +05:30
Wojciech Tyczynski 65cfd86c89 Merge pull request #41460 from yujuhong/fix_kubemark
Disable CRI in hollow-node
2017-02-15 08:28:32 +01:00
Yu-Ju Hong 5e7972f423 Disable CRI in hollow-node
Some parts of the new dockershim are not properly mocked out in the
hollow-node. Disabling CRI in the hollow node until a proper fix is put
in.
2017-02-14 22:43:36 -08:00
Harry Zhang 3bdc3f25ec Use fnv.New32a() in hash instead adler32 2017-02-15 14:03:54 +08:00
divyenpatel cdb48fb6a0 adding e2e test for storage class diskformat verification
adding govmomi dep to test/e2e/BUILD
adding golang.org/x/net/context to e2e deps
addressed review comments
addressed 2nd round of review comments

addressed review comments regarding KubeDescribe tagging
2017-02-14 21:08:53 -08:00
Kubernetes Submit Queue a57967f47b Merge pull request #41436 from dashpole/status_bug
Automatic merge from submit-queue

Fix bug in status manager TerminatePod

In TerminatePod, we previously pass pod.Status to updateStatusInternal.  This is a bug, since it is the original status that we are given.  Not only does it skip updates made to container statuses, but in some cases it reverted the pod's status to an earlier version, since it was being passed a stale status initially.

This was the case in #40239 and #41095.  As shown in #40239, the pod's status is set to running after it is set to failed, occasionally causing very long delays in pod deletion since we have to wait for this to be corrected.

This PR fixes the bug, adds some helpful debugging statements, and adds a unit test for TerminatePod (which for some reason didnt exist before?).

@kubernetes/sig-node-bugs @vish @Random-Liu
2017-02-14 21:03:31 -08:00
Kubernetes Submit Queue a197fbdf2d Merge pull request #40912 from yu-song/fix_comment
Automatic merge from submit-queue

Fix comment for method SetForTests

cc @dchen1107
2017-02-14 20:13:36 -08:00
Kubernetes Submit Queue 4faa1e4913 Merge pull request #41385 from luxas/extend_token_bootstrap
Automatic merge from submit-queue (batch tested with PRs 41378, 41413, 40743, 41155, 41385)

Expose the constants in pkg/controller/bootstrap and add a validate token function

**What this PR does / why we need it**: In order to hook up #36101 against kubeadm, we have to expose the constants and add a function to validate the token

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
cc @jbeda @mikedanese @pires @dmmcquay
2017-02-14 19:54:15 -08:00
Kubernetes Submit Queue ef042450fd Merge pull request #41155 from liggitt/reconcile
Automatic merge from submit-queue (batch tested with PRs 41378, 41413, 40743, 41155, 41385)

Reconcile bootstrap clusterroles on server start

Currently, on server start, bootstrap roles and bindings are only created if there are no existing roles or rolebindings.

Instead, we should look at each bootstrap role and rolebinding, and ensure it exists and has required permissions and subjects at server start. This allows seamless upgrades to new versions that define roles for new controllers, or add permissions to existing roles.

```release-note
Default RBAC ClusterRole and ClusterRoleBinding objects are automatically updated at server start to add missing permissions and subjects (extra permissions and subjects are left in place). To prevent autoupdating a particular role or rolebinding, annotate it with `rbac.authorization.kubernetes.io/autoupdate=false`.
```
2017-02-14 19:54:14 -08:00
Hemant Kumar 73370239d2 Fix AWS device allocator to only use valid device names
According to
http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/device_naming.html
we can only use /dev/xvd[b-c][a-z] as device names - so we can only
allocate upto 52 ebs volumes on a node.
2017-02-14 22:33:26 -05:00
Kubernetes Submit Queue c485e76fe0 Merge pull request #41378 from yujuhong/enable_cri
Automatic merge from submit-queue

Make EnableCRI default to true

This change makes kubelet to use the CRI implementation by default,
unless the users opt out explicitly by using --enable-cri=false.
For the rkt integration, the --enable-cri flag will have no effect
since rktnetes does not use CRI.

Also, mark the original --experimental-cri flag hidden and deprecated,
so that we can remove it in the next release. If both flags are specified,
the --enable-cri flag overrides the --experimental-cri flag.
2017-02-14 19:22:36 -08:00
Kubernetes Submit Queue cf10f532d1 Merge pull request #41304 from liggitt/edit-refactor
Automatic merge from submit-queue

Make kubectl edit work with unstructured objects

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


1. First (before any other changes), added several test cases for complex edit scenarios:
   - [x] ensure the edit loop bails out if given the same result that already caused errors
   - [x] ensure an edited file with a syntax error is reopened preserving the input
   - [x] ensure objects with existing "caused-by" annotations get updated with the current command

2. Refactored the edit code to prep for switching to unstructured:
   - [x] made editFn operate on a slice of resource.Info objects passed as an arg, regardless of edit mode
   - [x] simplified short-circuiting logic when re-editing a file containing an error
   - [x] refactored how we build the various visitors (namespace enforcement, annotation application, patching, creating) so we could easily switch to just using a single visitor over a set of resource infos read from the updated input for all of them

3. Switched to using a resource builder to parse the stream of the user's edited output
   - [x] improve the error message you get on syntax errors
   - [x] preserve the user's input more faithfully (see how the captured testcase requests to the server changed to reflect exactly what the user edited)
   - [x] stopped doing client-side conversion (means deprecating `--output-version`)

4. Switched edit to work with generic objects
   - [x] use unstructured objects
   - [x] fall back to generic json merge patch for unrecognized group/version/kinds

5. Added new test cases
   - [x] schemaless objects falls back to generic json merge (covers TPR scenario)
   - [x] edit unknown version of known kind (version "v0" of storageclass) falls back to generic json merge

```release-note
`kubectl edit` now edits objects exactly as they were retrieved from the API. This allows using `kubectl edit` with third-party resources and extension API servers. Because client-side conversion is no longer done, the `--output-version` option is deprecated for `kubectl edit`. To edit using a particular API version, fully-qualify the resource, version, and group used to fetch the object (for example, `job.v1.batch/myjob`)
```
2017-02-14 18:34:30 -08:00
Minhan Xia 012acad32e add CheckpointNotFound error 2017-02-14 16:55:51 -08:00
Kubernetes Submit Queue fe4a254a70 Merge pull request #41176 from tanshanshan/fix-little2
Automatic merge from submit-queue

fix comment 

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

fix comment 

Thanks.

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-02-14 16:41:45 -08:00
Yu-Ju Hong fb94f441ce Set EnableCRI to true by default
This change makes kubelet to use the CRI implementation by default,
unless the users opt out explicitly by using --enable-cri=false.
For the rkt integration, the --enable-cri flag will have no effect
since rktnetes does not use CRI.

Also, mark the original --experimental-cri flag hidden and deprecated,
so that we can remove it in the next release.
2017-02-14 16:15:51 -08:00
Yu-Ju Hong 77286c38d3 kubelet: reduce extraneous logging for pods using host network
For pods using the host network, kubelet/shim should not log
error/warning messages when determining the pod IP address.
2017-02-14 16:09:42 -08:00
Mike Danese ad42b42949 move kubeadm api group testing to kubeadm package 2017-02-14 16:02:13 -08:00
Alejandro Escobar 5d71eb4b05 added log message to capture that log handlers have been turned on. 2017-02-14 14:58:59 -08:00
David Ashpole c612e09acd use the status we modify, not original 2017-02-14 13:36:20 -08:00
Kubernetes Submit Queue 7332baf9a3 Merge pull request #39636 from liggitt/proxy-subresource
Automatic merge from submit-queue (batch tested with PRs 41382, 41407, 41409, 41296, 39636)

Update to use proxy subresource consistently

Proxy subresources have been in place since 1.2.0 and improve the ability to put policy in place around proxy access.

This PR updates the last few clients to use proxy subresources rather than the root proxy
2017-02-14 13:04:33 -08:00
Cristian Pop b23b475498 Implemented suggestions for #39202 fix to facilitate kubelet upgrade. The detachDisk behavior is now preserved for pods that were created before the kubelet upgrade. 2017-02-14 22:50:26 +02:00
Kubernetes Submit Queue a97513c1af Merge pull request #41382 from yujuhong/restart_created
Automatic merge from submit-queue

kubelet: handle containers in the "created" state
2017-02-14 12:00:27 -08:00
Jordan Liggitt ec271f5c09
Switch 'kubectl edit' to use unstructured objects, handle schemaless objects
mark --output-version as deprecated, add example for fully-qualifying version to edit

Add 'kubectl edit' testcase for editing schemaed and schemaless data together

Add 'kubectl edit' testcase for editing unknown version of known group/kind
2017-02-14 14:55:02 -05:00
Jordan Liggitt 5b805bc18a
Simplify 'kubectl edit' logic
edit: make editFn operate on arguments regardless of mode

edit: simplify short-circuiting logic when re-editing a file containing an error

edit: factor out visitor building

edit: use resource builder to get results from edited file
2017-02-14 14:51:06 -05:00
Jordan Liggitt f86db18297
Add advanced 'kubectl edit' test scenarios
Add 'kubectl edit' testcase for saving a repeated error

Add 'kubectl edit' testcase for preserving an edited file with a syntax error

Add 'kubectl edit' testcase for recording command on list of objects
2017-02-14 14:50:45 -05:00
Kubernetes Submit Queue 3604cdc6a9 Merge pull request #41418 from deads2k/api-02-conversions
Automatic merge from submit-queue (batch tested with PRs 41299, 41325, 41386, 41329, 41418)

move metav1 conversions to metav1

Conversions for `metav1` types belong in metav1 and should be registered when you register the types.

@mikedanese @luxas I think this is what you just hit in your fresh scheme.

@smarterclayton @lavalamp double check the sanity, but I think this does what people expect.
2017-02-14 11:42:40 -08:00
Kubernetes Submit Queue f26890b801 Merge pull request #41329 from deads2k/cli-02-negotiation
Automatic merge from submit-queue (batch tested with PRs 41299, 41325, 41386, 41329, 41418)

stop senseless negotiation

Most client commands don't respect a negotiated version at all.  If you request a particular version, then of course it should be respected, but if you have none to request, then the current negotiation step doesn't return anything useful so we may as well have nothing so we can at least detect the situation.

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

Added a TODO to make the negotiate function useful.  I think I'm inclined to remove it entirely unless someone can come up with a useful reason to have it.
2017-02-14 11:42:38 -08:00
Andy Goldstein 65fe722643 Switch serviceaccounts controller to generated shared informers 2017-02-14 14:21:14 -05:00
Lucas Käldström 4940c32c39
Expose the constants in pkg/controller/bootstrap and add a validate token method 2017-02-14 20:29:23 +02:00
Jordan Liggitt 26b42d350d
Reconcile bootstrap clusterroles on server start 2017-02-14 12:33:05 -05:00
Andy Goldstein d820e3928c Switch resourcequota controller to shared informers 2017-02-14 12:20:27 -05:00
Kubernetes Submit Queue 16a0a0b975 Merge pull request #41034 from rootfs/gce-instance
Automatic merge from submit-queue (batch tested with PRs 41337, 41375, 41363, 41034, 41350)

use instance's Name to attach gce disk

**What this PR does / why we need it**:
fix #40427
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #40427

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-02-14 09:11:25 -08:00
deads2k db0b0bd0f5 move metav1 conversions to metav1 2017-02-14 11:47:23 -05:00
Yu-Ju Hong 9fa1ad29fd kubelet: handle containers in the "created" state 2017-02-14 07:51:35 -08:00
Jan Safranek 308c0ecde9 pv_controller: Do not report exponential backoff as error.
It's not an error when recycle/delete/provision operation cannot be started
because it has failed recently. It will be restarted automatically when
backoff expires.
2017-02-14 15:16:26 +01:00
deads2k e063ca3e82 stop senseless negotiation 2017-02-14 08:49:14 -05:00