Commit Graph

2718 Commits (43280e274db67545fd7f765db4fde2f00ef97f89)

Author SHA1 Message Date
Wojciech Tyczynski d2529bb6b6 Avoid sleep in endpoint controller 2017-05-19 13:57:36 +02:00
Andy Goldstein e8e87cb1c2 NS controller: don't stop deleting GVRs on error
If the namespace controller encounters an error trying to delete a
single GroupVersionResource, add the error to an aggregated list of
errors and continue attempting to delete all the GroupVersionResources
instead of stopping at the first error. Return the aggregated error list
(if any) when done. This allows us to delete as much of the content in
the namespace as we can in each pass.
2017-05-18 12:01:40 -04:00
Clayton Coleman bdd4d34c7d
generated: api changes 2017-05-18 10:07:47 -04:00
Alexander Block 06baeb33b2 Don't try to attach volumes which are already attached to other nodes 2017-05-18 06:56:30 +02:00
Kubernetes Submit Queue 7df0178076 Merge pull request #42975 from smarterclayton/time_namespace
Automatic merge from submit-queue (batch tested with PRs 40234, 45885, 42975)

Log how much time it takes e2e tests to clean up the namespace
2017-05-17 20:27:52 -07:00
Kubernetes Submit Queue 6dbe853e29 Merge pull request #45544 from ianchakeres/reconciler-err-cleanup
Automatic merge from submit-queue (batch tested with PRs 45990, 45544, 45745, 45742, 45678)

Refactor reconciler volume log and error messages

**What this PR does / why we need it**:
Utilizes volume-specific error and log messages introduced in #44969, inside files that also log volume information. 

Specifically: 

- pkg/kubelet/volumemanager/reconciler/reconciler.go, 
- pkg/controller/volume/attachdetach/reconciler/reconciler.go, and
- pkg/kubelet/volumemanager/populator/desired_state_of_world_populator.go


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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
NONE
2017-05-17 18:40:51 -07:00
Clayton Coleman 7da310ea28
Fix namespace controller logging to be consistent
time.Now() was wrong, simplify namespace controller output
2017-05-17 17:45:05 -04:00
Kubernetes Submit Queue 4a9a702ee1 Merge pull request #45926 from MrHohn/api-annotations-move
Automatic merge from submit-queue

Move all API related annotations into annotation_key_constants.go

Separate from #45869. See https://github.com/kubernetes/kubernetes/pull/45869#discussion_r116839411 for details.

This PR does nothing but move constants around :)

/assign @caesarxuchao 

**Release note**:

```release-note
NONE
```
2017-05-17 10:34:53 -07:00
Kubernetes Submit Queue 8863bd4353 Merge pull request #45709 from YuPengZTE/devGetAllDaemonSetPods
Automatic merge from submit-queue (batch tested with PRs 45709, 41939)

delete err when return _

Signed-off-by: yupengzte <yu.peng36@zte.com.cn>



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-16 23:11:49 -07:00
Zihong Zheng 5992425588 Autogenerated files 2017-05-16 21:55:51 -07:00
Zihong Zheng c0920f75cf Move API annotations into annotation_key_constants and remove api/annotations package 2017-05-16 21:55:23 -07:00
Kubernetes Submit Queue 3f0ebbe884 Merge pull request #45247 from mbohlool/c3
Automatic merge from submit-queue (batch tested with PRs 45247, 45810, 45034, 45898, 45899)

Apiregistration v1alpha1→v1beta1

Promoting apiregistration api from v1alpha1 to v1beta1.

API Registration is responsible for registering an API `Group`/`Version` with
another kubernetes like API server. The `APIService` holds information
about the other API server in `APIServiceSpec` type as well as general
`TypeMeta` and `ObjectMeta`. The `APIServiceSpec` type have the main
configuration needed to do the aggregation. Any request coming for
specified `Group`/`Version` will be directed to the service defined by
`ServiceReference` (on port 443) after validating the target using provided
`CABundle` or skipping validation if development flag `InsecureSkipTLSVerify`
is set. `Priority` is controlling the order of this API group in the overall
discovery document.
The return status is a set of conditions for this aggregation. Currently
there is only one condition named "Available", if true, it means the
api/server requests will be redirected to specified API server.

```release-note
API Registration is now in beta.
```
2017-05-16 19:01:55 -07:00
yupengzte e463c28db6 delete err when return _
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>
2017-05-16 16:15:06 +08:00
Kubernetes Submit Queue 746f5d6a28 Merge pull request #45664 from tacy/fix45213
Automatic merge from submit-queue (batch tested with PRs 45664, 45861)

Fix #45213: Syncing jobs would return error when podController exception

**What this PR does / why we need it**:
Jobcontroller:  Syncing jobs would return error when podController exception
**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #
fixes #45213 
**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-15 21:08:48 -07:00
Kubernetes Submit Queue 24cb1cec64 Merge pull request #45758 from caesarxuchao/remove-vendor-heapster-v1alpha1
Automatic merge from submit-queue (batch tested with PRs 44337, 45775, 45832, 45574, 45758)

Stop vendoring heapster v1alpha1

Changes to use the one in staging/metrics.

TODO: remove the exception in https://github.com/kubernetes/kubernetes/pull/45176

Implementing https://github.com/kubernetes/kubernetes/issues/45498#issuecomment-301013423.
2017-05-15 18:39:20 -07:00
Kubernetes Submit Queue c03e4952a3 Merge pull request #45574 from zhangxiaoyu-zidif/format-daemondset-for
Automatic merge from submit-queue (batch tested with PRs 44337, 45775, 45832, 45574, 45758)

daemoncontroller.go:format for

**What this PR does / why we need it**:
format for.
delete redundant para.
make code clean.

**Release note**:

```release-note
NONE
```
2017-05-15 18:39:18 -07:00
Kubernetes Submit Queue 521d7d1ac5 Merge pull request #42472 from timchenxiaoyu/requesttypo
Automatic merge from submit-queue

fix request typo
2017-05-15 15:57:57 -07:00
mbohlool e2f20a3539 Promote apiregistration from v1alpha1 to v1beta1 2017-05-15 15:34:33 -07:00
Chao Xu 36e2d0b4cb hack/update-bazal.sh
hack/update-godep-license
2017-05-15 13:51:39 -07:00
Chao Xu d9c2fbbf23 rely on staging/metrics instead of on
vendor/k8s.io/heapster/metrics/apis/metrics/v1alpha1

fix some related imports
2017-05-15 13:50:49 -07:00
Kubernetes Submit Queue 3f054a03a9 Merge pull request #42471 from timchenxiaoyu/resourceytpo
Automatic merge from submit-queue

fix resource typo
2017-05-15 10:39:06 -07:00
lichunlong ab1476b1df Fix #45213: Syncing jobs would return error when podController exception 2017-05-15 22:52:50 +08:00
zhengjiajin 33bcb78f9e fix typo 2017-05-15 12:23:37 +08:00
Justin Santa Barbara 976e046f7a servicecontroller: use consistent node criteria
We have two node selection functions: includeNodeFromNodeList and
getNodeConditionPredicate, and the logic is different.

The logic should be the same, so remove includeNodeFromNodeList and just
use getNodeConditionPredicate everywhere.

Fix #45772
2017-05-13 14:07:13 -04:00
Kubernetes Submit Queue abaffb243e Merge pull request #45692 from caesarxuchao/limit-client-go-package-import-2
Automatic merge from submit-queue (batch tested with PRs 44748, 45692)

Limiting client go packages visibility, round 3

Continue the work in the merged PR https://github.com/kubernetes/kubernetes/pull/45258

These packages in client-go will be gone after #44065 is fixed:
pkg/api/helper, pkg/api/util, internal version of api groups, API install packages. 

This PR removes the dependency on these packages and add bazel visibility rules to prevent relapse.
2017-05-12 16:04:37 -07:00
Kubernetes Submit Queue 521badc4b7 Merge pull request #44748 from zhangxiaoyu-zidif/cleancode-1-graph_builder
Automatic merge from submit-queue

cleancode: graph_builder.go

It make the code clean and light.
2017-05-12 15:35:42 -07:00
Kubernetes Submit Queue da6fda3631 Merge pull request #45685 from derekwaynecarr/quota-enqueue
Automatic merge from submit-queue (batch tested with PRs 45685, 45572, 45624, 45723, 45733)

resource quota full resync was removed in error

**What this PR does / why we need it**:
the quota controller should have had a full resync interval, and it was inadvertently removed in the move to shared informers.

**Which issue this PR fixes** 
This fixes quota recalculation happening at the specified interval.

**Special notes for your reviewer**:

**Release note**:
```release-note
the resource quota controller was not adding quota to be resynced at proper interval
```
2017-05-12 14:00:50 -07:00
Ian Chakeres b1315f4491 Refactor reconciler volume log and error messages 2017-05-11 22:33:17 -07:00
Hemant Kumar 951a36aac7 Add Keepterminatedpodvolumes as a annotation on node
and lets make sure that controller respects it
and doesn't detaches mounted volumes.
2017-05-11 22:31:14 -04:00
Hemant Kumar 9a1a9cbe08 detach the volume when pod is terminated
Make sure volume is detached when pod is terminated because
of any reason and not deleted from api server.
2017-05-11 22:18:22 -04:00
Chao Xu 14045d253d hack/update-bazel.sh 2017-05-11 15:59:04 -07:00
Chao Xu c354076aa4 remove invocation of k8s.io/client-go/pkg/api/install
change import of client-go/api/helper to kubernetes/api/helper

remove unnecessary use of client-go/api.registry

change use of client-go/pkg/util to kubernetes/pkg/util

remove dependency on client-go/pkg/apis/extensions

remove unnecessary invocation of k8s.io/client-go/extension/intsall

change use of k8s.io/client-go/pkg/apis/authentication to v1
2017-05-11 15:03:46 -07:00
Derek Carr 430f078f93 resource quota full resync was removed in error 2017-05-11 15:58:55 -04:00
Kubernetes Submit Queue fc7ae99327 Merge pull request #45478 from HardySimpson/fix-endpoints-del
Automatic merge from submit-queue (batch tested with PRs 45569, 45602, 45604, 45478, 45550)

fix endpoints controller del lead-election endpoints

when there are multiple controller-manager instances,  we observe that it will delete leader-election endpoints after 5min,  and cause re-election, add a check to avoid that

Fixes #45585

error log

```
192.168.0.5 - - [02/May/2017:15:10:13 +0000] "GET /api/v1/endpoints HTTP/1.1" 200 1175 "-" "kube-controller-manager/V100R001C00B012 (linux/amd64) kubernetes/bede5a0/endpoint-controller"
192.168.0.5 - - [02/May/2017:15:10:13 +0000] "DELETE /api/v1/namespaces/kube-system/endpoints/kube-controller-manager HTTP/1.1" 200 46 "-" "kube-controller-manager/V100R001C00B012 (linux/amd64) kubernetes/bede5a0/endpoint-controller"
192.168.0.5 - - [02/May/2017:15:10:13 +0000] "DELETE /api/v1/namespaces/kube-system/endpoints/kube-scheduler HTTP/1.1" 200 46 "-" "kube-controller-manager/V100R001C00B012 (linux/amd64) kubernetes/bede5a0/endpoint-controller"
192.168.0.7 - - [02/May/2017:15:10:14 +0000] "GET /api/v1/namespaces/kube-system/endpoints/kube-scheduler HTTP/1.1" 404 123 "-" "kube-scheduler/V100R001C00B012 (linux/amd64) kubernetes/bede5a0"
192.168.0.7 - - [02/May/2017:15:10:14 +0000] "POST /api/v1/namespaces/kube-system/endpoints HTTP/1.1" 201 398 "-" "kube-scheduler/V100R001C00B012 (linux/amd64) kubernetes/bede5a0"
192.168.0.6 - - [02/May/2017:15:10:14 +0000] "GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager HTTP/1.1" 404 141 "-" "kube-controller-manager/V100R001C00B012 (linux/amd64) kubernetes/bede5a0"
192.168.0.6 - - [02/May/2017:15:10:14 +0000] "POST /api/v1/namespaces/kube-system/endpoints HTTP/1.1" 201 416 "-" "kube-controller-manager/V100R001C00B012 (linux/amd64) kubernetes/bede5a0"
192.168.0.7 - - [02/May/2017:15:10:14 +0000] "GET /api/v1/namespaces/kube-system/endpoints/kube-controller-manager HTTP/1.1" 200 416 "-" "kube-controller-manager/V100R001C00B012 (linux/amd64) ku
```



release-note

```release-note
none
```
2017-05-10 21:34:43 -07:00
Solly Ross b4ee4e2e80 Fix HPA unit tests with new fake client
The new fake client properly represents the resource of `PodMetrics` as
"pods" and the resource of `NodeMetrics` as "nodes".  Previously, it
used "podmetricses" and "nodemetrics", respectively.

This fixes up `horizontal_test.go` and `replica_calc_test.go` to use the
new names.
2017-05-10 13:33:18 -04:00
zhangxiaoyu-zidif 00b67443f0 daemoncontroller.go:format for 2017-05-10 14:06:34 +08:00
Kubernetes Submit Queue f8f9d7db93 Merge pull request #45304 from deads2k/controller-03-ns-discovery
Automatic merge from submit-queue (batch tested with PRs 45304, 45006, 45527)

increase the QPS for namespace controller

The namespace controller is really chatty. Especially to discovery since that involves two requests for every API version available. This bumps the QPS and burst on the namespace controller to avoid being stuck waiting.
2017-05-09 12:04:41 -07:00
Kubernetes Submit Queue 202a9f8445 Merge pull request #42317 from NickrenREN/attach-detach-error-info-print
Automatic merge from submit-queue

add and clear err message about RemoveVolumeFromReportAsAttached()

**Release note**:

```release-note
NONE
```
2017-05-09 10:44:32 -07:00
Hardy Simpson e7ea942aac fix endpoints controller del lead-election endpoints 2017-05-09 00:53:50 +00:00
Kubernetes Submit Queue a062782524 Merge pull request #44258 from wlan0/master
Automatic merge from submit-queue (batch tested with PRs 45508, 44258, 44126, 45441, 45320)

cloud initialize node in external cloud controller

@thockin This PR adds support in the `cloud-controller-manager` to initialize nodes (instead of kubelet, which did it previously)

This also adds support in the kubelet to skip node cloud initialization when `--cloud-provider=external`

Specifically,

Kubelet

1. The kubelet has a new flag called `--provider-id` which uniquely identifies a node in an external DB
2. The kubelet sets a node taint - called "ExternalCloudProvider=true:NoSchedule" if cloudprovider == "external"

Cloud-Controller-Manager

1. The cloud-controller-manager listens on "AddNode" events, and then processes nodes that starts with that above taint. It performs the cloud node initialization steps that were previously being done by the kubelet.
2. On addition of node, it figures out the zone, region, instance-type, removes the above taint and updates the node.
3. Then periodically queries the cloudprovider for node addresses (which was previously done by the kubelet) and updates the node if there are new addresses

```release-note
NONE  
```
2017-05-08 16:34:43 -07:00
NickrenREN 0861688237 add and clear err message in RemoveVolumeFromReportAsAttached 2017-05-08 09:37:21 +08:00
Kubernetes Submit Queue 79a2e359cd Merge pull request #44024 from zhangxiaoyu-zidif/egnew
Automatic merge from submit-queue

fix the typos of e.g.

fix the typos of e.g.


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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-05-05 23:41:33 -07:00
wlan0 45d2bc06b7 cloud initialize node in external cloud controller 2017-05-05 16:51:45 -07:00
gmarek 51c07147c8 Make taint manager harder to break before we move it out of NC 2017-05-05 15:48:44 +02:00
Kubernetes Submit Queue 5baa947c8c Merge pull request #45413 from gmarek/test_panic
Automatic merge from submit-queue (batch tested with PRs 43732, 45413)

Extend timeouts in timed_workers_test

Fix #45375

If it won't be enough I'll rewrite it to allow injectable timers.
2017-05-05 05:48:34 -07:00
Kubernetes Submit Queue 571ffcf926 Merge pull request #43732 from wanghaoran1988/fix_issue_42479
Automatic merge from submit-queue (batch tested with PRs 43732, 45413)

Handle maxUnavailable larger than spec.replicas

**What this PR does / why we need it**:
Handle maxUnavailable larger than spec.replicas
**Which issue this PR fixes** 
fixes #42479

**Special notes for your reviewer**:
None
**Release note**:
```
NONE
```
2017-05-05 05:48:33 -07:00
gmarek 8f86881d18 Extend timeouts in timed_workers_test 2017-05-05 13:18:14 +02:00
Kubernetes Submit Queue b9f340d922 Merge pull request #45349 from gmarek/taint_immunity
Automatic merge from submit-queue (batch tested with PRs 45218, 45349)

Make Daemons tolerate NoExecute taints correctly

Fix #45348

@kubernetes/sig-scheduling-pr-reviews
2017-05-05 01:18:32 -07:00
gmarek f371c14314 Make Daemons tolerate NoExecute taints correctly 2017-05-04 15:25:03 +02:00
deads2k 575c6d7ad8 increase the QPS for namespace controller 2017-05-03 15:25:13 -04:00
Kubernetes Submit Queue 44d5bf29e0 Merge pull request #45100 from sttts/sttts-deflake-TestUpdateNodeWithMultiplePods
Automatic merge from submit-queue (batch tested with PRs 45100, 45152, 42513, 44796, 45222)

node-controller: deflake TestUpdateNodeWithMultiplePods
2017-05-02 10:34:58 -07:00
Dr. Stefan Schimanski a426adcb2f node-controller: deflake TestUpdateNodeWithMultiplePods
Use absolute time and increase grace duration to 500ms for tests under load.
2017-05-02 08:01:52 +02:00
Klaus Ma c55f30ba70 Removed TODO that renaming ReplicationManager. 2017-04-30 19:37:47 +08:00
Jordan Liggitt 24efb3736b
Wait for controller events in resource conflict test 2017-04-29 22:23:39 -04:00
Kubernetes Submit Queue e2cec40641 Merge pull request #45002 from zhangxiaoyu-zidif/statefulset-format-err
Automatic merge from submit-queue

stateful_pod_control.go: format the code

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

1.Improve the quality of the code.
2.Reduce reduandant parameters
3.add one comma

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-29 04:38:12 -07:00
Dr. Stefan Schimanski 64aec01ac9 taint-controller-tests: double 'a bit of time' to avoid flakes 2017-04-28 17:42:35 +02:00
zhangxiaoyu-zidif 026638af51 stateful_pod_control.go: format the code 2017-04-28 18:16:19 +08:00
Haoran Wang b6aadd2b7e Handle maxUnavailable larger than spec.replicas 2017-04-28 13:32:24 +08:00
Chao Xu 958903509c bazel 2017-04-27 09:41:53 -07:00
Chao Xu 3fa7b7824a easy changes 2017-04-27 09:41:53 -07:00
Kubernetes Submit Queue dc92a6fcc7 Merge pull request #44996 from liggitt/token-test
Automatic merge from submit-queue

Update token controller test to test async retry

Fixes #44819

https://github.com/kubernetes/kubernetes/pull/44625 changed the token controller to queue a retry if the live service account's resourceVersion did not match our cache.

This updates the unit test that was testing that condition to test async queue behavior (which this condition now drives)
2017-04-27 08:39:04 -07:00
Jordan Liggitt f1207de4ea
Update token controller test to test async retry 2017-04-27 00:33:27 -04:00
Maxim Ivanov 0cf4744e75 Remove misleading error from CronJob controller when it can't find parent UID 2017-04-26 18:57:53 +01:00
Mike Danese e48a4f0af7 fix various bad tests 2017-04-25 11:23:33 -07:00
Kubernetes Submit Queue 1fd19f7fa2 Merge pull request #42477 from jsafrane/v1-2-new-api
Automatic merge from submit-queue (batch tested with PRs 42477, 44462)

Use storage.v1 instead of v1beta1

storage.v1beta1 was used to work around GKE which did not expose v1. Now that GKE is updated, we can switch everything to v1.

This is simple sed v1beta1 -> v1 + enabled a new test + changed preference of exposed interfaces in `storage/install/install.go`.

@msau42, PTAL and let me know when GKE is updated with storage v1 API and this PR can be actually merged.

@kubernetes/sig-storage-pr-reviews 

```release-note
NONE
```
2017-04-25 10:25:44 -07:00
Kubernetes Submit Queue d86a01570b Merge pull request #44439 from kargakis/fix-saturation-check
Automatic merge from submit-queue (batch tested with PRs 44741, 44853, 44572, 44797, 44439)

controller: fix saturation check in Deployments

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

@kubernetes/sig-apps-bugs 

I'll cherry-pick this back to 1.6 and 1.5
2017-04-25 01:56:42 -07:00
Jan Safranek 9d0c47f1db Use storage.v1 instead of v1beta1
storage.v1beta1 was used to work around GKE which does not expose v1. Now that
GKE is updated, we can switch everything to v1.
2017-04-25 10:13:38 +02:00
Kubernetes Submit Queue badd785839 Merge pull request #40060 from justinsb/remove_unused_zone
Automatic merge from submit-queue (batch tested with PRs 40060, 44860, 44865, 44825, 44162)

servicecontroller: remove unused zone field

The zone field was unused, and this complicated e.g. #39996

```release-note
NONE
```
2017-04-24 23:07:38 -07:00
Kubernetes Submit Queue 6c8cb33fb3 Merge pull request #42101 from Dmitry1987/feature/hpa-upscale-downscale-delay-configurable
Automatic merge from submit-queue (batch tested with PRs 44862, 42241, 42101, 43181, 44147)

Feature/hpa upscale downscale delay configurable

**What this PR does / why we need it**:
Makes "upscale forbidden window" and "downscale forbidden window"  duration configurable in arguments of kube-controller-manager. Those are options of horizontal pod autoscaler.

**Special notes for your reviewer**:
Please have a look @DirectXMan12 , the PR as discussed in Slack.

**Release note**:
```
Make "upscale forbidden window" and "downscale forbidden window"  duration configurable in arguments of kube-controller-manager. Those are options of horizontal pod autoscaler. Right now are hardcoded 3 minutes for upscale, and 5 minutes to downscale.  But sometimes cluster administrator might want to change this for his own needs.
```
2017-04-24 19:39:42 -07:00
Kubernetes Submit Queue f0ce5bd8d8 Merge pull request #44672 from kargakis/update-deployment-completeness
Automatic merge from submit-queue (batch tested with PRs 43575, 44672)

Update deployment and daemonset completeness checks

maxUnavailable being taken into account for deployment completeness has caused a lot of confusion (https://github.com/kubernetes/kubernetes/issues/44395, https://github.com/kubernetes/kubernetes/issues/44657, https://github.com/kubernetes/kubernetes/issues/40496, others as well I am sure) so I am willing to just stop using it and require all of the new Pods for a Deployment to be available for the Deployment to be considered complete (hence both `rollout status` and ProgressDeadlineSeconds will not be successful in cases where a 1-pod Deployment never becomes successful because its Pod never transitions to ready).

@kubernetes/sig-apps-api-reviews thoughts?
```release-note
Deployments and DaemonSets are now considered complete once all of the new pods are up and running - affects `kubectl rollout status` (and ProgressDeadlineSeconds for Deployments)
```
Fixes https://github.com/kubernetes/kubernetes/issues/44395
2017-04-24 10:34:00 -07:00
Kubernetes Submit Queue 56ea95fa83 Merge pull request #44745 from justinsb/lb_recognize_16_unschedulable
Automatic merge from submit-queue

Exclude master from LoadBalancer / NodePort

The servicecontroller documents that the master is excluded from the
LoadBalancer / NodePort, but this is broken for clusters where we are
using taints for the master (as introduced in 1.6), instead of marking
the master as unschedulable.

This restores the desired documented behaviour, by excluding nodes that
are labeled as masters with the new 1.6 labels, even if they use the new
1.6 taints.

Fix #33884

```release-note
Exclude nodes labeled as master from LoadBalancer / NodePort; restores documented behaviour
```
2017-04-23 21:37:42 -07:00
Kubernetes Submit Queue 35159f9c45 Merge pull request #41763 from dhilipkumars/ImproveSrvCodeCov
Automatic merge from submit-queue

Improve Service controller's code coverage a little bit

**What this PR does / why we need it**:
Improves the code coverage for Service Controller
Before
```
go test --cover ./pkg/controller/service
ok      k8s.io/kubernetes/pkg/controller/service        0.101s  coverage: 23.4% of statements
```
After
```
go test --cover ./pkg/controller/service/
ok      k8s.io/kubernetes/pkg/controller/service        0.094s  coverage: 62.0% of statements
```

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

**Special notes for your reviewer**:

**Release note**: 

```release-note
NONE
```
2017-04-23 14:29:34 -07:00
Łukasz Oleś b9611b95f4 Skip pods and replica sets marked for deletion
Fixes #44144
2017-04-23 00:29:48 +02:00
Łukasz Oleś bbedf9e71e Add unit tests for ClaimPods 2017-04-23 00:29:45 +02:00
dhilipkumars fadb275a9a Improve Service controller code coverage a little bit 2017-04-22 22:25:46 +05:30
Michail Kargakis f1e8356265
Deployments complete only when all desired pods are available
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-04-22 17:18:10 +02:00
Michail Kargakis 1923cc60c9
Revert "kubectl: respect deployment strategy parameters for rollout status"
This reverts commit d20ac8766e.
2017-04-22 17:18:06 +02:00
Kubernetes Submit Queue 3317957a33 Merge pull request #44730 from kow3ns/fix-44229
Automatic merge from submit-queue (batch tested with PRs 44625, 43594, 44756, 44730)

Check for terminating Pod prior to launching successor in StatefulSet

Modifies sync loop for StatefulSet controller to check if a Pod is terminating before launching its successor. Fixes #44229. Should be cherry picked into 1.6 branch.

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

```release-note
NONE
```
2017-04-21 13:49:06 -07:00
Kubernetes Submit Queue a061d072ac Merge pull request #44625 from liggitt/token-controller
Automatic merge from submit-queue (batch tested with PRs 44625, 43594, 44756, 44730)

Retry secret reference addition on conflict

* Tolerates leading or trailing etcd reads when fetching liveServiceAccount - fixes #25416
* Tolerates conflicts when updating the service account with the secret reference (does RetryOnConflict before deleting token and completely restarting the flow) - fixes #44054
2017-04-21 13:48:59 -07:00
Kubernetes Submit Queue 25ec2607dd Merge pull request #44763 from ncdc/fix-replication-controller-log-ptr-check
Automatic merge from submit-queue

More RC/RS controller logging updates

We were comparing the address of the old and new RC.spec.replicas and we
have to compare the values. This only affects logging.

Update RS controller to match RC controller to log when spec.replicas
changes, not status.replicas.

@kargakis @janetkuo @sttts @liggitt
2017-04-21 09:22:27 -07:00
Kenneth Owens 7d22e64284 StatefulSet should not launch Pod i, if a Pod in the sequence [0,i) has its
DeletionTimestamp set. Fixes 44229.
Rename isTerminated to isTerminating
Adds a test case for at the unit level to prevent regression
2017-04-21 08:38:21 -07:00
Wojciech Tyczynski a0418d01ac Merge pull request #44760 from tsmetana/issue44757
Fix issue #44757: Flaky Test_AttachDetachControllerRecovery
2017-04-21 14:36:06 +02:00
Andy Goldstein 4a47c47650 More RC/RS controller logging updates
We were comparing the address of the old and new RC.spec.replicas and we
have to compare the values. This only affects logging.

Update RS controller to match RC controller to log when spec.replicas
changes, not status.replicas.
2017-04-21 08:07:18 -04:00
Tomas Smetana 3064fe4d39 Fix issue #44757: Flaky Test_AttachDetachControllerRecovery 2017-04-21 12:43:54 +02:00
Kubernetes Submit Queue cd37aaafb3 Merge pull request #44487 from resouer/fix-ss-error
Automatic merge from submit-queue (batch tested with PRs 41498, 44487)

Use len of pods in stateful set error

**What this PR does / why we need it**:
Sync stateful set reports wrong error, we need to fix it.

**Release note**:

```release-note
`NONE`
```
2017-04-21 01:55:57 -07:00
zhangxiaoyu-zidif f1df40d5ee cleancode: graph_builder.go 2017-04-21 11:12:54 +08:00
Justin Santa Barbara 82d600bb5c Exclude master from LoadBalancer / NodePort
The servicecontroller documents that the master is excluded from the
LoadBalancer / NodePort, but this is broken for clusters where we are
using taints for the master (as introduced in 1.6), instead of marking
the master as unschedulable.

This restores the desired documented behaviour, by excluding nodes that
are labeled as masters with the new 1.6 labels, even if they use the new
1.6 taints.

Fix #33884
2017-04-20 22:19:43 -04:00
Kubernetes Submit Queue db53e80445 Merge pull request #39732 from tsmetana/issue_34242
Automatic merge from submit-queue (batch tested with PRs 44722, 44704, 44681, 44494, 39732)

Fix issue #34242: Attach/detach should recover from a crash

When the attach/detach controller crashes and a pod with attached PV is deleted afterwards the controller will never detach the pod's attached volumes. To prevent this the controller should try to recover the state from the nodes status and figure out which volumes to detach. This requires some changes in the volume providers too: the only information available from the nodes is the volume name and the device path. The controller needs to find the correct volume plugin and reconstruct the volume spec just from the name. This required a small change also in the volume plugin interface.

Fixes Issue #34242.
cc: @jsafrane @jingxu97
2017-04-20 16:01:04 -07:00
Kubernetes Submit Queue 7b43f922aa Merge pull request #42176 from enisoc/controller-ref-job
Automatic merge from submit-queue (batch tested with PRs 42177, 42176, 44721)

Job: Respect ControllerRef

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

This is part of the completion of the [ControllerRef](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md) proposal. It brings Job into full compliance with ControllerRef. See the individual commit messages for details.

**Which issue this PR fixes**:

This ensures that Job does not fight with other controllers over control of Pods.

Ref: #24433

**Special notes for your reviewer**:

**Release note**:

```release-note
Job controller now respects ControllerRef to avoid fighting over Pods.
```
cc @erictune @kubernetes/sig-apps-pr-reviews
2017-04-20 12:57:06 -07:00
Kubernetes Submit Queue f25a657574 Merge pull request #42177 from enisoc/controller-ref-cronjob
Automatic merge from submit-queue (batch tested with PRs 42177, 42176, 44721)

CronJob: Respect ControllerRef

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

This is part of the completion of the [ControllerRef](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md) proposal. It brings CronJob into compliance with ControllerRef. See the individual commit messages for details.

**Which issue this PR fixes**:

This ensures that other controllers do not fight over control of objects that a CronJob owns.

**Special notes for your reviewer**:

**Release note**:

```release-note
CronJob controller now respects ControllerRef to avoid fighting with other controllers.
```
cc @erictune @kubernetes/sig-apps-pr-reviews
2017-04-20 12:57:03 -07:00
Michail Kargakis 63e8484567
controller: fix saturation check for Deployments
Signed-off-by: Michail Kargakis <mkargaki@redhat.com>
2017-04-20 19:22:30 +02:00
Harry Zhang cef629c63e Use len of pods in stateful set error 2017-04-20 22:31:23 +08:00
Tomas Smetana 852c44ae59 Fix issue #34242: Attach/detach should recover from a crash
When the attach/detach controller crashes and a pod with attached PV is deleted
afterwards the controller will never detach the pod's attached volumes. To
prevent this the controller should try to recover the state from the nodes
status.
2017-04-20 13:04:50 +02:00
Anthony Yeh be1fe95534 CronJob: Use PATCH to adopt Jobs. 2017-04-19 15:42:34 -07:00
Anthony Yeh 1e14323ac2 CronJob: List children before parents.
This prevents a race with the GC while it orphans dependents.
2017-04-19 15:42:34 -07:00
Anthony Yeh 4e1b07d9c2 CronJob: Check ControllerRef Name and UID in unit test. 2017-04-19 15:42:34 -07:00
Anthony Yeh f502ab6a8b Job: Recheck DeletionTimestamp before adoption.
This is necessary to avoid racing with the GC when it orphans
dependents.
2017-04-19 14:03:36 -07:00
Anthony Yeh fd8dd26d09 Job: Check ControllerRef Name and UID in unit test. 2017-04-19 14:03:36 -07:00
Anthony Yeh 06536cb357 Job: Check that ControllerRef UID matches. 2017-04-19 14:03:36 -07:00
Anthony Yeh c82b537bee Job: Always set BlockOwnerDeletion in ControllerRef. 2017-04-19 14:03:36 -07:00
Anthony Yeh 067a8ff3c2 Job: Use ControllerRef to route watch events.
This is part of the completion of ControllerRef, as described here:

https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md#watches
2017-04-19 14:03:35 -07:00
Kubernetes Submit Queue 36d10fed44 Merge pull request #44668 from NickrenREN/pv-cleanup
Automatic merge from submit-queue

Remove claimClass check and upgradeVolumeFrom1_2() function

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

@jsafrane  PTAL. Thanks
2017-04-19 05:54:02 -07:00
NickrenREN eca490bbdd Remove claimClass check and upgradeVolumeFrom1_2() function 2017-04-19 19:12:32 +08:00
Kubernetes Submit Queue 9c17779924 Merge pull request #44571 from rpothier/cidr_set_indices
Automatic merge from submit-queue

Fixes an issue in cide_set.go

Function getBeginingAndEndIndices may return
end index too big



**What this PR does / why we need it**:
Fixes getBeginingAndEndIndices() in cidr_set.go
End index is off by one when s.clusterMaskSize >= maskSize

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


**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-04-19 02:36:52 -07:00
Anthony Yeh 4e682fdaa4 CronJob: Always set BlockOwnerDeletion in ControllerRef. 2017-04-18 14:00:18 -07:00
Anthony Yeh e085f1f83c CronJob: Apply missing ControllerRefs to Jobs created by a CronJob.
This should only happen if the Jobs were created by an older version
of the CronJob controller, since from now on we add ControllerRef upon
creation.

CronJob doesn't do actual adoption because it doesn't use label
selectors to find its Jobs. However, we should apply ControllerRef
for potential server-side cascading deletion, and to advise other
controllers we own these objects.
2017-04-18 14:00:18 -07:00
Anthony Yeh d72eebd3fc CronJob: Add ControllerRef on all created Jobs. 2017-04-18 13:59:54 -07:00
Anthony Yeh 4c954d6dbb CronJob: Don't launch if DeletionTimestamp is set. 2017-04-18 13:59:31 -07:00
Anthony Yeh 424de52779 Job: Use ControllerRefManager to adopt/orphan. 2017-04-18 13:58:54 -07:00
Anthony Yeh bdfe18f638 Job: Add ControllerRef on all created Pods. 2017-04-18 13:56:32 -07:00
Łukasz Oleś 0f75e56722 Pods marked for deletion should be counted as unavailable 2017-04-18 22:32:59 +02:00
Jordan Liggitt 12dce04a3b
Retry secret reference addition on conflict 2017-04-18 14:17:17 -04:00
NickrenREN 5cafb9042b find and add active pods for dswp
loops through the list of active pods and ensures that each one exists in the desired state of the world cache
2017-04-18 11:21:37 +08:00
Kubernetes Submit Queue 08ea5387f2 Merge pull request #44566 from wongma7/adc-wait
Automatic merge from submit-queue (batch tested with PRs 44469, 44566, 44467, 44526)

WaitForCacheSync before running attachdetach controller

@gnufied you wrote the test and @ncdc the TODO comment. Let's just run the pv and pvc informers, we do not care about them in this test. But we want to be able to stop the pod Informer at will, hence not just using informers.Start, is my understanding.
```release-note
NONE
```
2017-04-17 20:06:58 -07:00
Kubernetes Submit Queue 227e9744ea Merge pull request #41464 from StudyNick/zte170214
Automatic merge from submit-queue

'synchoronizing' word error
2017-04-17 18:15:13 -07:00
Kubernetes Submit Queue 32ee95496e Merge pull request #39944 from NickrenREN/controller-service-test
Automatic merge from submit-queue

add test for service controller sync and remove unused function
2017-04-17 18:15:04 -07:00
Kubernetes Submit Queue a1684fea80 Merge pull request #42085 from cblecker/gofmt-fix
Automatic merge from submit-queue (batch tested with PRs 40055, 42085, 44509, 44568, 43956)

Fix gofmt errors

**What this PR does / why we need it**:
There were some gofmt errors on master. Ran the following to fix:
```
hack/verify-gofmt.sh | grep ^diff | awk '{ print $2 }' | xargs gofmt -w -s
```

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2017-04-17 15:39:07 -07:00
Robert Pothier bde909c55b Fixes an issue in cide_set.go
Function getBeginingAndEndIndices may return
end index too big
2017-04-17 14:44:26 -04:00
Chao Xu 4f9591b1de move pkg/api/v1/ref.go and pkg/api/v1/resource.go to subpackages. move some functions in resource.go to pkg/api/v1/node and pkg/api/v1/pod 2017-04-17 11:38:11 -07:00
Matthew Wong e1ce33d944 WaitForCacheSync before running attachdetach controller 2017-04-17 14:02:33 -04:00
Chao Xu d4850b6c2b move pkg/api/v1/helpers.go to subpackage 2017-04-14 14:25:11 -07:00
Mike Danese a05c3c0efd autogenerated 2017-04-14 10:40:57 -07:00
Andy Goldstein a81e5807b6 Update bazel 2017-04-14 07:27:45 -04:00
Andy Goldstein e63fcf708d Make controller Run methods consistent
- startup/shutdown logging
- wait for cache sync logging
- defer utilruntime.HandleCrash()
- wait for stop channel before exiting
2017-04-14 07:27:45 -04:00
Kubernetes Submit Queue a4b4b99b0d Merge pull request #44468 from siggy/siggy/replica-calc-msg
Automatic merge from submit-queue (batch tested with PRs 44362, 44421, 44468, 43878, 44480)

fix error message in ReplicaCalculator

**What this PR does / why we need it**: fixes spelling in an error message

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

**Special notes for your reviewer**: have previously signed the CLA for minikube, not sure if that covers this repo also.

**Release note**:

```release-note
```
2017-04-14 01:46:04 -07:00
Kubernetes Submit Queue 113606cbaa Merge pull request #43939 from FengyunPan/remove-nameIndexFunc
Automatic merge from submit-queue (batch tested with PRs 44424, 44026, 43939, 44386, 42914)

ServiceAccountsController does not need nameIndexFunc to index ST

The ServiceAccountsController's Informer does not need nameIndexFunc.
2017-04-13 22:07:07 -07:00
Kubernetes Submit Queue 7ae36bf89b Merge pull request #44374 from FengyunPan/fix-disruptionevent
Automatic merge from submit-queue (batch tested with PRs 44406, 41543, 44071, 44374, 44299)

Record a warning type event

A warning type event should be recorded when failed to calculate
the number of expected pods.
2017-04-13 19:52:08 -07:00
Kubernetes Submit Queue 9f92832fad Merge pull request #43942 from wanghaoran1988/fix_43323
Automatic merge from submit-queue (batch tested with PRs 44447, 44456, 43277, 41779, 43942)

Clean up pre-ControllerRef compatibility logic

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

**Special notes for your reviewer**:
No
**Release note**:

```
NONE
```
2017-04-13 15:02:03 -07:00
Andrew Seigner d6cd0704ca fix error message in ReplicaCalculator 2017-04-13 14:16:52 -07:00
Kubernetes Submit Queue e4752d612a Merge pull request #44391 from ncdc/reduce-rc-logging
Automatic merge from submit-queue

Reduce replication_controller log spam

Decrease verbosity and reword 'Observed updated replication controller
...' now that the issue it was added for has been fixed.

This was originally added to debug #31981, and it was fixed back in September 2016.

cc @gmarek @wojtek-t @kargakis @eparis @smarterclayton
2017-04-12 23:13:22 -07:00
FengyunPan 09db327019 ServiceAccountsController does not need nameIndexFunc to index ST 2017-04-13 12:31:34 +08:00
NickrenREN 5c9fe166f9 add test for service controller sync and remove unused function 2017-04-13 12:06:12 +08:00
Kubernetes Submit Queue c7b0ec0178 Merge pull request #42981 from NickrenREN/pv-controller-init
Automatic merge from submit-queue

Exit from NewController() for PersistentVolumeController when InitPlugins() failed

Exit from NewController() for PersistentVolumeController when InitPlugins() failed just like NewAttachDetachController() does

**Release note**:
```release-note
NONE
```
@jsafrane  @saad-ali  PTAL. Thanks in advance
2017-04-12 08:18:50 -07:00
Andy Goldstein ebd22526b1 Reduce replication_controller log spam
Decrease verbosity and reword 'Observed updated replication controller
...' now that the issue it was added for has been fixed.
2017-04-12 10:23:06 -04:00
Kubernetes Submit Queue abd92fab1e Merge pull request #44296 from caesarxuchao/move-api-helpers.go
Automatic merge from submit-queue

Move api helpers.go to a subpackage

Part of https://github.com/kubernetes/kubernetes/issues/44065.

This PR moves the pkg/api/helpers.go to its own subpackage. It's mostly a mechanic move, except that
* I removed ConversionError in helpers.go, it's not used by anyone
* I moved the 3 methods of Taint and Toleration to pkg/api/methods.go, and left a TODO saying refactoring these methods to functions.

I'll send a few more PRs to make the k8s.io/kubernetes/pkg/api package only contains the code we want in the k8s.io/api repo, then we can run a [script](a0015fd1be (diff-7a2fbb4371972350ee414c6b88aee1c8)) to cut the new repo.
2017-04-11 23:46:04 -07:00
NickrenREN e0ef5bfd40 Exit from NewController() for PersistentVolumeController when InitPlugins() failed just like NewAttachDetachController() does 2017-04-12 13:43:09 +08:00
Kubernetes Submit Queue ceccd305ce Merge pull request #42147 from bowei/ip-alias-2
Automatic merge from submit-queue

Add support for IP aliases for pod IPs (GCP alpha feature)

```release-note
Adds support for allocation of pod IPs via IP aliases.

# Adds KUBE_GCE_ENABLE_IP_ALIASES flag to the cluster up scripts (`kube-{up,down}.sh`).

KUBE_GCE_ENABLE_IP_ALIASES=true will enable allocation of PodCIDR ips
using the ip alias mechanism rather than using routes. This feature is currently
only available on GCE.

## Usage
$ CLUSTER_IP_RANGE=10.100.0.0/16 KUBE_GCE_ENABLE_IP_ALIASES=true bash -x cluster/kube-up.sh

# Adds CloudAllocator to the node CIDR allocator (kubernetes-controller manager).

If CIDRAllocatorType is set to `CloudCIDRAllocator`, then allocation
of CIDR allocation instead is done by the external cloud provider and
the node controller is only responsible for reflecting the allocation
into the node spec.

- Splits off the rangeAllocator from the cidr_allocator.go file.
- Adds cloudCIDRAllocator, which is used when the cloud provider allocates
  the CIDR ranges externally. (GCE support only)
- Updates RBAC permission for node controller to include PATCH
```
2017-04-11 22:09:24 -07:00
FengyunPan 4ba7f7dc9e Record a warning type event
A warning type event should be recorded when failed to calculate
the number of expected pods.
And the same to daemoncontroller when failed to place pod.
2017-04-12 12:03:18 +08:00
Kubernetes Submit Queue e60cc6ee3d Merge pull request #44090 from NickrenREN/remove-alpha-pv
Automatic merge from submit-queue

Remove alphaProvisioner in PVController and AlphaStorageClassAnnotation

remove alpha annotation and alphaProvisioner 

**Release note**:

```release-note
NONE
```
2017-04-11 20:41:40 -07:00
Chao Xu 08aa712a6c move helpers.go to helper 2017-04-11 15:49:11 -07:00
Bowei Du f61590c221 Adds support for PodCIDR allocation from the GCE cloud provider
If CIDRAllocatorType is set to `CloudCIDRAllocator`, then allocation
of CIDR allocation instead is done by the external cloud provider and
the node controller is only responsible for reflecting the allocation
into the node spec.

- Splits off the rangeAllocator from the cidr_allocator.go file.
- Adds cloudCIDRAllocator, which is used when the cloud provider allocates
  the CIDR ranges externally. (GCE support only)
- Updates RBAC permission for node controller to include PATCH
2017-04-11 14:07:54 -07:00
Kubernetes Submit Queue 44131a3658 Merge pull request #44324 from shiywang/fix-subresource
Automatic merge from submit-queue (batch tested with PRs 43900, 44152, 44324)

make deployment unit tests need to respect subresources

Fixes #42569
I check all the unit test code related to `Matches` method, seems there's only one line we could change to not break previous testing logic
@kargakis ptal, thanks

/assign @kargakis
2017-04-11 07:57:20 -07:00
Kubernetes Submit Queue 1c34102d5b Merge pull request #43844 from weiwei04/master
Automatic merge from submit-queue

add Stringer interface for eventType

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

fix invalid log outputs like 

"graph_builder.go:429] GraphBuilder process object: v1/Endpoints, namespace kube-system, name kube-controller-manager, event type %!s(garbagecollector.eventType=1)"
2017-04-11 06:22:56 -07:00
Wei Wei 3329446c0e add Stringer interface for eventType 2017-04-11 10:36:52 +08:00
shiywang b3f48f736f make deployment unit tests need to respect subresources 2017-04-11 01:24:44 +08:00
Kubernetes Submit Queue 2899f47bc8 Merge pull request #44137 from k82cn/k8s_44135
Automatic merge from submit-queue (batch tested with PRs 41758, 44137)

Removed hostname/subdomain annotation.

fixes #44135

```release-note
Remove `pod.beta.kubernetes.io/hostname` and `pod.beta.kubernetes.io/subdomain` annotations. 
Users should use `pod.spec.hostname` and `pod.spec.subdomain` instead.
```
2017-04-10 10:06:15 -07:00
Kubernetes Submit Queue 50b104b8e2 Merge pull request #42313 from timchenxiaoyu/completelytypo
Automatic merge from submit-queue

fix completely typo
2017-04-10 05:57:06 -07:00
Kubernetes Submit Queue 3572e5ca86 Merge pull request #43679 from xingzhou/kube-42121
Automatic merge from submit-queue

Improve event msg for PV controller when using external provisioner

Improve event msg for PV controller when using external provisioner

**Which issue this PR fixes** *:
Fixed part of #42121

**Special notes for your reviewer**:
@jsafrane, as many of our users are confused by the original message, can we fix the message first and then consider how to control the count of the events?
2017-04-10 05:07:52 -07:00
NickrenREN fa7bd44966 Remove alphaProvisioner in PVController and AlphaStorageClassAnnotation 2017-04-10 17:09:40 +08:00
Klaus Ma c2b629ee2a Removed hostname/subdomain annotation. 2017-04-10 13:55:40 +08:00
Kubernetes Submit Queue 00743a4f2b Merge pull request #42629 from NickrenREN/pv-index
Automatic merge from submit-queue (batch tested with PRs 41775, 39678, 42629, 42524, 43028)

matchPredicate does not fit findByClaim()

matchPredicate has two args which are type of PV,and is not used in function findByClaim(),remove it


**Release note**:
```release-note
NONE
```
2017-04-07 17:44:16 -07:00
Kubernetes Submit Queue 97c38377f3 Merge pull request #44141 from k82cn/ss_typo
Automatic merge from submit-queue (batch tested with PRs 43373, 41780, 44141, 43914, 44180)

Updated comments according to the logic.

Updated comments according to the logic: it'll return empty string instead of nil if failed to match the regex.
2017-04-07 09:57:39 -07:00
Kubernetes Submit Queue ba349794ab Merge pull request #39139 from bruceauyeung/k8s-branch-small-code-improvements-and-fix-some-typos
Automatic merge from submit-queue

small code improvements and fix some typos

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

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

1. eliminate unnecessary extra scale up limit calculation
2. eliminate unnecessary extra pods length computation
3. fix some typos
2017-04-07 02:22:05 -07:00
Haoran Wang 866c599198 Clean up pre-ControllerRef compatibility logic 2017-04-07 14:09:23 +08:00
NickrenREN 67a55a4b02 matchPredicate does not fit findByClaim()
matchPredicate has two args which are type of PV,and is not used in function findByClaim(),remove it
2017-04-07 10:15:42 +08:00
Kubernetes Submit Queue aead989bef Merge pull request #44042 from gmarek/swap-taints
Automatic merge from submit-queue (batch tested with PRs 42961, 44042)

Allow swapping NotReady and Unschedulable Taints

Fix #43444

cc @kubernetes/sig-scheduling-pr-reviews @davidopp @aveshagarwal @mdshuai

For cherrypick @ethernetdan
2017-04-06 09:29:24 -07:00
Kubernetes Submit Queue 5b4a814db2 Merge pull request #43965 from kargakis/update-retry-interval-for-deployments
Automatic merge from submit-queue (batch tested with PRs 43963, 43965)

Update deployment retries to a saner count

It seems that the current retries sum up to no more than 0.2s so some transient errors may drop deployments out of the queue.
2017-04-06 02:52:20 -07:00
Kubernetes Submit Queue b4ff65ddf2 Merge pull request #43963 from kargakis/fix-recreate-syncs
Automatic merge from submit-queue (batch tested with PRs 43963, 43965)

Wait for clean old RSs statuses in the middle of Recreate rollouts

After https://github.com/kubernetes/kubernetes/pull/43508 got merged, we started returning ReplicaSets with no pods but with stale statuses back to the rollout functions. As a consequence, one of our e2e tests that checks if a Recreate Deployment runs pods from different versions, started flakying because the Deployment status may be incorrect. This change simply waits for the statuses to get cleaned up before proceeding with scaling up the new RS.

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

@kubernetes/sig-apps-bugs
2017-04-06 02:52:18 -07:00
Klaus Ma c8e6c2eecd Updated comments according to the logic. 2017-04-06 16:32:42 +08:00
Kubernetes Submit Queue e3e44b77ff Merge pull request #42964 from k82cn/update_defalt_toleration_sec
Automatic merge from submit-queue (batch tested with PRs 44084, 42964)

Updated AddOrUpdateTolerationInPod to return bool only.

Updated AddOrUpdateTolerationInPod to return bool only, as there's no case to generate error (the error was used for annotation, it'll not return error after moving to field); and also update admission & daemonset accordingly.
2017-04-05 20:45:20 -07:00
Xing Zhou 5b29afb1ad Improve event msg for PV controller when using external provisioner
Improve event msg for PV controller when using external provisioner
2017-04-05 08:49:48 +08:00
gmarek 576ad815c8 Allow swapping NotReady and Unschedulable Taints 2017-04-04 15:49:49 +02:00
Kubernetes Submit Queue 46d4c621a8 Merge pull request #42992 from NickrenREN/syncUnboundClaim
Automatic merge from submit-queue (batch tested with PRs 43453, 42992)

make sure that the volume satisfies the requirements of the claim before binding

check if the volume requested by the claim satisfies the requirements of the claim before binding when
syncUnboundClaim and claim.Spec.VolumeName is not set, although the volume is asked by user


**Release note**:
```release-note
NONE
```
2017-04-04 04:27:19 -07:00
zhangxiaoyu-zidif 932ece5cfd e3d534b2c4 2017-04-04 14:16:34 +08:00
Kubernetes Submit Queue 05c046f6d3 Merge pull request #43810 from gnufied/add-gnufied-vol-controller
Automatic merge from submit-queue

Adding gnufied as reviewer for volume controller

I have helped review several PRs and made new
PRs to this area.

cc @childsb @saad-ali
2017-04-03 12:46:25 -07:00
NickrenREN f922af5138 make sure that the volume satisfies the requirements of the claim before binding
check if the volume requested by the claim satisfies the requirements of the claim before binding when
syncUnboundClaim and claim.Spec.VolumeName is not set
2017-04-04 01:03:37 +08:00
Kubernetes Submit Queue 50763cb6be Merge pull request #43627 from pospispa/make-constants-public-so-that-they-can-be-used-in-an-external-provisioner
Automatic merge from submit-queue

Make Constants Public so that They Can Be Used in an Ext. Provisioner

Out-of-tree external provisioners have the same purpose as in-tree provisioners. As external provisioners work with PV and PVC datastructures it's an advantage to import certain Kubernetes packages instead of copy-pasting the Kubernetes code.

That's why the constants are made public so that they can be used in an external provisioner.

@jsafrane  @kubernetes/sig-storage-pr-reviews 

```
NONE
```
2017-04-03 06:43:03 -07:00
Michail Kargakis 189eec69d7 Update deployment retries to a saner count 2017-04-02 21:33:51 +02:00
Michail Kargakis 97fed0aff4 Wait for clean old RSs statuses in the middle of Recreate rollouts 2017-04-02 20:06:25 +02:00
Kubernetes Submit Queue 4fa902a915 Merge pull request #43933 from childsb/add_approver
Automatic merge from submit-queue

update pkg/controller/volume/OWNER to add appropriate approvers for both volume controllers

Update pkg/controller/volume approvers so that the attach/detach and binding controllers have approvers.
2017-04-01 11:37:15 -07:00
Kubernetes Submit Queue fff5fae0a0 Merge pull request #43289 from tsmetana/adc-race-fix
Automatic merge from submit-queue

Attach/detach controller: fix potential race in constructor

**What this PR does / why we need it**:
There is a potential race condition in the Attach/detach controller: The "constructor" first installs informer event handlers and then creates and initializes the other data structures. However there is no guarantee an event cannot arrive before the data structures required by the event handlers are ready. This may result in nil pointer derefernces and potential crashes (e.g. the nodeAdd method calls adc.actualStateOfWorld.SetNodeStatusUpdateNeeded even though the actualStateOfWorld might be still nil).

It should be enough just to move the event handlers installation at the end of the constructor function.

**Release note**:

```release-note
NONE
```
2017-03-31 17:30:36 -07:00
childsb 308a3a8c45 Update OWNERS with approvers to cover both volume controllers. 2017-03-31 18:26:42 -05:00
FengyunPan c0f5b38647 Fix Judgment statement
The 'i' can not be equal to updateNodeStatusMaxRetries in
updateNetworkingCondition(), and can not get error.
Let's update it.
2017-03-31 18:56:38 +08:00
Kubernetes Submit Queue 05cd33b29e Merge pull request #43508 from shiywang/first-deploy
Automatic merge from submit-queue

Fix scaled down deployments cannot identify old replica sets

Fixes https://github.com/kubernetes/kubernetes/issues/42570
2017-03-29 20:42:31 -07:00
shiywang 49161d1b18 fix Scaled down deployments cannot identify old replica sets 2017-03-30 00:13:28 +08:00
Hemant Kumar 39ec7c7400 Adding myself as reviewer for volume controller
I have helped review several PRs and made new
PRs to this area.
2017-03-29 10:42:44 -04:00
knightXun 3206f96d70 Update stateful_set_utils.go
find a syntax error,please check it.
2017-03-29 20:21:13 +08:00
Christoph Blecker 6681835b0c
Fix gofmt errors 2017-03-28 17:12:04 -07:00
deads2k 8e26fa25da wire in aggregation 2017-03-27 09:44:10 -04:00
Kubernetes Submit Queue 81d9e7f68a Merge pull request #42721 from NickrenREN/pv-provisionClaimOperation
Automatic merge from submit-queue

fix createProvisionedPV result err judgenment bug

When ctrl.kubeClient.Core().PersistentVolumes().Create(volume) returns no err, and storeVolumeUpdate() fails, we save PV sucessfully ,but here err is not nil,we should not run the codes next in block if err != nil {} to delete the storage asset.
same in the deletion retries below
change the err names to make it clear
**Release note**:
```release-note
NONE
```
@jsafrane @saad-ali  PTAL. Thanks
2017-03-26 23:30:34 -07:00
Kubernetes Submit Queue 2169beed23 Merge pull request #43555 from NickrenREN/pv-setClaimProvisioner
Automatic merge from submit-queue

Fix PVC Annotations

annDynamicallyProvisioned is added to PV, while PVC has annStorageProvisioner.


**Release note**:

```release-note
NONE
```
2017-03-26 22:36:45 -07:00
Kubernetes Submit Queue b6312d9dd5 Merge pull request #43429 from supereagle/remove-duplicated-import
Automatic merge from submit-queue (batch tested with PRs 43429, 43416, 43312, 43141, 43421)

remove duplicated import

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

**Which issue this PR fixes**:

**Special notes for your reviewer**:

**Release note**:

```
NONE
```
2017-03-25 22:24:21 -07:00
Kubernetes Submit Queue 2209503a0f Merge pull request #43384 from junxu/remove-unused-argument-in-cronjobcontoller
Automatic merge from submit-queue (batch tested with PRs 43378, 43216, 43384, 43083, 43428)

Remove unused argument of 'groupJobsByParent' in cronjob controller

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-03-25 21:22:25 -07:00
NickrenREN 1dc323a8f9 remove NewCloudNodeController() second return value
NewCloudNodeController() will never return err,remove it
2017-03-25 10:54:01 +08:00
NickrenREN 0ab9f6fe55 fix createProvisionedPV result err judgenment bug
When ctrl.kubeClient.Core().PersistentVolumes().Create(volume) returns no err, but storeVolumeUpdate() failed, we save PV sucessfully ,but here err is not nil,
we should not run the codes next in block if err != nil {}
same in the deletion retries below
2017-03-25 10:48:16 +08:00
NickrenREN 5d1c7c77b4 Fix PVC Annotations
annDynamicallyProvisioned is added to PV, PVC has annStorageProvisioner
2017-03-25 10:42:04 +08:00
Kubernetes Submit Queue d585eb3035 Merge pull request #42631 from NickrenREN/pv-isVolumeBoundToClaim-1
Automatic merge from submit-queue (batch tested with PRs 42522, 42545, 42556, 42006, 42631)

optimize the binding logic of bindClaimToVolume

extract var shouldSetBoundByController and do not need to judge volumename twice
**Release note**:
```release-note
NONE
```
2017-03-24 15:10:35 -07:00
Kubernetes Submit Queue d2175bab9a Merge pull request #42522 from NickrenREN/pv-err-print
Automatic merge from submit-queue

print err message when update store failed

```release-note
NONE
```
2017-03-24 15:06:49 -07:00
Kubernetes Submit Queue f22e621f7b Merge pull request #42237 from kargakis/remove-extra-deep-copy
Automatic merge from submit-queue

controller: drop extra rs deep-copy

@janetkuo @mwielgus
2017-03-24 14:04:22 -07:00
Dmitry1987 965dab366b make hpa upscale and downscale delay window configurable 2017-03-24 18:01:04 +00:00
Kubernetes Submit Queue 7e6b8c19b9 Merge pull request #43302 from harryge00/fix-typo
Automatic merge from submit-queue

fix typos

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-03-24 10:27:18 -07:00
Kubernetes Submit Queue 596fc98c60 Merge pull request #43071 from zjj2wry/master
Automatic merge from submit-queue

add comment end
2017-03-24 10:27:10 -07:00
Kubernetes Submit Queue 3b1d2343a8 Merge pull request #43208 from NickrenREN/rc-expectation
Automatic merge from submit-queue

small change to ControlleeExpectations result judgement

GetByKey() will never return err, so err != nil {} is redundant,remove it and remove the err return too


**Release note**:
```release-note
NONE
```
2017-03-24 10:27:01 -07:00
Kubernetes Submit Queue 1aff24cb53 Merge pull request #43217 from SEJeff/fix-spelling-tyop
Automatic merge from submit-queue

Fix spelling of the word successfully

A serious business project like kubernetes necessitates serious business logs.
2017-03-24 10:26:54 -07:00
Kubernetes Submit Queue 6ae0199eb0 Merge pull request #42402 from jorenhehe/pv-typo
Automatic merge from submit-queue

fix pv_controller typos

```release-note
NONE
```
2017-03-24 10:25:55 -07:00
Kubernetes Submit Queue d3ebfb2ffb Merge pull request #42311 from timchenxiaoyu/amounttypo
Automatic merge from submit-queue

fix amount typo
2017-03-24 10:25:34 -07:00
pospispa 1fdd163dd1 Make Some Constants Public so that They Can Be Used in an External Provisioner
Out-of-tree external provisioners have the same purpose as in-tree provisioners. As external provisioners work with PV and PVC datastructures it's an advantage to import certain Kubernetes packages instead of copy-pasting the Kubernetes code.

That's why the constants are made public so that they can be used in an external provisioner.
2017-03-24 17:09:51 +01:00
Jeff Schroeder a5afdfa17f
Fix spelling of the word successfully
Auto-generated via:
    git grep -l [Ss]uccesfully  | xargs sed -ri 's/([sS])uccesfully/\1uccessfully/g'

I noticed this when running kube-scheduler with --v4 and it is annoying.
Then manually reverted changed to the vendored bits.
2017-03-22 18:33:11 -05:00
Kubernetes Submit Queue 00938eac64 Merge pull request #42741 from kargakis/avoid-ns-skew
Automatic merge from submit-queue (batch tested with PRs 43481, 43419, 42741, 43480)

controller: work around milliseconds skew in AddAfter

AddAfter is not requeueing precisely after the provided time and may
skew for some millieseconds. This is really important because controllers
don't relist often so a missed check because of ms difference is
essentially dropping the key. For example, in [1] the test requeues a
Deployment for a progress check after 10s[2] but the Deployment is synced
9ms earlier ending up in the controller not recognizing the Deployment as
failed thus dropping it from the queue w/o any error. The drop is fixed by
forcing the controller to resync the Deployment but we are going to resync
after the full duration.

@deads2k if you don't like this I am going to handle this on a case by case basis

[1] https://github.com/kubernetes/kubernetes/issues/39785#issuecomment-279959133
[2] c48b2cab0f/test/e2e/deployment.go (L1122)
2017-03-21 19:29:27 -07:00
Kubernetes Submit Queue eb77144474 Merge pull request #42715 from DirectXMan12/bug/infinite-hpa
Automatic merge from submit-queue

Rate limit HPA controller to sync period

Since the HPA controller pulls information from an external source that
makes no guarantees about consistency, it's possible for the HPA
to get into an infinite update loop -- if the metrics change with
every query, the HPA controller will run it's normal reconcilation,
post a status update, see that status update itself, fetch new metrics,
and if those metrics are different, post another status update, and
repeat.  This can lead to continuously updating a single HPA.
    
By rate-limiting each HPA to once per sync interval, we prevent this
from happening.

**Release note**:
```release-note
NONE
```
2017-03-21 14:26:16 -07:00