Commit Graph

2673 Commits (c31893978ba63af548e125f57a755c0c1ab77a2b)

Author SHA1 Message Date
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
Michail Kargakis 68b78282d7 controller: work around milliseconds skew in AddAfter 2017-03-21 16:39:32 -04:00
supereagle 29c831aabd remove duplicated import 2017-03-21 14:45:26 +08:00
Kubernetes Submit Queue bc82d87f0a Merge pull request #43398 from enisoc/deletion-race-flake
Automatic merge from submit-queue

Deflake TestSyncDeploymentDeletionRace

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

The cache was sometimes catching up while we were testing the case
where the cache is not yet caught up.

Before this fix, I could reproduce the failure with the following
command. After the fix, it passes.

```
go test -count 100000 -run TestSyncDeploymentDeletionRace
```

I checked the other controllers, and they all were already not starting informers for the deletion race test. I also checked that the deletion race tests for other controllers all pass with `-count 100000`.

**Which issue this PR fixes**:

Fixes #43390

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2017-03-20 13:26:03 -07:00
Anthony Yeh 0b9233648e Deflake TestSyncDeploymentDeletionRace
The cache was sometimes catching up while we were testing the case
where the cache is not yet caught up.

Before this fix, I could reproduce the failure with the following
command. After the fix, it passes.

```
go test -count 100000 -run TestSyncDeploymentDeletionRace
```
2017-03-20 11:13:26 -07:00
xujun e626e45b4d Remove unused argument of 'groupJobsByParent' function in cronjob controller. 2017-03-20 12:43:10 -04:00
Anthony Yeh f4ee44eb39 RC/RS: Check that ControllerRef UID matches found controller.
Otherwise, we may confuse a former controller by that name with a new
one that has the same name.
2017-03-20 08:57:42 -07:00
Kubernetes Submit Queue 47320fd3f0 Merge pull request #42938 from enisoc/orphan-race
Automatic merge from submit-queue

GC: Fix re-adoption race when orphaning dependents.

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

The GC expects that once it sees a controller with a non-nil
DeletionTimestamp, that controller will not attempt any adoption.
There was a known race condition that could cause a controller to
re-adopt something orphaned by the GC, because the controller is using a
cached value of its own spec from before DeletionTimestamp was set.

This fixes that race by doing an uncached quorum read of the controller
spec just before the first adoption attempt. It's important that this
read occurs after listing potential orphans. Note that this uncached
read is skipped if no adoptions are attempted (i.e. at steady state).

**Which issue this PR fixes**:

Fixes #42639

**Special notes for your reviewer**:

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

cc @kubernetes/sig-apps-pr-reviews
2017-03-20 01:30:11 -07:00
haoyuan 2b85ca8e00 fix typos 2017-03-18 22:45:07 +08:00
Anthony Yeh b4b8fdbca3 GC: Fix re-adoption race when orphaning dependents.
The GC expects that once it sees a controller with a non-nil
DeletionTimestamp, that controller will not attempt any adoption.
There was a known race condition that could cause a controller to
re-adopt something orphaned by the GC, because the controller is using a
cached value of its own spec from before DeletionTimestamp was set.

This fixes that race by doing an uncached quorum read of the controller
spec just before the first adoption attempt. It's important that this
read occurs after listing potential orphans. Note that this uncached
read is skipped if no adoptions are attempted (i.e. at steady state).
2017-03-17 15:39:26 -07:00
Kubernetes Submit Queue f37cffcf4e Merge pull request #43239 from enisoc/kubectl-controller-ref
Automatic merge from submit-queue

kubectl: Use v1.5-compatible ownership logic when listing dependents.

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

This restores compatibility between kubectl 1.6 and clusters running Kubernetes 1.5.x. It introduces transitional ownership logic in which the client considers ControllerRef when it exists, but does not require it to exist.

If we were to ignore ControllerRef altogether (pre-1.6 client behavior), we would introduce a new failure mode in v1.6 because controllers that used to get stuck due to selector overlap will now make progress. For example, that means when reaping ReplicaSets of an overlapping Deployment, we would risk deleting ReplicaSets belonging to a different Deployment that we aren't about to delete.

This transitional logic avoids such surprises in 1.6 clusters, and does no worse than kubectl 1.5 did in 1.5 clusters. To prevent this when kubectl 1.5 is used against 1.6 clusters, we can cherrypick this change.

**Which issue this PR fixes**:

Fixes #43159

**Special notes for your reviewer**:

**Release note**:
```release-note
```
2017-03-17 14:25:38 -07:00
Kubernetes Submit Queue fe08925805 Merge pull request #42869 from better88/patch-1
Automatic merge from submit-queue

Fix revision when SetDeploymentRevision

When some oldRSs be deleted or cleared(eg. revisionHistoryLimit set 0), the revision for  SetDeploymentRevision is incorrect
2017-03-17 10:55:29 -07:00
better88 6c13a02026 Fix revision when SetDeploymentRevision 2017-03-17 23:23:41 +08:00
Tomas Smetana 6898bc60ce Attach/detach controller: fix potential race in constructor 2017-03-17 13:34:53 +01:00
NickrenREN aeedcbfb5e small change to ControlleeExpectations 2017-03-17 09:48:32 +08:00
Anthony Yeh de92f90f12 Deployment: Clear obsolete OverlapAnnotaiton.
This ensures old clients will not assume the Deployment is blocked.
2017-03-16 14:52:01 -07:00
Chao Xu 33da82bc67 construction of GC should not fail for restmapper error caused by tpr 2017-03-16 14:19:17 -07:00
Anthony Yeh fa23729a6d kubectl: Use v1.5-compatible ownership logic when listing dependents.
In particular, we should not assume ControllerRefs are necessarily set.
However, we can still use ControllerRefs that do exist to avoid
interfering with controllers that do use it.
2017-03-16 12:28:38 -07:00
Anthony Yeh 725ec0cc5e kubectl: Check for Deployment overlap annotation in reaper.
This effectively reverts the client-side changes in
cec3899b96.
We have to maintain the old behavior on the client side to support
version skew when talking to old servers that set the annotation.

However, the new server-side behavior is still to NOT set the
annotation.
2017-03-16 12:28:28 -07:00
Kubernetes Submit Queue 0afdcfcaf6 Merge pull request #43114 from enisoc/deployment-upgrade-test
Automatic merge from submit-queue

Fix Deployment upgrade test.

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

When the upgrade test operates on Deployments in a pre-1.6 cluster (i.e. during the Setup phase), it needs to use the v1.5 deployment/util logic. In particular, the v1.5 logic does not filter children to only those with a matching ControllerRef.

**Which issue this PR fixes**:

Fixes #42738

**Special notes for your reviewer**:

**Release note**:
```release-note
```
cc @kubernetes/sig-apps-pr-reviews
2017-03-15 07:03:19 -07:00
Anthony Yeh 0c015927c4 Fix Deployment upgrade test.
When the upgrade test operates on Deployments in a pre-1.6 cluster
(i.e. during the Setup phase), it needs to use the v1.5 deployment/util
logic. In particular, the v1.5 logic does not filter children to only
those with a matching ControllerRef.
2017-03-14 17:39:29 -07:00
Chao Xu 0605ba7a6d wait for garbagecollector to be synced in test 2017-03-14 16:19:33 -07:00
zhengjiajin 996200b71e update annotations 2017-03-14 20:03:31 +08:00
Klaus Ma 3f24d46564 Removed err from return value of AddOrUpdateTolerationInPod. 2017-03-13 22:37:41 +08:00
Klaus Ma d0e04427d7 Fixed incorrect result of getMinTolerationTime. 2017-03-12 20:21:14 +08:00
Kubernetes Submit Queue 3f660a9779 Merge pull request #42913 from aveshagarwal/master-fix-taint-based-eviction-no-node-cidr
Automatic merge from submit-queue

Fix taint based pod eviction for clusters where controller manager is not running with allocate-node-cidrs set

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

In my cluster, I have not set allocate-node-cidr, and It is causing taint based pod eviction to fail. 

@gmarek @kubernetes/sig-scheduling-bugs @davidopp @derekwaynecarr
2017-03-11 14:02:45 -08:00
Kubernetes Submit Queue 486ec2b7c9 Merge pull request #42862 from caesarxuchao/sync-warning
Automatic merge from submit-queue (batch tested with PRs 38805, 42362, 42862)

Let GC print specific message for RESTMapping failure

Make the error messages reported in https://github.com/kubernetes/kubernetes/issues/39816 to be more specific, also only print the message once.

I'll also update the garbage collector's doc to clearly state we don't support tpr yet.

We'll wait for the watchable discovery feature (@sttts are you going to work on that?) to land in 1.7, and then enable the garbage collector to handle TPR.

cc @hongchaodeng @MikaelCluseau @djMax
2017-03-10 14:01:23 -08:00
Avesh Agarwal c3a80719a2 Fix taint based pod eviction for clusters where controller manager
is not running with --allocate-node-cidrs set.
2017-03-10 15:39:21 -05:00
Chao Xu d7aef0a338 Let GC print specific message for RESTMapping failure 2017-03-10 11:38:57 -08:00
gmarek fddac63c27 Remove unused functions and make logs slightly better 2017-03-10 11:57:51 +01:00
Kubernetes Submit Queue 1f5708d460 Merge pull request #42640 from lukaszo/ds-updates-fix
Automatic merge from submit-queue (batch tested with PRs 42024, 42780, 42808, 42640)

kubectl: respect DaemonSet strategy parameters for rollout status

It handles "after-merge" comments from #41116

cc @kargakis @janetkuo 

I will add one more e2e test later. I need to handle some in company stuff.
2017-03-09 16:41:54 -08:00
Kubernetes Submit Queue 7002c53a9c Merge pull request #42808 from ravisantoshgudimetla/nodecontroller_eviction_flake
Automatic merge from submit-queue (batch tested with PRs 42024, 42780, 42808, 42640)

Node controller test flake 39975 with delay for try function

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

/cc @ncdc @gmarek @liggitt
2017-03-09 16:41:52 -08:00
Solly Ross 8337031bf5 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.
2017-03-09 16:32:01 -05:00
ravisantoshgudimetla 7d444263a5 Change from Micro to Milli for introducing delay 2017-03-09 14:10:28 -05:00
Łukasz Oleś b32afe1720 kubectl: respect DaemonSet strategy parameters for rollout status
It handles "after-merge" comments from #41116
2017-03-09 20:02:52 +01:00
gmarek 48d784272e Move taint eviction feature flag to feature-gates 2017-03-08 10:04:18 +01:00
Kubernetes Submit Queue d306acca86 Merge pull request #42175 from enisoc/controller-ref-dep
Automatic merge from submit-queue

Deployment: Fully 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 Deployment into full compliance with ControllerRef. See the individual commit messages for details.

**Which issue this PR fixes**:

This ensures that Deployment does not fight with other controllers over control of Pods and ReplicaSets.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Deployment now fully respects ControllerRef to avoid fighting over Pods and ReplicaSets. At the time of upgrade, **you must not have Deployments with selectors that overlap**, or else [ownership of ReplicaSets may change](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md#upgrading).
```
cc @erictune @kubernetes/sig-apps-pr-reviews
2017-03-07 20:44:36 -08:00
Anthony Yeh fac372d090 DaemonSet: Relist Pods before each phase of sync.
The design of DaemonSet requires a relist before each phase (manage,
update, status) because it does not short-circuit and requeue for each
action triggered.
2017-03-07 16:42:29 -08:00
Anthony Yeh 182753f841 DaemonSet: Check that ControllerRef UID matches. 2017-03-07 16:42:29 -08:00
Anthony Yeh 97c363a3e0 DaemonSet: Always set BlockOwnerDeletion in ControllerRef. 2017-03-07 16:42:29 -08:00
Anthony Yeh ab5a82d6e6 DaemonSet: Don't log Pod events unless some DaemonSet cares. 2017-03-07 16:42:29 -08:00
Anthony Yeh 1099811833 DaemonSet: 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-03-07 16:42:28 -08:00
Anthony Yeh 421e0bbd83 DaemonSet: Use ControllerRefManager to adopt/orphan. 2017-03-07 16:42:28 -08:00
Anthony Yeh 8f3a56f582 DaemonSet: Add ControllerRef on all created Pods. 2017-03-07 16:42:28 -08:00
Kubernetes Submit Queue c9d4e60131 Merge pull request #42634 from gmarek/nc_test_sleep
Automatic merge from submit-queue

Extend the sleep time in the NC unit test

Ref. https://github.com/kubernetes/kubernetes/issues/39975#issuecomment-284600278
2017-03-07 09:11:35 -08:00
Kubernetes Submit Queue 74c60fbd71 Merge pull request #42633 from gmarek/nc_logs
Automatic merge from submit-queue (batch tested with PRs 41890, 42593, 42633, 42626, 42609)

Improve NodeControllers logs
2017-03-07 08:10:43 -08:00
Kubernetes Submit Queue ed04316828 Merge pull request #41890 from soltysh/issue37166
Automatic merge from submit-queue (batch tested with PRs 41890, 42593, 42633, 42626, 42609)

Remove everything that is not new from batch/v2alpha1

Fixes #37166.

@lavalamp you've asked for it 
@erictune this is a prereq for moving CronJobs to beta. I initially planned to put all in one PR, but after I did that I figured out it'll be easier to review separately. ptal 

@kubernetes/api-approvers @kubernetes/sig-api-machinery-pr-reviews ptal
2017-03-07 08:10:38 -08:00
gmarek 65f556788e Extend the sleep time in the NC unit test 2017-03-07 10:48:37 +01:00
gmarek 0db355a8ca Improve NodeControllers logs 2017-03-07 10:29:57 +01:00
NickrenREN 10779c8bcc optimize the binding logic of bindClaimToVolume 2017-03-07 17:04:04 +08:00
Kubernetes Submit Queue 4f57c107df Merge pull request #42596 from enisoc/e2e-rc
Automatic merge from submit-queue (batch tested with PRs 42506, 42585, 42596, 42584)

RC/RS: Fix ignoring inactive Pods.

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

Fix typo that broke ignoring of inactive Pods in RC, and add unit test for that case.

**Which issue this PR fixes**:

Fixes #37479

**Special notes for your reviewer**:

**Release note**:

```release-note
```
2017-03-06 22:20:13 -08:00
Kubernetes Submit Queue d50a59ec66 Merge pull request #42080 from enisoc/controller-ref-ss
Automatic merge from submit-queue (batch tested with PRs 42080, 41653, 42598, 42555)

StatefulSet: 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 StatefulSet into full compliance with ControllerRef. See the individual commit messages for details.

**Which issue this PR fixes**:

Fixes #36859

**Special notes for your reviewer**:

**Release note**:

```release-note
StatefulSet now respects ControllerRef to avoid fighting over Pods. At the time of upgrade, **you must not have StatefulSets with selectors that overlap** with any other controllers (such as ReplicaSets), or else [ownership of Pods may change](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/controller-ref.md#upgrading).
```
cc @erictune @kubernetes/sig-apps-pr-reviews
2017-03-06 17:16:10 -08:00
Anthony Yeh e9e8fe6c32 RC/RS: Fix ignoring inactive Pods. 2017-03-06 15:51:53 -08:00
Anthony Yeh 8c4bcb38fb Deployment: Filter by ControllerRef in Reaper.
We don't want to delete ReplicaSets we don't own.
2017-03-06 15:12:08 -08:00
Anthony Yeh cec3899b96 Deployment: Remove Overlap and SelectorUpdate annotations.
These are not used anymore since ControllerRef now protects against
fighting between controllers with overlapping selectors.
2017-03-06 15:12:08 -08:00
Anthony Yeh 94b3c216a1 Deployment: Consolidate Adopt/Release unit tests. 2017-03-06 15:12:08 -08:00
Anthony Yeh f2a2895a78 Deployment: Check that ControllerRef UID matches. 2017-03-06 15:12:07 -08:00
Anthony Yeh 111b9ce9b5 Deployment: Fix data race in unit tests. 2017-03-06 15:12:07 -08:00
Anthony Yeh d96c4847b6 Deployment: Filter Pods by Deployment selector in addition to ControllerRef.
Deployment should ignore Pods that don't match the selector, even if
they have a ControllerRef pointing to one of the ReplicaSets it owns.
The ReplicaSet itself will orphan the Pod as soon as it syncs.
2017-03-06 15:12:07 -08:00
Anthony Yeh 37534b66df Deployment: Always set BlockOwnerDeletion in ControllerRef. 2017-03-06 15:12:07 -08:00
Anthony Yeh 0d9c9bfee0 Deployment: 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-03-06 15:12:07 -08:00
Anthony Yeh 887acb07ea Deployment/util: Filter by ControllerRef.
The list functions in deployment/util are used outside the Deployment
controller itself. Therefore, they don't do actual adoption/orphaning.
However, they still need to avoid listing things that don't belong.
2017-03-06 15:12:06 -08:00
Anthony Yeh 92d75cbb23 Deployment: Use ControllerRef to list controlled objects.
Although Deployment already applied its ControllerRef to adopt matching
ReplicaSets, it actually still used label selectors to list objects that
it controls. That meant it didn't actually follow the rules of
ControllerRef, so it could still fight with other controller types.

This should mean that the special handling for overlapping Deployments
is no longer necessary, since each Deployment will only see objects that
it owns (via ControllerRef).
2017-03-06 15:12:06 -08:00
Kubernetes Submit Queue beddc4f68d Merge pull request #42535 from kargakis/require-deployment-requeue-for-rollback
Automatic merge from submit-queue (batch tested with PRs 31783, 41988, 42535, 42572, 41870)

controller: ensure deployment rollback is re-entrant

Make rollbacks re-entrant in the Deployment controller, otherwise
fast enqueues of a Deployment may end up in undesired behavior
- redundant rollbacks.

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

@kubernetes/sig-apps-bugs
2017-03-06 11:30:16 -08:00
Anthony Yeh 399c19a2ad StatefulSet: Check that ControllerRef UID matches. 2017-03-06 10:36:41 -08:00
Anthony Yeh 6679a5a31f StatefulSet: Always set BlockOwnerDeletion in ControllerRef. 2017-03-06 09:46:03 -08:00
Anthony Yeh 2248187536 StatefulSet: Don't log Pod events unless some StatefulSet cares. 2017-03-06 09:46:03 -08:00
Anthony Yeh ea85a201c7 StatefulSet: 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-03-06 09:46:03 -08:00
Anthony Yeh e4f67c8170 StatefulSet: Use ControllerRefManager to adopt/orphan. 2017-03-06 09:46:03 -08:00
Anthony Yeh b7163bdb75 ControllerRefManager: Allow matching by more than just selector. 2017-03-06 09:46:03 -08:00
Anthony Yeh b5dfc7b2aa StatefulSet: Add ControllerRef on all created Pods. 2017-03-06 09:46:03 -08:00
Anthony Yeh f269e78ebc StatefulSet: Don't touch Pods if DeletionTimestamp is set. 2017-03-06 09:46:03 -08:00
Michail Kargakis 0eeef8e683 controller: ensure deployment rollback is re-entrant
Make rollbacks re-entrant in the Deployment controller, otherwise
fast enqueues of a Deployment may end up in undesired behavior
- redundant rollbacks.
2017-03-06 14:30:32 +01:00
Maciej Szulik a6b9dee6b6 Generated changes for cleaning batch/v2alpha1 2017-03-06 12:26:52 +01:00
Maciej Szulik 7cba9d9c92 Issue 37166: remove everything from batch/v2alpha1 that is not new 2017-03-06 12:12:38 +01:00
Kubernetes Submit Queue 90a4eda96b Merge pull request #41809 from kargakis/rollout-status-fix
Automatic merge from submit-queue

kubectl: respect deployment strategy parameters for rollout status

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

`rollout status` now respects the strategy parameters for a RollingUpdate Deployment. This means that it will exit as soon as minimum availability is reached for a rollout (note that if you allow maximum availability, `rollout status` will succeed as soon as the new pods are created)

@janetkuo @AdoHe ptal
2017-03-04 19:35:21 -08:00
Kubernetes Submit Queue b70a5b19cf Merge pull request #42519 from jbeda/fix-tokencleaner
Automatic merge from submit-queue

Small fix to the bootstrap TokenCleaner

Accidentally missed setting options and so the TokenCleaner was in a retry loop.  Also moved from using an explicit timer over cached values vs. relying on a short resync timeout.

```release-note
```

Putting this in the 1.6 milestone as this is clearly a bug fix in a new feature.
2017-03-04 10:42:24 -08:00
Kubernetes Submit Queue 52f4d38069 Merge pull request #42370 from janetkuo/ds-e2e-ignore-no-schedule-taint
Automatic merge from submit-queue (batch tested with PRs 42456, 42457, 42414, 42480, 42370)

In DaemonSet e2e test, don't check nodes with NoSchedule taints

Fixes #42345 

For example, master node has a ismaster:NoSchedule taint. We don't expect pods to be created there without toleration. 

cc @marun @lukaszo @kargakis @yujuhong @Random-Liu @davidopp @kubernetes/sig-apps-pr-reviews
2017-03-04 00:17:47 -08:00
Kubernetes Submit Queue ccaa1cc6bb Merge pull request #42480 from kargakis/update-log-verbosity-deployments
Automatic merge from submit-queue (batch tested with PRs 42456, 42457, 42414, 42480, 42370)

controller: reduce log verbosity for deployments

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

Labeling as a bug fix since I think excessive logging should be considered as a bug.

@kubernetes/sig-apps-bugs
2017-03-04 00:17:45 -08:00
Kubernetes Submit Queue 204ffda1a5 Merge pull request #42414 from lukaszo/ds-taint
Automatic merge from submit-queue (batch tested with PRs 42456, 42457, 42414, 42480, 42370)

Enque DaemonSet sync when node taints changed

Fixes #42398

 @kargakis @janetkuo @mdshuai PTAL
2017-03-04 00:17:44 -08:00
NickrenREN 059ffbe9b9 print err message when update store failed 2017-03-04 15:49:25 +08:00
Joe Beda 100d4c3b1f
Small fix to the bootstrap TokenCleaner
Accidentally missed setting options and so the TokenCleaner was in a retry loop.  Also moved from using an explicit timer over cached values vs. relying on a short resync timeout.

Signed-off-by: Joe Beda <joe.github@bedafamily.com>
2017-03-03 20:49:18 -08:00
Kubernetes Submit Queue e9bbfb81c1 Merge pull request #41306 from gnufied/implement-interface-bulk-volume-poll
Automatic merge from submit-queue (batch tested with PRs 41306, 42187, 41666, 42275, 42266)

Implement bulk polling of volumes

This implements Bulk volume polling using ideas presented by
justin in https://github.com/kubernetes/kubernetes/pull/39564

But it changes the implementation to use an interface
and doesn't affect other implementations.

cc @justinsb
2017-03-03 10:54:38 -08:00
Kubernetes Submit Queue 66a0311fd3 Merge pull request #42429 from kargakis/sts-observed-generation-fix
Automatic merge from submit-queue (batch tested with PRs 42365, 42429, 41770, 42018, 35055)

controller: statefulsets respect observed generation

StatefulSets do not update ObservedGeneration even though the API field is in place. This means that clients can never be sure whether the StatefulSet controller has observed the latest spec of a StatefulSet.

@kubernetes/sig-apps-bugs
2017-03-03 09:24:42 -08:00
Michail Kargakis d70e63c231 controller: reduce log verbosity for deployments 2017-03-03 14:34:11 +01:00
Michail Kargakis d20ac8766e kubectl: respect deployment strategy parameters for rollout status 2017-03-03 14:12:08 +01:00
timchenxiaoyu 811a334be9 fix request typo 2017-03-03 17:22:38 +08:00
timchenxiaoyu 7bb12b68ca fix resource typo 2017-03-03 17:10:39 +08:00
Janet Kuo 16b88e7e14 Add unit test for daemonset with network unavailable node 2017-03-02 16:04:40 -08:00
Janet Kuo 7bdf54a30a In DaemonSet e2e test, don't check nodes with NoSchedule taints 2017-03-02 16:04:39 -08:00
Hemant Kumar 786da1de12 Impement bulk polling of volumes
This implements Bulk volume polling using ideas presented by
justin in https://github.com/kubernetes/kubernetes/pull/39564

But it changes the implementation to use an interface
and doesn't affect other implementations.
2017-03-02 14:59:59 -05:00
Kubernetes Submit Queue 053458cc83 Merge pull request #41984 from enisoc/controller-ref-rc-rs
Automatic merge from submit-queue (batch tested with PRs 41984, 41682, 41924, 41928)

RC/RS: Fully 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 ReplicaSet and ReplicationController into full compliance with ControllerRef. See the individual commit messages for details.

**Which issue this PR fixes**:

Although RC/RS had partially implemented ControllerRef, they didn't use it to determine which controller to sync, or to update expectations. This could lead to instability or controllers getting stuck.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
```
cc @erictune @kubernetes/sig-apps-pr-reviews
2017-03-02 10:51:05 -08:00
Michail Kargakis dbab67aa32 controller: statefulsets respect observed generation 2017-03-02 19:43:06 +01:00
Łukasz Oleś 5dbb8e0d24 Enque DaemonSet sync when node taints changed
Fixes #42398
2017-03-02 16:35:43 +01:00
Jan Safranek 9487552e41 Regenerate everything 2017-03-02 10:23:58 +01:00
Jan Safranek 52adaa16e0 PV controller: use attributes instead of beta annotations in unit tests 2017-03-02 10:23:56 +01:00
Jan Safranek 0097adc1c5 PV controller: Set StorageClassName during provisioning 2017-03-02 10:23:56 +01:00
Jan Safranek 7ae4152712 Move PV/PVC annotations to PV/PVC types.
They aren't part of storage.k8s.io/v1 or v1beta1 API.
Also move associated *GetClass functions.
2017-03-02 10:23:55 +01:00
jorenhehe 42c39d6aaa fix pv_controller typos 2017-03-02 16:28:30 +08:00
Anthony Yeh 2c2fc9c707 RC/RS: Don't log Pod events unless some RC/RS actually cares. 2017-03-01 15:43:51 -08:00
Anthony Yeh 01d025a7cc ControllerRefManager: Don't always filter inactive Pods.
Some controllers, like DaemonSet, want to see all Pods.
2017-03-01 15:43:51 -08:00
Anthony Yeh db6665251a RC/RS: Don't requeue on error inside sync function.
Returning an error from the sync function already triggers a requeue
in processNextWorkItem().
2017-03-01 15:43:51 -08:00
Anthony Yeh ca13b9e532 RC/RS: 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

This also removes the need for the Pod->Controller mapping cache in RC
and RS. This mapping is now persisted in the Pod's ControllerRef
instead.
2017-03-01 15:43:50 -08:00
Kubernetes Submit Queue 4f7d150b22 Merge pull request #41824 from DirectXMan12/feature/hpa-v2-use-cm-api
Automatic merge from submit-queue

HPA Controller: Use Custom Metrics API

This commit switches over the HPA controller to use the custom metrics
API.  It also converts the HPA controller to use the generated client
in k8s.io/metrics for the resource metrics API.

In order to enable support, you must enable
`--horizontal-pod-autoscaler-use-rest-clients` on the
controller-manager, which will switch the HPA controller's MetricsClient
implementation over to use the standard rest clients for both custom
metrics and resource metrics.  This requires that at the least resource
metrics API is registered with kube-aggregator, and that the controller
manager is pointed at kube-aggregator.  For this to work, Heapster
must be serving the new-style API server (`--api-server=true`).

Before this merges, this will need kubernetes/metrics#2 to merge, and a godeps update to pull that in.
It's also semi-dependent on kubernetes/heapster#1537, but that is not required in order for this to merge.

**Release note**:
```release-note
Allow the Horizontal Pod Autoscaler controller to talk to the metrics API and custom metrics API as standard APIs.
```
2017-03-01 12:56:58 -08:00
Kubernetes Submit Queue cdf0cae9e4 Merge pull request #42339 from ncdc/statefulset-wait-for-pvc-sync
Automatic merge from submit-queue

statefulset: wait for pvc cache sync

#42056 switched the statefulset controller to use the pvc shared informer/lister, but accidentally left out waiting for its cache to sync.

cc @kubernetes/sig-apps-pr-reviews @kargakis @foxish @kow3ns @smarterclayton @deads2k
2017-03-01 11:05:56 -08:00
Kubernetes Submit Queue b0d2f68ce3 Merge pull request #42294 from mlmhl/deploy-controller-cachesync
Automatic merge from submit-queue

fix rsListerSynced and podListerSynced for DeploymentController

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

There is a mistake when initializing `DeploymentController`'s `rsListerSynced` and `podListerSynced` in `NewDeploymentController`, they are all initialized to `Deployment`'s `Informer`, so the `DeploymentController` maybe running before the `ReplicaSet` cache and `Pod` cache has been synced.

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

Indeed according unit test is neccessary, but this bug fix is simple, and if the tests is neccessary I will submit another PR later.

**Release note**:

```release-note
```
2017-03-01 11:05:48 -08:00
Andy Goldstein 83cd403674 statefulset: wait for pvc cache sync 2017-03-01 12:16:35 -05:00
Hemant Kumar 2d3008fc56 Implement support for mount options in PVs
Add support for mount options via annotations on PVs
2017-03-01 11:50:40 -05:00
Solly Ross d6fe1e8764 HPA Controller: Use Custom Metrics API
This commit switches over the HPA controller to use the custom metrics
API.  It also converts the HPA controller to use the generated client
in k8s.io/metrics for the resource metrics API.

In order to enable support, you must enable
`--horizontal-pod-autoscaler-use-rest-clients` on the
controller-manager, which will switch the HPA controller's MetricsClient
implementation over to use the standard rest clients for both custom
metrics and resource metrics.  This requires that at the least resource
metrics API is registered with kube-aggregator, and that the controller
manager is pointed at kube-aggregator.  For this to work, Heapster
must be serving the new-style API server (`--api-server=true`).
2017-03-01 10:21:50 -05:00
Chao Xu c3baf402f5 gc changes 2017-02-28 23:05:41 -08:00
Chao Xu e4aa9db258 generated 2017-02-28 23:05:40 -08:00
mlmhl 5440752e69 fix rsListerSynced and podListerSynced for DeploymentController 2017-03-01 14:17:51 +08:00
timchenxiaoyu c1851649f3 fix completely typo 2017-03-01 12:55:31 +08:00
timchenxiaoyu 7307f9e7a2 fix amount typo 2017-03-01 12:31:11 +08:00
Michail Kargakis b29f7d0668 controller: drop extra rs deep-copy 2017-02-28 11:28:33 +01:00
Kubernetes Submit Queue 9690771227 Merge pull request #41788 from sttts/sttts-scheme-registration-idem-potent
Automatic merge from submit-queue (batch tested with PRs 41234, 42186, 41615, 42028, 41788)

apimachinery: handle duplicated and conflicting type registration

Double registrations were leading to duplications in  `KnownKinds()`. Conflicting registrations with same gvk, but different types were not detected.
2017-02-28 00:34:11 -08:00
Kubernetes Submit Queue 2b2c04e685 Merge pull request #42028 from janetkuo/ds-critical-pods
Automatic merge from submit-queue (batch tested with PRs 41234, 42186, 41615, 42028, 41788)

Make DaemonSet respect critical pods annotation when scheduling

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Make DaemonSet respect critical pods annotation when scheduling. 
```

cc @kubernetes/sig-apps-feature-requests @erictune @vishh @liggitt @kargakis @lukaszo @piosz @davidopp
2017-02-28 00:34:08 -08:00
Kubernetes Submit Queue fbe2d15f8c Merge pull request #41234 from vishh/nodeaphase2
Automatic merge from submit-queue

Enforce Node Allocatable via cgroups

This PR enforces node allocatable across all pods using a top level cgroup as described in https://github.com/kubernetes/community/pull/348

This PR also provides an option to enforce `kubeReserved` and `systemReserved` on user specified cgroups. 

This PR will by default make kubelet create top level cgroups even if `kubeReserved` and `systemReserved` is not specified and hence `Allocatable = Capacity`.

```release-note
New Kubelet flag `--enforce-node-allocatable` with a default value of `pods` is added which will make kubelet create a top level cgroup for all pods to enforce Node Allocatable. Optionally, `system-reserved` & `kube-reserved` values can also be specified separated by comma to enforce node allocatable on cgroups specified via `--system-reserved-cgroup` & `--kube-reserved-cgroup` respectively. Note the default value of the latter flags are "".
This feature requires a **Node Drain** prior to upgrade failing which pods will be restarted if possible or terminated if they have a `RestartNever` policy.
```

cc @kubernetes/sig-node-pr-reviews @kubernetes/sig-node-feature-requests 

TODO:

- [x] Adjust effective Node Allocatable to subtract hard eviction thresholds
- [x] Add unit tests
- [x] Complete pending e2e tests
- [x] Manual testing
- [x] Get the proposal merged

@dashpole is working on adding support for evictions for enforcing Node allocatable more gracefully. That work will show up in a subsequent PR for v1.6
2017-02-27 23:55:46 -08:00
Kubernetes Submit Queue 2681e38d3a Merge pull request #42097 from kargakis/address-mismatched-available-replicas
Automatic merge from submit-queue

Enqueue controllers after minreadyseconds when all pods are ready

@janetkuo this should address https://github.com/kubernetes/kubernetes/issues/41697#issuecomment-281851377. Impossible to unit test this but it should stabilize some of our deployment e2e tests that occasionally fail because of availableReplicas not being updated.

It should also fix https://github.com/kubernetes/kubernetes/issues/41641

Eventually I would like AddAfter to be able to cancel previous invocations of the same key so I opened https://github.com/kubernetes/client-go/issues/131

@kubernetes/sig-apps-bugs
2017-02-27 22:09:46 -08:00
Vishnu kannan 9a65640789 fix go vet issues
Signed-off-by: Vishnu kannan <vishnuk@google.com>
2017-02-27 21:24:45 -08:00
Dr. Stefan Schimanski 395be3b401 apimachinery: handle duplicated and conflicting type registration 2017-02-27 21:58:21 +01:00
Kubernetes Submit Queue c274e9d715 Merge pull request #42056 from ncdc/shared-informers-16-remove-legacy-code
Automatic merge from submit-queue (batch tested with PRs 42053, 41282, 42056, 41663, 40927)

Fully remove hand-written listers and informers

Note: the first commit is from #41927. Adding do-not-merge for now as we'll want that to go in first, and then I'll rebase this on top.

Update statefulset controller to use a lister for PVCs instead of a client request. Also replace a unit test's dependency on legacylisters with the generated ones. cc @kargakis @kow3ns @foxish @kubernetes/sig-apps-pr-reviews 

Remove all references to pkg/controller/informers and pkg/client/legacylisters, and remove those packages.

@smarterclayton @deads2k this should be it!

cc @gmarek @wojtek-t @derekwaynecarr @kubernetes/sig-scalability-pr-reviews
2017-02-27 12:45:31 -08:00
Kubernetes Submit Queue b796732ae7 Merge pull request #41282 from krmayankk/garbage
Automatic merge from submit-queue (batch tested with PRs 42053, 41282, 42056, 41663, 40927)

Enable Garbage collection by default for RS and RC

Fixes https://github.com/kubernetes/kubernetes/issues/40898
2017-02-27 12:45:29 -08:00
Michail Kargakis 9eab226947 Enqueue controllers after minreadyseconds when all pods are ready 2017-02-27 19:28:15 +01:00
Janet Kuo 4c882477e9 Make DaemonSet respect critical pods annotation when scheduling 2017-02-27 09:59:45 -08:00
Andy Goldstein 171e458bab Update bazel 2017-02-27 06:48:13 -05:00
Andy Goldstein d798c65fb6 Remove legacy listers and informers 2017-02-27 06:48:13 -05:00
Andy Goldstein bd912f50ba statefulset: use pvc lister, replace legacylisters
Use a PVC lister instead of a client when retrieving PVCs.

Replace unit test's use of legacylisters with the generated listers.
2017-02-27 06:38:11 -05:00
Łukasz Oleś 7d9c817db0 Generated part for DaemonSet updates 2017-02-27 09:17:34 +01:00
Łukasz Oleś b2d9f99f0c Moved tests and fixed typs 2017-02-27 09:15:56 +01:00
Łukasz Oleś 620310c12f Move TemplateGeneration to the Spec 2017-02-27 09:15:56 +01:00
Łukasz Oleś b27308c317 DaemonSet updates
It implements https://github.com/kubernetes/community/blob/master/contributors/design-proposals/daemonset-update.md
Feature https://github.com/kubernetes/features/issues/124
2017-02-27 09:15:56 +01:00
Kubernetes Submit Queue 0b54264d3e Merge pull request #41406 from jsafrane/operation-backoff
Automatic merge from submit-queue (batch tested with PRs 41814, 41922, 41957, 41406, 41077)

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.

This just pollutes logs without any useful information:
```
E0214 08:00:30.428073   77288 pv_controller.go:1410] error scheduling operaion "delete-pvc-1fa0e8b4-f2b5-11e6-a8bb-fa163ecb84eb[1fbd52ee-f2b5-11e6-a8bb-fa163ecb84eb]": Failed to create operation with name "delete-pvc-1fa0e8b4-f2b5-11e6-a8bb-fa163ecb84eb[1fbd52ee-f2b5-11e6-a8bb-fa163ecb84eb]". An operation with that name failed at 2017-02-14 08:00:15.631133152 -0500 EST. No retries permitted until 2017-02-14 08:00:31.631133152 -0500 EST (16s). Last error: "Cannot delete the volume \"11a4faea-bfc7-4713-88b3-dec492480dba\", it's still attached to a node".
```

```release-note
NONE
```

@kubernetes/sig-storage-pr-reviews
2017-02-26 10:22:53 -08:00
Kubernetes Submit Queue dd29e6cdc7 Merge pull request #41896 from kevin-wangzefeng/daemonset-infinite-default-toleration-seconds
Automatic merge from submit-queue (batch tested with PRs 40932, 41896, 41815, 41309, 41628)

Make DaemonSets survive taint-based evictions when nodes turn unreachable/notReady

**What this PR does / why we need it**:
DaemonPods shouldn't be deleted by NodeController in case of Node problems.
This PR is to add infinite tolerations for Unreachable/NotReady NoExecute Taints, so that they won't be deleted by NodeController when a node goes unreachable/notReady.

**Which issue this PR fixes** :
fixes #41738 
Related PR: #41133


**Special notes for your reviewer**:

**Release note**:

```release-note
Make DaemonSets survive taint-based evictions when nodes turn unreachable/notReady.
```
2017-02-26 08:09:56 -08:00
Kubernetes Submit Queue 80e6492f03 Merge pull request #40932 from peay/cronjob-max-finished-jobs
Automatic merge from submit-queue (batch tested with PRs 40932, 41896, 41815, 41309, 41628)

Modify CronJob API to add job history limits, cleanup jobs in controller

**What this PR does / why we need it**:
As discussed in #34710: this adds two limits to `CronJobSpec`, to limit the number of finished jobs created by a CronJob to keep.

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

**Special notes for your reviewer**:

cc @soltysh, please have a look and let me know what you think -- I'll then add end to end testing and update the doc in a separate commit. What is the timeline to get this into 1.6?

The plan:

- [x] API changes
  - [x] Changing versioned APIs
    - [x] `types.go`
    - [x] `defaults.go` (nothing to do)
    - [x] `conversion.go` (nothing to do?)
    - [x] `conversion_test.go` (nothing to do?)
  - [x] Changing the internal structure
    - [x] `types.go`
    - [x] `validation.go`
    - [x] `validation_test.go`
  - [x] Edit version conversions
    - [x] Edit (nothing to do?)
    - [x] Run `hack/update-codegen.sh`
  - [x] Generate protobuf objects
    - [x] Run `hack/update-generated-protobuf.sh`
  - [x] Generate json (un)marshaling code
    - [x] Run `hack/update-codecgen.sh`
  - [x] Update fuzzer
- [x] Actual logic
- [x] Unit tests
- [x] End to end tests
- [x] Documentation changes and API specs update in separate commit


**Release note**:

```release-note
Add configurable limits to CronJob resource to specify how many successful and failed jobs are preserved.
```
2017-02-26 08:09:54 -08:00
Kubernetes Submit Queue 3f4ef9ae11 Merge pull request #41250 from kargakis/switch-get-from-cache
Automatic merge from submit-queue (batch tested with PRs 41621, 41946, 41941, 41250, 41729)

controller: poll replica sets from the cache
2017-02-26 06:47:00 -08:00
Jordan Liggitt 41c88e0455
Revert "Merge pull request #40088 from jsafrane/storage-ga-v1"
This reverts commit 5984607cb9, reversing
changes made to 067f92e789.
2017-02-25 22:35:15 -05:00
Kubernetes Submit Queue 5984607cb9 Merge pull request #40088 from jsafrane/storage-ga-v1
Automatic merge from submit-queue (batch tested with PRs 41854, 41801, 40088, 41590, 41911)

Add storage.k8s.io/v1 API

v1 API is direct copy of v1beta1 API. This v1 API gets installed and exposed in this PR, I tested that kubectl can create both v1beta1 and v1 StorageClass.

~~Rest of Kubernetes (controllers, examples,. tests, ...) still use v1beta1 API, I will update it when this PR gets merged as these changes would get lost among generated code.~~ Most parts use v1 API now, it would not compile / run tests without it.

**Release note**:
```
Kubernetes API storage.k8s.io for storage objects is now fully supported and is available as storage.k8s.io/v1. Beta version of the API storage.k8s.io/v1beta1 is still available in this release, however it will be removed in a future Kubernetes release.

Together with the API endpoint, StorageClass annotation "storageclass.beta.kubernetes.io/is-default-class" is deprecated and  "storageclass.kubernetes.io/is-default-class" should be used instead to mark a default storage class. The beta annotation is still working in this release, however it won't be supported in the next one.
```

@kubernetes/sig-storage-misc
2017-02-25 05:02:55 -08:00
peay 2b33de0684 Modify CronJob API to add job history limits, cleanup jobs in controller 2017-02-25 06:51:54 -05:00
Kubernetes Submit Queue 8e6af485f9 Merge pull request #41918 from ncdc/shared-informers-14-scheduler
Automatic merge from submit-queue (batch tested with PRs 41714, 41510, 42052, 41918, 31515)

Switch scheduler to use generated listers/informers

Where possible, switch the scheduler to use generated listers and
informers. There are still some places where it probably makes more
sense to use one-off reflectors/informers (listing/watching just a
single node, listing/watching scheduled & unscheduled pods using a field
selector).

I think this can wait until master is open for 1.7 pulls, given that we're close to the 1.6 freeze.

After this and #41482 go in, the only code left that references legacylisters will be federation, and 1 bit in a stateful set unit test (which I'll clean up in a follow-up).

@resouer I imagine this will conflict with your equivalence class work, so one of us will be doing some rebasing 😄 

cc @wojtek-t @gmarek  @timothysc @jayunit100 @smarterclayton @deads2k @liggitt @sttts @derekwaynecarr @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-scalability-pr-reviews
2017-02-25 02:17:55 -08:00
Kubernetes Submit Queue 734dfcb3d8 Merge pull request #41510 from kargakis/fix-progress-check-requeue
Automatic merge from submit-queue (batch tested with PRs 41714, 41510, 42052, 41918, 31515)

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.

This should also simplify the deployment controller a bit.

Fixes https://github.com/kubernetes/kubernetes/issues/39785. Once this change soaks, I will move the test out of the flaky suite.

@kubernetes/sig-apps-misc
2017-02-25 02:17:53 -08:00
Kubernetes Submit Queue 46b20acba2 Merge pull request #41876 from kargakis/add-approvers-in-rc-rs-controllers
Automatic merge from submit-queue

controller: add approvers for rc/rs
2017-02-24 15:34:27 -08:00
Jan Safranek fa93f1c411 Update imports 2017-02-24 13:52:16 +01:00