Commit Graph

3913 Commits (4c874dbefe2bd1f06a9358146be106c87b4858ce)

Author SHA1 Message Date
Kubernetes Submit Queue f01be5031c
Merge pull request #67421 from islinwb/minor-fix
Automatic merge from submit-queue (batch tested with PRs 62441, 66702, 67254, 67421, 65309). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

use glog.V().Infof() for formatting output; return nil when err's nil

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-15 15:30:24 -07:00
Kubernetes Submit Queue 939f08a24e
Merge pull request #62441 from chentao1596/certificate_controller_utils_ut
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

UT case of certificate_controller
2018-08-15 15:04:59 -07:00
Janet Kuo 3fa639f775 Add mfojtik as approver of Deployment 2018-08-15 12:15:22 -07:00
Kubernetes Submit Queue 4414ae3d75
Merge pull request #66666 from bertinatto/metrics_ad_controller
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add more metrics for A/D Controller:

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

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

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

**Release note**:

```release-note
NONE
```
2018-08-15 09:42:06 -07:00
Kubernetes Submit Queue c5e74d128d
Merge pull request #66884 from NickrenREN/attacher-detacher-refactor
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Attacher/Detacher refactor for local storage

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

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

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

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

**Special notes for your reviewer**:

```release-note
Attacher/Detacher refactor for local storage
```

/sig storage
/kind feature
2018-08-15 07:03:48 -07:00
Tomas Nozicka b0b1629e8d Update Bazel 2018-08-15 16:03:42 +02:00
Tomas Nozicka 63656da296 Add backoff for DS's pod deletion to limit fighting with kubelet failing the pod repeatedly 2018-08-15 16:03:39 +02:00
Tomas Nozicka dc2cfd5d20 Update Bazel 2018-08-15 13:34:31 +02:00
Tomas Nozicka e434f3189e Deprecate ListWatchUntil, fix it and call places 2018-08-15 13:34:31 +02:00
Fabio Bertinatto 4ce2058ef6 Add more metrics for A/D Controller:
* Number of Volumes in ActualStateofWorld and DesiredStateofWorld
* Numer of times A/D Controller performs force detach
2018-08-15 10:01:57 +02:00
Kubernetes Submit Queue cfb4a5e95a
Merge pull request #67039 from mortent/AvoidDuplicateRevisionsForStatefulSet
Automatic merge from submit-queue (batch tested with PRs 67071, 66906, 66722, 67276, 67039). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix for duplicate revisions created by StatefulSet

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Avoid creating new controller revisions for statefulsets when cache is stale
```
2018-08-14 22:43:29 -07:00
Weibin Lin c702a24182 use glog.V().Infof() for formatting output; return nil when err's nil 2018-08-15 11:48:59 +08:00
Kubernetes Submit Queue d655c9a873
Merge pull request #66923 from jarrpa/pvc-protect-until-pod-delete
Automatic merge from submit-queue (batch tested with PRs 66491, 66587, 66856, 66657, 66923). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

PVC Protection: Wait for Pod delete

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

```release-note
NONE
```

Resolves: #65552

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2018-08-14 17:55:17 -07:00
Kubernetes Submit Queue 101bf89ae2
Merge pull request #67404 from janetkuo/workloads-owners
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Update workloads controller owner files

**Release note**:

```release-note
NONE
```
2018-08-14 16:21:25 -07:00
Janet Kuo 1fca77dc12 Update workloads controller owner files 2018-08-14 14:20:34 -07:00
Kubernetes Submit Queue cd786bda64
Merge pull request #66863 from cofyc/fix64549
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

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

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

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

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

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

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

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

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
attachdetach controller attaches volumes immediately when Pod's PVCs are bound
```
2018-08-14 13:46:35 -07:00
Kubernetes Submit Queue 76434bd62a
Merge pull request #66780 from NetApp/volumeresize
Automatic merge from submit-queue (batch tested with PRs 66780, 67330). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Changed admission controller to allow volume expansion for all volume plugins

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

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

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

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

**Release note**:

```release-note
The check for unsupported plugins during volume resize has been moved from the admission controller to the two controllers that handle volume resize.
```
/sig storage
/assign @gnufied @jsafrane @wongma7
2018-08-14 12:22:00 -07:00
NickrenREN 81e360d20f update volume plugins accordingly 2018-08-14 11:12:54 +08:00
Weibin Lin 1f921760d6 Default extensions/v1beta1 Deployment's RevisionHistoryLimit to MaxInt32 2018-08-14 09:20:45 +08:00
Jose A. Rivera 13462bf341 PVC Protection: Wait for Pod delete
Currently, the PVC protection controller will remove its finalizer when
all Pods using a PVC reach at least a Terminating state. However,
certain volumes cannot be guaranteed to be umounted until a Pod is
deleted. Only Pods not in the current pods list can be considered
deleted, so we're removing the exception to not check Terminating Pods.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
2018-08-13 13:57:36 -05:00
Yecheng Fu 5fafae11d8 attachdetach controller: attach volumes immediately when Pod's PVCs are bound
- Use queue to process PVCs on add/update events
- Index pods by PVC key then we don't need to iterate to find pods
2018-08-14 01:03:13 +08:00
Morten Torkildsen 31f1972c52 Fix for duplicate revisions created by StatefulSet 2018-08-13 09:42:53 -07:00
Wei Huang deb6d85470
ensure ScheduleDSPods respects tainted nodes
- add PodToleratesNodeTaints to nodeSelectionPredicates()
- add integration testcases
2018-08-09 18:01:51 -07:00
Kubernetes Submit Queue e26f5d19d4
Merge pull request #66476 from mortent/IntegrationTestForDaemonSetHashCollision
Automatic merge from submit-queue (batch tested with PRs 67090, 67159, 66866, 62111, 66476). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix to handle hash collisions correctly for DaemonSets

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

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

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

**Release note**:

```release-note
Fixes issue when updating a DaemonSet causes a hash collision.
```
2018-08-09 16:30:58 -07:00
Kubernetes Submit Queue dd4ab76f05
Merge pull request #66589 from MorrisLaw/get_load_balancer_name_per_provider
Automatic merge from submit-queue (batch tested with PRs 67061, 66589, 67121, 67149). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Get load balancer name per provider

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

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

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

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

**Release note**:

```release-note
NONE
```
2018-08-08 16:32:07 -07:00
Morten Torkildsen a93ea43e15 Fix to handle hash collisions correctly for DaemonSet 2018-08-08 13:43:43 -07:00
liangwenguo 8f8a7bb83f make the log more readable 2018-08-07 10:00:31 +08:00
Kubernetes Submit Queue 72860eb2bd
Merge pull request #66958 from yue9944882/chore/homogenize-controller-keyfunc
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Reference common keyfunc in endpoints controller

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-06 13:40:12 -07:00
Kubernetes Submit Queue e5b8e891e9
Merge pull request #66351 from vikaschoudhary16/fix-scopeselector-exist-operator
Automatic merge from submit-queue (batch tested with PRs 66351, 66883, 66156). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add unit tests to cover scopes and scope selectors during quota sync logic

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Unit tests for scopes and scope selectors in the quota spec
```
/cc @derekwaynecarr @sjenning @bsalamat @kubernetes/sig-scheduling-pr-reviews @kubernetes/sig-node-pr-reviews
2018-08-06 07:13:14 -07:00
morrislaw 6ecec23690 Implement GetLoadBalancerName per provider and add DefaultLoadBalancerName. 2018-08-04 00:36:48 -04:00
Kubernetes Submit Queue c526d6fa84
Merge pull request #66473 from fisherxu/remove_code
Automatic merge from submit-queue (batch tested with PRs 64815, 66823, 66473, 66466). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Clean up unused code

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-03 18:03:04 -07:00
Kubernetes Submit Queue f4b2abe9fe
Merge pull request #66933 from deads2k/kubectl-07-rollout
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

switching rolling update to external clients

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

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

```release-note
NONE
```
2018-08-03 14:00:32 -07:00
Kubernetes Submit Queue 0c8fe56ea4
Merge pull request #66484 from k82cn/rm_unused_funcs
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Removed unused functions.

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

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

**Special notes for your reviewer**:

**Release note**:
```release-note
None
```
2018-08-03 12:40:35 -07:00
David Eads 029b4388fe switching rolling update to external clients 2018-08-03 13:18:14 -04:00
yue9944882 5a4455dbbd dup key func 2018-08-03 16:41:23 +08:00
vikaschoudhary16 c83f18a897 Fix 'Exists' scope selector operator 2018-08-03 01:36:22 -04:00
Antoine Pelisse 71970d6475 dry-run: Update DynamicClient to pass Create/Update options 2018-08-02 10:38:31 -07:00
Kubernetes Submit Queue 23111ad414
Merge pull request #66851 from tanshanshan/nsfix
Automatic merge from submit-queue (batch tested with PRs 66877, 66066, 66851). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

add namespace info for pod in log

**What this PR does / why we need it**:
add namespace info for pod in log
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-01 23:15:07 -07:00
Kubernetes Submit Queue e04a87f888
Merge pull request #66846 from Pingan2017/typoscaledown
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix typo: scale dowm-> scale down

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-08-01 19:42:52 -07:00
Kubernetes Submit Queue c32e0e84da
Merge pull request #66615 from jbartosik/cpu-warm-up
Automatic merge from submit-queue (batch tested with PRs 65730, 66615, 66684, 66519, 66510). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Speed up HPA reaction to metric changes by removing scale up forbidden window

**What this PR does / why we need it**:
Speed up HPA reaction to metric changes by removing scale up forbidden window.

Scale up forbidden window was protecting HPA against making decision to scale up based on metrics gathered during pod initialisation (which may be invalid, for example pod may be using a lot of CPU despite not doing any "actual" work).

To avoid that negative effect only use per pod metrics from pods that are:
- ready (so metrics about them should be valid), or
- unready but creation and last readiness change timestamps are apart more than 10s (pods that have formerly been ready and so metrics are in at least some cases (pod becoming unready because of overload) very useful).


This PR only deals with scale up window. I'll send another PR dealing with scale down window soon.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
Speed up HPA reaction to metric changes by removing scale up forbidden window.

Scale up forbidden window was protecting HPA against making decision to scale up based on metrics gathered during pod initialisation (which may be invalid, for example pod may be using a lot of CPU despite not doing any "actual" work).

To avoid that negative effect only use per pod metrics from pods that are:
- ready (so metrics about them should be valid), or
- unready but creation and last readiness change timestamps are apart more than 10s (pods that have formerly been ready and so metrics are in at least some cases (pod becoming unready because of overload) very useful).
```
2018-08-01 15:52:10 -07:00
Kubernetes Submit Queue 0a284c1cde
Merge pull request #66082 from sjenning/fix-is-critical-checks
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

move feature gate checks inside IsCriticalPod

Currently `IsCriticalPod()` calls throughout the code are protected by `utilfeature.DefaultFeatureGate.Enabled(features.ExperimentalCriticalPodAnnotation)`.

However, with Pod Priority, this gate could be disabled which skips the priority check inside IsCriticalPod().

This PR moves the feature gate checking inside `IsCriticalPod()` and handles both situations properly.

@aveshagarwal @ravisantoshgudimetla @derekwaynecarr 
/sig node
/sig scheduling
/king bug
2018-08-01 11:47:08 -07:00
Joachim Bartosik 7681c284f5 Remove UpscaleForbiddenWindow
Instead discard metric values for pods that are unready and have never
been ready (they may report misleading values, the original reason for
introducing scale up forbidden window).

Use per pod metric when pod is:
- Ready, or
- Not ready but creation timestamp and last readiness change are more
  than 10s apart.

In the latter case we asume the pod was ready but later became unready.
We want to use metrics for such pods because sometimes such pods are
unready because they were getting too much load.
2018-08-01 17:47:23 +02:00
Joachim Bartosik 086ed3c659 Rename desiredReplicas to expectedDesiredReplicas
Naming fields specifying values expected by test as expected.* is a nice
convention to have, lets follow it.
2018-08-01 17:43:01 +02:00
tanshanshan 623278fdba add ns info for pod in log 2018-08-01 16:25:34 +08:00
Pingan2017 38c6dcf519 fix typo: scale dowm-> scale down 2018-08-01 10:39:59 +08:00
Kubernetes Submit Queue f4d8220df5
Merge pull request #65616 from cofyc/fix56163
Automatic merge from submit-queue (batch tested with PRs 65570, 65616). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Retry scheduling on StorageClass events

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

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

**Special notes for your reviewer**:

I have taken over #60006.
It's hard to test in e2e, because we cannot know reschedule of pod is triggered by which event (periodically service/node events will move pods to active queue too). ~~I'll add integration tests for this functionality after [this PR](https://github.com/kubernetes/kubernetes/pull/65296) get merged.~~ (already added)

**Release note**:

```release-note
NONE
```
2018-07-31 19:18:00 -07:00
Kubernetes Submit Queue 259e0743f1
Merge pull request #66581 from janetkuo/deploy-progress
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

 Default extensions/v1beta1 Deployment's ProgressDeadlineSeconds to MaxInt32

**What this PR does / why we need it**: Default values should be set in all API versions, because defaulting happens whenever a serialized version is read. When we switched to `apps/v1` as the storage version in `1.10` (#58854), `extensions/v1beta1` `DeploymentSpec.ProgressDeadlineSeconds` gets `apps/v1` default value (`600`) instead of being unset. 

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

**Special notes for your reviewer**: We need to cherrypick this fix to 1.10 and 1.11. Note that this fix will only help people who haven't upgraded to 1.10 or 1.11 when the storage version is changed. 

@kubernetes/sig-apps-bugs 

**Release note**:

```release-note
NONE
```
2018-07-31 09:30:59 -07:00
Janet Kuo a4f85c8dd0 Default extensions/v1beta1 Deployment's ProgressDeadlineSeconds to MaxInt32.
1. MaxInt32 has the same meaning as unset, for compatibility
2. Deployment controller treats MaxInt32 the same as unset (nil)
2018-07-27 10:10:30 -07:00
Ardalan Kangarlou ee747b8649 Changed admission controller to allow volume expansion for all volume plugins
There are two motivations for this change:
(1) CSI plugins are soon going to support volume expansion. For such
plugins, admission controller doesn't know whether the plugins are
capabale of supporting volume expansion or not.
(2) Currently, admission controller rejects PVC updates for in-tree plugins
that don't support volume expansion (e.g., NFS, iSCSI). This change allows
external controllers to expand volumes similar to how external provisioners
operate.
2018-07-27 03:06:48 -04:00
David Eads 4623ebd9ff add gonum graph representation of GC graph 2018-07-26 13:24:36 -04:00
Kubernetes Submit Queue d9f02d90be
Merge pull request #66299 from mikedanese/cleanup1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

pkg/controller: remove old clientbuilder methods

everything has moved to client-go now so these are the same as the original Client* methods. The only functional change is the collapse of the "horizontal-pod-autoscaler" from one client to two. This should have no effect because the GoClient was used only for discovery.

```release-note
NONE
```
2018-07-26 00:13:01 -07:00
Kubernetes Submit Queue 1e3d23c5c3
Merge pull request #65907 from jbartosik/hpa-improv-refactor-run-test
Automatic merge from submit-queue (batch tested with PRs 64681, 65907). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make runTest easier to understand

Fewer nested conditions, more checking for incorrect looking test cases.

**What this PR does / why we need it**: Make HPA tests easier to understand.

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

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-07-24 16:28:13 -07:00
Joachim Bartosik 3d1b6b0f6e Make runTest easier to understand
Instead of deducing metric type from details of struct describing it
test cases explicitly specify the metric type they use.
2018-07-24 17:27:17 +02:00
fisherxu 02d980b285 clean up unused code 2018-07-24 14:32:19 +08:00
Da K. Ma a56121c191 Removed unused functions.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-07-22 20:56:53 +08:00
Kubernetes Submit Queue e74a68e4c5
Merge pull request #66389 from bertinatto/metrics_pv_controller
Automatic merge from submit-queue (batch tested with PRs 66098, 66389, 66400, 66413, 66378). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add metrics in PV Controller

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

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

Additional metrics for PV Controller:
* Total provision and deletion time
* Number of times PV provisioning and deletion failed

**Release note**:

```release-note
NONE
```
2018-07-20 05:30:09 -07:00
Yecheng Fu 8f0373792f Retry scheduling on various events. 2018-07-20 09:54:34 +08:00
Kubernetes Submit Queue 8770d12494
Merge pull request #65572 from yue9944882/fixes-admission-operation-mismatch-for-create-on-update
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fixes operation for "create on update"

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

Set operation to `admission.Create` for create-on-update requests.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
Checks CREATE admission for create-on-update requests instead of UPDATE admission
```
2018-07-19 10:42:54 -07:00
Kubernetes Submit Queue d2cc34fb07
Merge pull request #65771 from smarterclayton/untyped
Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add a new conversion path to replace GenericConversionFunc

reflect.Call is very expensive. We currently use a switch block as part of AddGenericConversionFunc to avoid the bulk of top level a->b conversion for our primary types which is hand-written. Instead of having these be handwritten, we should generate them.

The pattern for generating them looks like:

```
scheme.AddConversionFunc(&v1.Type{}, &internal.Type{}, func(a, b interface{}, scope conversion.Scope) error {
  return Convert_v1_Type_to_internal_Type(a.(*v1.Type), b.(*internal.Type), scope)
})
```

which matches AddDefaultObjectFunc (which proved out the approach last year). The
conversion machinery should then do a simple map lookup based on the incoming types and invoke the function.  Like defaulting, it's up to the caller to match the types to arguments, which we do by generating this code.  This bypasses reflect.Call and in the future allows Golang mid-stack inlining to optimize this code.

As part of this change I strengthened registration of custom functions to be generated instead of hand registered, and also strengthened error checking of the generator when it sees a manual conversion to error out.  Since custom functions are automatically used by the generator, we don't really have a case for not registering the functions.

Once this is fully tested out, we can remove the reflection based path and the old registration methods, and all conversion will work from point to point methods (whether generated or custom).

Much of the need for the reflection path has been removed by changes to generation (to omit fields) and changes to Go (to make assigning equivalent structs easy).

```release-note
NONE
```
2018-07-19 09:29:00 -07:00
Fabio Bertinatto a15cc29442 Add extra metrics for PV Controller
Specifically:

* Total provision time
* Total PV deletion time
* Number of times PV provisioning failed
* Number of times PV deletion failed
2018-07-19 15:36:37 +02:00
Fabio Bertinatto 97e63985dc Return error in provisionClaimOperation 2018-07-19 15:27:40 +02:00
Kubernetes Submit Queue ab00c609ee
Merge pull request #65901 from jbartosik/hpa-improv-refactor-replica-calc-test
Automatic merge from submit-queue (batch tested with PRs 66175, 66324, 65828, 65901, 66350). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Hpa improv refactor replica calc test

**What this PR does / why we need it**: prepareTestClient generates 4 fake clients, using replicaCalcTestCase object. This PR extracts a separate helper for generating each fake independently.

**Which issue(s) this PR fixes**

**Special notes for your reviewer**:

**Release note**:
```release-note
NONE
```
2018-07-18 16:42:18 -07:00
Kubernetes Submit Queue 3f191aef8b
Merge pull request #65828 from jbartosik/hpa-improv-refactor
Automatic merge from submit-queue (batch tested with PRs 66175, 66324, 65828, 65901, 66350). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Chop computeReplicasForMetrics to smaller pieces

Split computeReplicasForMetrics function into smaller pieces.


**Release note**:
```release-note
NONE
```
2018-07-18 16:42:14 -07:00
Joachim Bartosik 9b91a89f3d Chop computeReplicasForMetrics to smaller pieces 2018-07-18 17:09:20 +02:00
Joachim Bartosik 4ef9033549 Extract helpers from prepareTestClient
Each of the subhelpers generates one client.
2018-07-18 17:02:30 +02:00
Kubernetes Submit Queue cef1880350
Merge pull request #66292 from vishen/pv_spelling_storageclassename
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

persistentvolume: fix spelling of storageClasseName

**What this PR does / why we need it**:
Fixed spelling of error in 'pv_controller', was 'storageClasseName', is
now 'storageClassName'.

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

**Special notes for your reviewer**:
Just fixes the spelling in one of the errors returned in the persistent volume controller.

**Release note**:

```release-note

```
2018-07-18 05:24:04 -07:00
Clayton Coleman ba95744bc5
Make conversion function names match expected values 2018-07-17 23:02:16 -04:00
Kubernetes Submit Queue 162655f42f
Merge pull request #62943 from faraazkhan/master
Automatic merge from submit-queue (batch tested with PRs 66304, 62943). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

set updated replicas

**What this PR does / why we need it**: 
Sets the `.status.updatedReplicas` field for stateful sets when they are being created. This behavior is consistent with how this field is handled in the deployments controller and also allows for `kubectl rollout status` to work when stateful sets are being created. 


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

**Special notes for your reviewer**:

**Release note**:

```release-note
fix rollout status for statefulsets
```
2018-07-17 17:52:59 -07:00
Mike Danese efb8827215 pkg/controller: remove old clientbuilder methods
everything has moved to client-go now so these are the same as the
original Client* methods.
2018-07-17 09:06:59 -07:00
Jonathan Pentecost b4cab1be0e persistentvolume: fix spelling of storageClasseName
Fixed spelling of error in 'pv_controller', was 'storageClasseName', is
now 'storageClassName'.
2018-07-17 14:34:51 +01:00
chentao1596 e640e76a8a UT case of certificate_controller 2018-07-14 16:40:08 +08:00
Kubernetes Submit Queue 0200dd08b0
Merge pull request #66094 from janetkuo/hash-safe-encode
Automatic merge from submit-queue (batch tested with PRs 66094, 65676). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Safe encode template hash value to make it consistent with resource name

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

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

**Special notes for your reviewer**: It's safe to change the function that generates template hash label, because this value is only used when creating a resource and never updated or compared. Therefore, it won't break existing workloads after k8s upgrade/downgrade. Note that we've changed hash before when introducing hash collision avoidance mechanism. 
@kubernetes/sig-apps-pr-reviews 

**Release note**:

```release-note
NONE
```
2018-07-13 16:04:00 -07:00
Janet Kuo 666a41c2ea Safe encode template hash value to make it consistent with resource name 2018-07-13 09:52:26 -07:00
Kubernetes Submit Queue eb5fbfd40c
Merge pull request #66120 from CaoShuFeng/csr_deny
Automatic merge from submit-queue (batch tested with PRs 66136, 64999, 65425, 66120, 66074). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

optimize certificate cleaner

No need to parse certificates for every conditions



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-12 15:14:20 -07:00
Cao Shufeng 855842c468 optimize certificate cleaner
No need to parse certificates for every conditions
2018-07-12 18:59:03 +08:00
Kubernetes Submit Queue 5623efebea
Merge pull request #65052 from dbdd4us/master
Automatic merge from submit-queue (batch tested with PRs 65052, 65594). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix update node condition

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

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

Fixes #65051

/area cloudprovider
/sig cluster-lifecycle

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-11 22:25:03 -07:00
Jordan Liggitt 6d6842da0b
fix updateJob scheduling of resync 2018-07-11 17:10:10 -04:00
Seth Jennings f2a7654978 move feature gate checks inside IsCriticalPod 2018-07-11 16:10:05 -05:00
Kubernetes Submit Queue 0972ce1acc
Merge pull request #65649 from rsc/fix-printf
Automatic merge from submit-queue (batch tested with PRs 66076, 65792, 65649). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

kubernetes: fix printf format errors

These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

```release-note
NONE
```
2018-07-11 14:09:08 -07:00
Russ Cox 2bd91dda64 kubernetes: fix printf format errors
These are all flagged by Go 1.11's
more accurate printf checking in go vet,
which runs as part of go test.

Lubomir I. Ivanov <neolit123@gmail.com>
applied ammend for:
  pkg/cloudprovider/provivers/vsphere/nodemanager.go
2018-07-11 00:10:15 +03:00
yue9944882 ccb1ec7a36 fixes operation for "create on update"
remove create-on-update logic for quota controller

review: add more error check

remove unused args

revert changes in patch.go

use hasUID to judge if it's a create-on-update
2018-07-10 17:22:09 +08:00
Tim Allclair b1012b2543
Remove unused io util writer & volume host GetWriter() 2018-07-09 14:09:48 -07:00
Kubernetes Submit Queue 349d6a62db
Merge pull request #64226 from ddebroy/ddebroy-affinity1
Automatic merge from submit-queue (batch tested with PRs 64226, 65880). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Populate NodeAffinity on top of labels for cloud based PersistentVolumes

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

This PR populates the NodeAffinity field (on top of the existing labels) for PVs backed by cloud providers like EC2 EBS and GCE PD.

**Special notes for your reviewer**:
Related to https://github.com/kubernetes/kubernetes/pull/63232

Sample `describe pv` output for EBS with node affinity field populated:
```
kubectl describe pv pv0001
Name:              pv0001
Labels:            failure-domain.beta.kubernetes.io/region=us-west-2
                   failure-domain.beta.kubernetes.io/zone=us-west-2a
Annotations:       <none>
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      
Status:            Available
Claim:             
Reclaim Policy:    Retain
Access Modes:      RWO
Capacity:          5Gi
Node Affinity:     
  Required Terms:  
    Term 0:        failure-domain.beta.kubernetes.io/zone in [us-west-2a]
                   failure-domain.beta.kubernetes.io/region in [us-west-2]
Message:           
Source:
    Type:       AWSElasticBlockStore (a Persistent Disk resource in AWS)
    VolumeID:   vol-00cf03a068c62cbe6
    FSType:     ext4
    Partition:  0
    ReadOnly:   false
Events:         <none>
```

/sig storage
/assign @msau42

**Release note**:
```NONE```
2018-07-09 12:16:02 -07:00
Kubernetes Submit Queue 4bb3a2a557
Merge pull request #65911 from wongma7/crap
Automatic merge from submit-queue (batch tested with PRs 63194, 65911). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Remove crappy fmt.Println

Remove @gnufied's debug message https://github.com/kubernetes/kubernetes/pull/64527
```release-note
NONE
```
2018-07-09 00:32:59 -07:00
Matthew Wong ddba1b5811 Remove crappy fmt.Println 2018-07-06 12:54:34 -04:00
David Eads eacbd62925 only need to ignore resources that match discovery conditions 2018-07-05 10:29:58 -04:00
Kubernetes Submit Queue cf686a4764
Merge pull request #65677 from MorrisLaw/node-controller-logging
Automatic merge from submit-queue (batch tested with PRs 65677, 65711, 65150, 65726). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Improved logging message for checking if node is shutdown.

**What this PR does / why we need it**:
The previous error message was "Error getting data for node" which was too broad of a message and not very descriptive. This PR will update it to "Error checking if node is shutdown" so that it is more specific.

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

Add lichuqiang as reviewer of persistentvolume controller (for volume scheduling)

Now that I've been working on the storage topology-aware feature for quite a time. Really hope that I can help do some review.

```release-note
NONE
```

/assign @msau42
2018-07-03 11:31:12 -07:00
lichuqiang 67380c63aa Add lichuqiang as reviewer of persistentvolume controller (for volume scheduling) 2018-07-04 00:35:54 +08:00
morrislaw 45ab6d7a55 Improved logging message for checking if node is shutdown. 2018-07-03 09:34:42 -04:00
Kubernetes Submit Queue 7dcac9d2a5
Merge pull request #65648 from sttts/sttts-k8s-metrics-codegen
Automatic merge from submit-queue (batch tested with PRs 65648, 65700, 64976, 65692, 65667). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

k8s.io/metrics: normalize and fix codegen script

~~Builds on https://github.com/kubernetes/kubernetes/pull/65645. Will rebase when that one merges.~~ merged
2018-07-02 19:46:09 -07:00
Kubernetes Submit Queue c97b2e0d1e
Merge pull request #65484 from yue9944882/chore/sync-impl-with-doc
Automatic merge from submit-queue (batch tested with PRs 64741, 65484). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixes docs mismatched with implementation

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

Some document is far different with the implementation, which is really confusing.

Manually fixed them and appended more information.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-07-02 03:55:03 -07:00
Dr. Stefan Schimanski d79cf25497 Update external k8s.io/metrics imports 2018-07-02 10:44:18 +02:00
Kubernetes Submit Queue efff9dd35e
Merge pull request #65614 from toanant/patch-1
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Typo Fix.

Fixed minor spelling mistakes caught while reading `cronjob_controller.go` source code reference at [operating-kubernetes](https://stripe.com/blog/operating-kubernetes) blog.
2018-06-29 08:44:56 -07:00
Kubernetes Submit Queue 85aa6d2405
Merge pull request #65596 from liggitt/out-of-bounds
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix out of bounds error on non-64-bit machines

This fixes an out of bounds error when running the controllers on a 32-bit machine

```
W0628 17:52:30.171975       1 node_lifecycle_controller.go:782] Missing timestamp for Node kube-master. Assuming now as a timestamp.
I0628 17:52:30.172115       1 taint_manager.go:205] Starting NoExecuteTaintManager
panic: runtime error: index out of range

goroutine 1740 [running]:
k8s.io/kubernetes/pkg/controller/nodelifecycle/scheduler.(*NoExecuteTaintManager).Run.func1(0x165e6000, 0x8, 0x15984100)
        /workspace/anago-v1.11.0-rc.3.3+91e7b4fd31fcd3/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/controller/nodelifecycle/scheduler/taint_manager.go:229 +0x1f8
created by k8s.io/kubernetes/pkg/controller/nodelifecycle/scheduler.(*NoExecuteTaintManager).Run
        /workspace/anago-v1.11.0-rc.3.3+91e7b4fd31fcd3/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/controller/nodelifecycle/scheduler/taint_manager.go:217 +0x27c
```

See https://play.golang.org/p/rIpicHGHtiT for an example of the coercion overflow


/assign @wojtek-t
/kind bug

```release-note
fixes an out of range panic in the NoExecuteTaintManager controller when running a non-64-bit build
```
2018-06-29 00:55:03 -07:00
Abhishek Kumar Singh 392bf0adef
Typo Fix.
Fixed minor spelling mistakes caught while reading `cronjob_controller.go` source code reference at [operating-kubernetes](https://stripe.com/blog/operating-kubernetes)
2018-06-29 11:04:10 +05:30
Jordan Liggitt 52abbeffe6
Fix out of bounds error on non-64-bit machines 2018-06-28 16:29:52 -04:00
Hemant Kumar 8d46912e7f Add metrics for attachable volumes in use 2018-06-28 11:50:51 -04:00
yue9944882 dc07e4dcba fixes docs 2018-06-28 11:33:47 +08:00
Deep Debroy 074dc6487b Populate NodeAffinity on top of labels for cloud based PersistentVolumes
Signed-off-by: Deep Debroy <ddebroy@docker.com>
2018-06-26 19:48:03 -07:00
zhangjie 831a2d1129 deployment: remove unused parameter 'podMap'
Signed-off-by: kadisi <iamkadisi@163.com>
2018-06-25 09:22:58 +08:00
Da K. Ma 66d558dfd3 Removed unused vars.
Signed-off-by: Da K. Ma <klaus1982.cn@gmail.com>
2018-06-24 10:48:49 +08:00
Jeff Grafton 23ceebac22 Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
Jordan Liggitt 8448ee4e12
Remove item from taint manager workqueue on completion 2018-06-21 17:11:41 -04:00
Kubernetes Submit Queue 06ea14a5d6
Merge pull request #63471 from ceshihao/taint_behavior_consistent
Automatic merge from submit-queue (batch tested with PRs 65032, 63471, 64104, 64672, 64427). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Make taint behavior consistent for NoSchedule

**What this PR does / why we need it**:
Make taint behavior consistent.
If `TaintNodesByCondition ` is enable, taint node with `NotReady:NoSchedule`.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```
2018-06-20 04:23:13 -07:00
Kubernetes Submit Queue 74c1931096
Merge pull request #64502 from hanxiaoshuai/fix05301
Automatic merge from submit-queue (batch tested with PRs 63580, 63744, 64541, 64502, 64100). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

we should use Warningf instead of Warning when we are using format string

**What this PR does / why we need it**:
we should use Warningf instead of Warning when we are using format string
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-20 01:32:37 -07:00
Kubernetes Submit Queue 65819a8f92
Merge pull request #63744 from krmayankk/changelog
Automatic merge from submit-queue (batch tested with PRs 63580, 63744, 64541, 64502, 64100). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove redundant getKey functions from controller tests

```release-note
None
```
2018-06-20 01:27:32 -07:00
Kubernetes Submit Queue 61edc0f147
Merge pull request #64902 from k82cn/nc_main
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Volunteer to maintain nodelifecycle

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

/cc @gmarek @bowei  :)

**Release note**:
```release-note
None
```
2018-06-19 18:46:59 -07:00
dbdd4us 5835d9bde4 fix update node condition 2018-06-13 19:58:41 +08:00
Michal Fojtik 6517e250cd
daemon: add custom node indexer 2018-06-12 11:10:10 +02:00
Kubernetes Submit Queue 52603a78ab
Merge pull request #64969 from mfojtik/volume-01-fix-allocations
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

volume: decrease memory allocations for debugging messages

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

<img width="1769" alt="screen shot 2018-06-11 at 13 15 31" src="https://user-images.githubusercontent.com/44136/41230128-ebf7233c-6d7e-11e8-899d-6251a5fde236.png">

On large clusters, where the glog is not running on V(5) using the format as: `glog.V(5).Infof(fmt.Sprintf(....))` will cause the code inside `Infof()` to be ran and generate a tons of memory allocations even if the output of those messages are not returned to the console...

This patch should reduce those calls and also the string allocations done by message generation.

**Release note**:
```release-note
NONE
```
2018-06-11 22:05:42 -07:00
Kubernetes Submit Queue e6f64d0a79
Merge pull request #64916 from mfojtik/ds-01-improve-mem-usage
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

improve memory footprint of daemonset simulate

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

This is an alternative for https://github.com/kubernetes/kubernetes/pull/64915 (it might be not needed if that PR will merge)

During memory profiling of OpenShift, we noticed a significant amount of object allocations done by `IsControlledBy()`. @sttts found that the `GetObjectReferences()` method is doing a deep-copy of the object references. 

![screen shot 2018-06-08 at 14 22 59](https://user-images.githubusercontent.com/44136/41157922-7af953f2-6b27-11e8-9a16-bda8c3edfe07.png)

This PR simplify the `IsControlledBy()` to just iterate over the ownerRefs, without copying them. 

**Release note**:

```release-note
NONE
```
2018-06-11 08:56:20 -07:00
Michal Fojtik 97f546d249
volume: decrease memory allocations for debugging messages 2018-06-11 13:52:38 +02:00
Michal Fojtik 60ef68c87d
improve memory footprint of daemonset simulate 2018-06-08 19:59:12 +02:00
Da K. Ma 254900832b Volunteer to maintain nodelifecycle 2018-06-08 10:17:08 +08:00
Kubernetes Submit Queue ccb9590a3b
Merge pull request #63386 from roycaihw/gc-json-patch
Automatic merge from submit-queue (batch tested with PRs 63386, 64624, 62297, 64847). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Let the garbage collector use json merge patch when SMP is not supported

**What this PR does / why we need it**:
Let garbage collector fallback to use json merge patch when strategic merge patch returns 415. This enables orphan delete on custom resources. 

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

**Special notes for your reviewer**:
This PR is developed based on https://github.com/kubernetes/kubernetes/pull/56595. Ref https://github.com/kubernetes/kubernetes/pull/56606 for more information. 

**Release note**:

```release-note
Orphan delete is now supported for custom resources
```

/sig api-machinery
2018-06-06 19:56:20 -07:00
Kubernetes Submit Queue 296bc64924
Merge pull request #64797 from janetkuo/ds-deletion
Automatic merge from submit-queue (batch tested with PRs 64749, 64797). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Handle deleted DaemonSet properly

**What this PR does / why we need it**:
After kubectl reapers are removed (#63979) and foreground deletion are used, DaemonSet controller may race with garbage collector when it tries to update DaemonSet status of the DaemonSet being deleted. 

Here's what happened:
1. Someone/something performs a foreground deletion on a DaemonSet
1. DaemonSet finalizer and DeletionTimestamp are both set
1. DaemonSet history objects (ControllerRevisions) and pods are being deleted by garbage collector; meanwhile, DaemonSet controller tries to update DaemonSet status. 
    * Updating DaemonSet status requires constructing DaemonSet history objects, to figure out current revision and which pods do/don't belong to current revision
1. When updating DaemonSet status, DaemonSet controller tries to create a DaemonSet history object that matches current DaemonSet spec
1. Garbage collector then tries to delete that DaemonSet history object. And repeat. 

Because we can't make DaemonSet pods be deleted before DaemonSet history objects (DaemonSet history objects don't own DaemonSet pods!), we cannot reliably calculate DaemonSet status without history objects anyways. Therefore, we don't update DaemonSet status for DaemonSet being deleted. 

Note that the reason why the kubectl delete hack works is because it forces DaemonSet pods to be removed before history objects. 

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-06 10:08:16 -07:00
Kubernetes Submit Queue 34759c2dfb
Merge pull request #63650 from soltysh/issue62382
Automatic merge from submit-queue (batch tested with PRs 64009, 64780, 64354, 64727, 63650). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Never clean backoff in job controller

**What this PR does / why we need it**:
In https://github.com/kubernetes/kubernetes/pull/60985 I've added a mechanism which allows immediate job status update, unfortunately that broke the backoff logic seriously. I'm sorry for that. I've changed the `immediate` mechanism so that it NEVER cleans the backoff, but for the cases when we want fast status update it uses a zero backoff. 

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

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

**Release note**:
```release-note
None
```
2018-06-05 22:24:54 -07:00
Janet Kuo f621b1fc44 Skip updating status for DaemonSet being deleted 2018-06-05 17:03:54 -07:00
Kubernetes Submit Queue c615098a96
Merge pull request #63193 from lichuqiang/provision_0425
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Volume topology aware dynamic provisioning: work based on new API

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

The PR has been split to 3 parts:

Part1: https://github.com/kubernetes/kubernetes/pull/63232 for basic scheduler and PV controller plumbing
Part2: https://github.com/kubernetes/kubernetes/pull/63233 for API change

and the PR itself includes work based on the API change:

- Dynamic provisioning allowed topologies scheduler work
- Update provisioning interface to be aware of selected node and topology

**Which issue(s) this PR fixes** 
Feature: https://github.com/kubernetes/features/issues/561
Design: https://github.com/kubernetes/community/issues/2168

**Special notes for your reviewer**:
/sig storage
/sig scheduling
/assign @msau42 @jsafrane @saad-ali @bsalamat

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

**Release note**:

```release-note
Volume topology aware dynamic provisioning
```
2018-06-05 15:31:58 -07:00
Maciej Szulik d80ed537e5
Rate limit only when an actual error happens, not on update conflicts 2018-06-05 22:53:09 +02:00
Kubernetes Submit Queue b672d2ee3c
Merge pull request #64750 from vikaschoudhary16/fix-quota-sync
Automatic merge from submit-queue (batch tested with PRs 64276, 64094, 64719, 64766, 64750). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fix quota sync

**What this PR does / why we need it**:
In quota sync, scope selectors were being missed to match and thus at the time of sync, incorrect usage stats were getting updated.


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

**Special notes for your reviewer**:

**Release note**:

```release-note
None
```

/priority important-soon
/sig scheduling
/sig node
/cc @resouer @derekwaynecarr @sjenning @bsalamat @timstclair @aveshagarwal @smarterclayton
2018-06-05 11:35:25 -07:00
Kubernetes Submit Queue c178c7fd65
Merge pull request #62005 from mikedanese/svcacctproj
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

implement ServiceAccountTokenProjection

design here: https://github.com/kubernetes/community/pull/1973

part of https://github.com/kubernetes/kubernetes/pull/61858

```release-note
Add a volume projection that is able to project service account tokens.
```

part of https://github.com/kubernetes/kubernetes/issues/48408

@kubernetes/sig-auth-pr-reviews @kubernetes/sig-storage-pr-reviews
2018-06-05 09:30:56 -07:00
vikaschoudhary16 ea2192f043 Fix quota sync 2018-06-05 04:50:37 -04:00
lichuqiang bccc8fe979 Provision interface change 2018-06-05 16:35:16 +08:00
lichuqiang dffbd75f86 Dynamic provisioning allowed topologies scheduler work 2018-06-05 16:10:12 +08:00
Kubernetes Submit Queue 9fceab1d83
Merge pull request #64235 from liggitt/gc-resync-reattempt
Automatic merge from submit-queue (batch tested with PRs 62266, 64351, 64366, 64235, 64560). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Avoid deadlock in gc resync if available resources change during sync

retry GC sync if waiting for cache sync times out, without unpausing workers

viewing ignoring whitespace reveals the actual change:
https://github.com/kubernetes/kubernetes/pull/64235/files?w=1

xref https://github.com/kubernetes/kubernetes/pull/61057 https://github.com/kubernetes/kubernetes/pull/56446#discussion_r153381426

```release-note
fixes a potential deadlock in the garbage collection controller
```
2018-06-04 18:44:20 -07:00
Mike Danese 91feb345aa implement service account token projection 2018-06-04 17:22:08 -07:00
Maciej Szulik 5df2755399
Never clean backoff in job controller 2018-06-04 19:28:58 +02:00
Kubernetes Submit Queue 0757e05e78
Merge pull request #64368 from justinsb/ccm_instanceid_fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

ccm: recognize InstanceNotFound from InstanceID

Otherwise we won't actually delete Nodes in this code path.

```release-note
NONE
```
2018-06-02 04:48:38 -07:00
Kubernetes Submit Queue 1ac591e663
Merge pull request #64562 from andrewsykim/ccm-handle-errs
Automatic merge from submit-queue (batch tested with PRs 64057, 63223, 64346, 64562, 64408). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

cloud node controller: improve error handling for node registration

**What this PR does / why we need it**:
Improves error handling for (external) node registration.

**Release note**:
```release-note
NONE
```
2018-06-02 02:10:14 -07:00
Kubernetes Submit Queue a0a4cc73db
Merge pull request #63223 from k82cn/kep548_working
Automatic merge from submit-queue (batch tested with PRs 64057, 63223, 64346, 64562, 64408). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Schedule DaemonSet Pods in scheduler.

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

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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
`ScheduleDaemonSetPods` is an alpha feature (since v1.11) that causes DaemonSet Pods
to be scheduler by default scheduler, instead of Daemonset controller. When it is enabled,
the `NodeAffinity` term (instead of `.spec.nodeName`) is added to the DaemonSet Pods;
this enables the default scheduler to bind the Pod to the target host. If node affinity
of DaemonSet Pod already exists, it will be replaced.

DaemonSet controller will only perform these operations when creating DaemonSet Pods;
and those operations will only modify the Pods of DaemonSet, no changes are made to the
`.spec.template` of DaemonSet.
```
2018-06-02 02:10:08 -07:00
Jordan Liggitt 7da3d65571
Avoid deadlock in gc resync if available resources change during sync 2018-06-01 21:16:51 -04:00
Da K. Ma 8180e1e60f Eanbled schedule DaemonSet Pods by default scheduler. 2018-06-02 08:39:13 +08:00
Da K. Ma faaa485b35 Updated helper funcs to use nodename. 2018-06-02 08:38:58 +08:00
Chao Xu 29d72a7134 GC fallback to jsonmerge patch when SMP is not supported 2018-06-01 16:50:07 -07:00
Kubernetes Submit Queue 5710943612
Merge pull request #63839 from wgliang/master.movepkg
Automatic merge from submit-queue (batch tested with PRs 63348, 63839, 63143, 64447, 64567). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Move pkg/scheduler/schedulercache -> pkg/scheduler/cache

**What this PR does / why we need it**:
Move pkg/scheduler/schedulercache -> pkg/scheduler/cache

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

**Special notes for your reviewer**:

In order to prevent name conflicts still rename the `cache` to `schedulercache`.

**Release note**:

```release-note
NONE
```
2018-06-01 12:12:15 -07:00
Kubernetes Submit Queue 54d869220d
Merge pull request #64431 from wojtek-t/fix_taint_controller
Automatic merge from submit-queue (batch tested with PRs 59938, 63777, 64577, 63999, 64431). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Parallelize taint manager

Helps with problem described in https://github.com/kubernetes/kubernetes/issues/63030#issuecomment-392690351
2018-05-31 21:29:20 -07:00
andrewsykim 4510fe48c3 cloud node controller: improve error handling for node registration 2018-05-31 16:23:41 -04:00
Guoliang Wang 761cf41427 Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08:00
Mayank Kumar a1cd3a4bcc remove redundant getKey functions from tests 2018-05-30 22:15:06 -07:00
Minhan Xia cb9ac04777 fix unit tests using Patch in fake client 2018-05-30 11:33:55 -07:00
wojtekt f7cf33e218 Parallelize taint manager 2018-05-30 14:46:48 +02:00
hangaoshuai 31d3fa2b1a we should use Warningf instead of Warning when we are using format string 2018-05-30 16:44:23 +08:00
Kubernetes Submit Queue 15cd355281
Merge pull request #64213 from dashpole/eviction_event_annotation
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add metadata to kubelet eviction event annotations

**What this PR does / why we need it**:
Add annotations to kubelet eviction events.  Annotations include 
"offending_containers" : comma-seperated list of containers.
"offending_containers_usage": comma-seperated list of usage.
"starved_resource": v1.ResourceName of the starved resource

**Special notes for your reviewer**:
Adding annotations to events required changing the `EventRecorder` interface to add a `AnnotatedEventf` function, which can add annotations to an event.

**Release note**:
```release-note
NONE
```
/assign @dchen1107 
cc @mwielgus @schylek @kgrygiel
2018-05-29 23:37:47 -07:00
Justin Santa Barbara ec12fe1e84 ccm: recognize InstanceNotFound from InstanceID
Otherwise we won't actually delete Nodes in this code path.
2018-05-26 22:29:36 -07:00
Kubernetes Submit Queue a8cf18c0ae
Merge pull request #63232 from lichuqiang/provision_plumbing
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Volume topology aware dynamic provisioning: basic plumbing

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

Split PR https://github.com/kubernetes/kubernetes/pull/63193 for better review
part 1: basic scheduler and controller plumbing

Next: https://github.com/kubernetes/kubernetes/pull/63233

**Which issue(s) this PR fixes** 
Feature: https://github.com/kubernetes/features/issues/561
Design: https://github.com/kubernetes/community/issues/2168

**Special notes for your reviewer**:
/sig storage
/sig scheduling
/assign @msau42 @jsafrane @saad-ali @bsalamat


**Release note**:

```release-note
Basic plumbing for volume topology aware dynamic provisioning
```
2018-05-25 07:58:53 -07:00
lichuqiang 446f36559e pv_controller change for provisioning 2018-05-24 17:12:38 +08:00
lichuqiang 95b530366a Add dynamic provisioning process 2018-05-24 17:12:38 +08:00
lichuqiang 91d403f384 cache update for dynamic provisioning 2018-05-24 17:12:12 +08:00
Kubernetes Submit Queue 5fe35cdbf9
Merge pull request #61419 from enisoc/apps-v1-deploy
Automatic merge from submit-queue (batch tested with PRs 62756, 63862, 61419, 64015, 64063). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Use apps/v1 Deployment/ReplicaSet in controller and kubectl

This updates the Deployment controller and integration/e2e tests to use apps/v1, as part of #55714.

This also requires updating any other components that use the `deployment/util` package, most notably `kubectl`. That means client versions 1.11 and above will only work with server versions 1.9 and above. This is well within our client-server version skew policy of +/-1 minor version.

However, this PR *only* updates the parts of `kubectl` that used `deployment/util`. So although kubectl now requires apps/v1, it still also depends on extensions/v1beta1. Migrating other parts of kubectl to apps/v1 is beyond the scope of this PR, which was just to change the Deployment controller and fix all the fallout.

```release-note
kubectl: This client version requires the `apps/v1` APIs, so it will not work against a cluster version older than v1.9.0. Note that kubectl only guarantees compatibility with clusters that are +/-1 minor version away.
```
2018-05-23 18:14:13 -07:00
David Ashpole fd1f19fc42 add metadata to kubelet eviction event annotations 2018-05-23 16:12:54 -07:00
Kubernetes Submit Queue 0ba60a3eed
Merge pull request #64059 from wgliang/master.rename-controller-unit-test
Automatic merge from submit-queue (batch tested with PRs 64034, 64072, 64146, 64059, 64161). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Fixing wrong unit test naming of (pkg/controller/podautoscaler)

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

Fixing wrong unit test naming of (pkg/controller/podautoscaler). Unit tests will not be executed, function name of _test.go file must start with Test*.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-22 19:20:21 -07:00
Anthony Yeh 436db71751
Set explicit labels/selector for apps/v1 Deployment/RS. 2018-05-22 13:43:07 -07:00
Anthony Yeh e32a15558b
Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
xuzhonghu 4be6328126 remove unused gc code 2018-05-21 20:22:37 +08:00
Kubernetes Submit Queue 680e00a656
Merge pull request #63692 from msau42/debug-scheduler
Automatic merge from submit-queue (batch tested with PRs 60012, 63692, 63977, 63960, 64008). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Only override objects from informer when version has increased.

**What this PR does / why we need it**:
We don't want an informer resync to override assumed volumes if the version has not increased.

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-18 23:35:17 -07:00
Guoliang Wang afa2a1cfe5 Fixing wrong unit test naming 2018-05-19 08:09:39 +08:00
Michelle Au 2142737276 Only override objects from informer when version has increased.
Add more logging and tests to volume scheduler.
2018-05-17 16:46:20 -07:00
Maciej Szulik a3dd7ca9ee
increase timeout in TestCancelAndReadd
the flakes referenced in #51704 were still seen downstream. the current timeout approach is known to be faulty, but fixing the tests has not been prioritized. this increases the timeout sufficiently to avoid flakes in the meantime
2018-05-17 10:26:17 -04:00
Kubernetes Submit Queue e3b0e85138
Merge pull request #63852 from hzxuzhonghu/node-controller-run-with-stopch
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

pass stop channel to node-controller

node controller run with stop channel passed from outside.

**Release note**:

```release-note
NONE
```
2018-05-15 18:00:41 -07:00
Kubernetes Submit Queue 944e07480f
Merge pull request #63742 from thockin/kill-tolerate-unready-annotation
Automatic merge from submit-queue (batch tested with PRs 63792, 63495, 63742, 63332, 63779). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Actually support service `publishNotReadyAddresses`

This was added and the annotation was deprecated, but it was never
implemented.

xref #63741

**Release note**:

```release-note
The annotation `service.alpha.kubernetes.io/tolerate-unready-endpoints` is deprecated.  Users should use Service.spec.publishNotReadyAddresses instead.
```
2018-05-15 09:04:24 -07:00
xuzhonghu f7aa5037c8 fix ut 2018-05-15 17:22:40 +08:00
xuzhonghu 7e894b33ee pass stop channel to node-controller 2018-05-15 17:08:35 +08:00
Kubernetes Submit Queue 0ae403d727
Merge pull request #57536 from linyouchong/linyouchong-20171222
Automatic merge from submit-queue (batch tested with PRs 57536, 63812). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix spelling error in comment
2018-05-14 19:44:07 -07:00
Tim Hockin c038f60d04 Actually support service `publishNotReadyAddresses`
This was added and the annotation was deprecated, but it was never
implemented.
2018-05-14 14:19:54 -07:00
ceshihao 4eb72d7bcd simplify code and add unit test for NotReady taint 2018-05-14 06:55:42 +00:00
Kubernetes Submit Queue c9b56e6a7a
Merge pull request #63582 from WanLinghao/sa_var_clean
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

clean unused variables on serviceaccounts_controller_test.go

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

**Special notes for your reviewer**:

**Release note**:

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

Report node DNS info with --node-ip

**What this PR does / why we need it**:
This PR adds `ExternalDNS`, `InternalDNS`, and `ExternalIP` info for kubelets with the `--nodeip` flag enabled. 

**Which issue(s) this PR fixes** 
Fixes #63158

**Special notes for your reviewer**:

I added a field to the Kubelet to make IP validation more testable (`validateNodeIP` relies on the `net` package and the IP address of the host that is executing the test.) I also converted the test to use a table so new cases could be added more easily.

**Release Notes**
```release-note
Report node DNS info with --node-ip flag
```

@andrewsykim
@nckturner 

/sig node
/sig network
2018-05-11 15:46:35 -07:00
Kubernetes Submit Queue 92ba95c39c
Merge pull request #63446 from deads2k/client-08-remove-old
Automatic merge from submit-queue (batch tested with PRs 63367, 63718, 63446, 63723, 63720). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

finish new dynamic client and deprecate old dynamic client

Builds on a couple other pulls.  This completes the transition to the new dynamic client.

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

```release-note
The old dynamic client has been replaced by a new one.  The previous dynamic client will exist for one release in `client-go/deprecated-dynamic`.  Switch as soon as possible.
```
2018-05-11 14:49:16 -07:00
Kubernetes Submit Queue 5a54555f59
Merge pull request #63049 from andrewsykim/kcm-nodeipam
Automatic merge from submit-queue (batch tested with PRs 63049, 59731). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

re-enable nodeipam in kube-controller-manager

**What this PR does / why we need it**:
Re-enables nodeipam controller for external clouds. Also does a small refactor so that we don't need to pass in `allocateNodeCidr` into the controller. 

In v1.10 we made a change (9187b343e1 (diff-f11913dc67d80d36b3d06a93f61c49cf) in https://github.com/kubernetes/kubernetes/pull/57492) where nodeipam would be disabled for any cluster that sets `--cloud-provider=external`. The original intention behind this was that the nodeipam controller is cloud specific for some clouds (only GCE at the moment) so it should be moved to the CCM (cloud controller manager). After some discussions with wg-cloud-provider it makes sense to re-enable nodeipam controller in KCM and have GCE CCM enable its own cloud-specific IPAM controller as part of [Initialize()](https://github.com/kubernetes/kubernetes/blob/master/pkg/cloudprovider/cloud.go#L33-L35). This would allow for GCE to run nodeipam in both KCM (by setting --cloud-provider=gce and --allocate-node-cidr) and in the CCM (once implemented in `Initialize()`) without disabling nodeipam in the KCM for all external clouds and avoids having to implement nodeipam in CCM. 

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

**Special notes for your reviewer**:


**Release note**:
```release-note
Re-enable nodeipam controller for external clouds. 
```
2018-05-11 11:07:12 -07:00
David Eads fd044d152e fix dynamic client name 2018-05-11 13:12:09 -04:00
David Eads d8924bc1c9 move old dynamic client to deprecated-client 2018-05-11 08:00:46 -04:00
Kubernetes Submit Queue 7eb88f11d2
Merge pull request #59727 from wgliang/master.time
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

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

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

**Special notes for your reviewer**:
2018-05-10 20:29:40 -07:00
WanLinghao c68a11d042 remove unused variables on
pkg/controller/serviceaccount/serviceaccounts_controller_test.go
	pkg/controller/endpoint/endpoints_controller_test.go
2018-05-10 09:19:00 +08:00
ceshihao 842ae0bc22 Make taint behavior consistent, taint node with NotReady:NoSchedule 2018-05-09 13:36:05 +00:00
David Eads c5445d3c56 simplify api registration 2018-05-08 18:33:50 -04:00
David Eads cf4f7aab65 update garbage collection to use the new dynamic client 2018-05-07 09:01:39 -04:00
Kubernetes Submit Queue 28a19562bd
Merge pull request #61970 from sak0/dev-endpoints
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

controller/endpoint: explict log msg when syncing error

explict log msg for retrying sync

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



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

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

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-05-06 19:47:30 -07:00
Kubernetes Submit Queue 484f62a568
Merge pull request #63333 from deads2k/api-14-snip
Automatic merge from submit-queue (batch tested with PRs 63421, 63432, 63333). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update tests to be specific about the versions they are testing

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

@liggitt  scrubs unnecessary deps.

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

Fix ensure by provider id

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

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

**Special notes for your reviewer**:

cc @adnavare 

**Release note**:

```release-note
NONE
```
2018-05-03 00:08:48 -07:00
Dong Liu 9a6319b23c Update error assertation 2018-05-03 10:22:20 +08:00
David Eads 9a48066749 update restmapping to indicate fully qualified resource 2018-05-01 16:34:49 -04:00
David Eads 94e3d94d67 update tests to be specific about the versions they are testing instead of floating 2018-05-01 13:18:41 -04:00
Kubernetes Submit Queue f03f83a20a
Merge pull request #63206 from deads2k/api-11-restmapper
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

remove incorrect static restmapper from type registry

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

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

```release-note
NONE
```
2018-05-01 08:10:37 -07:00
David Eads ef0d1ab819 remove incorrect static restmapper 2018-05-01 07:51:17 -04:00
David Eads 5ff923c7f9 make dynamic client slightly easier to use 2018-04-30 08:54:30 -04:00
Kubernetes Submit Queue dfba1c1f2c
Merge pull request #62497 from MrHohn/endpoint-controller-headless-ports
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

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

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

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

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

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

**Release note**:

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

Add approvers to pkg/controller/endpoint

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

/assign @thockin 
cc @bowei 

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

**Release note**:

```release-note
NONE
```
2018-04-29 06:44:58 -07:00
Dong Liu f0046a7194 Rename func to ensureNodeExistsByProviderID 2018-04-28 13:43:29 +08:00
Micah Hausler 1a218aaee2 Report node DNS info with --node-ip
```release-note
Report node DNS info with --node-ip flag
```
2018-04-27 13:18:40 -07:00
David Eads e2fc5cf259 remove versioning interface 2018-04-27 07:56:42 -04:00
Dong Liu 050b583b96 Fix ensure by provider id 2018-04-27 14:19:52 +08:00
linyouchong c2661854b5
Update pvc_protection_controller.go 2018-04-27 14:17:11 +08:00
linyouchong 16141a1fbf
Merge branch 'master' into linyouchong-20171222 2018-04-27 14:15:53 +08:00
David Eads a89291a5de stop duplicating preferred version order 2018-04-26 10:03:36 -04:00
Kubernetes Submit Queue 9e52d14eb9
Merge pull request #62805 from awly/take-reviews
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Add awly as reviewer in several subtrees

```release-note
NONE
```
2018-04-25 21:24:31 -07:00
Faraaz Khan 594e228a17 set updated replicas correctly in scale up, scale down scenarios as well 2018-04-25 20:46:17 -05:00
Faraaz Khan beec45b4de set updated replicas 2018-04-25 20:46:17 -05:00
Kubernetes Submit Queue 5d7569d664
Merge pull request #62913 from deads2k/client-04-dynamic
Automatic merge from submit-queue (batch tested with PRs 63137, 62913). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make a simple dynamic client that is easy to use

The dynamic client has annoyed me for the last time!  The existing one takes arguments at odd levels, requires lots of information to instantiate, does some weird pool thing, and uses unusual types.  This creates an interface like this:

```go

type DynamicInterface interface {
	ClusterResource(resource schema.GroupVersionResource) DynamicResourceInterface
	NamespacedResource(resource schema.GroupVersionResource, namespace string) DynamicResourceInterface
}

type DynamicResourceInterface interface {
	Create(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	Update(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	UpdateStatus(obj *unstructured.Unstructured) (*unstructured.Unstructured, error)
	Delete(name string, options *metav1.DeleteOptions) error
	DeleteCollection(options *metav1.DeleteOptions, listOptions metav1.ListOptions) error
	Get(name string, options metav1.GetOptions) (*unstructured.Unstructured, error)
	List(opts metav1.ListOptions) (*unstructured.UnstructuredList, error)
	Watch(opts metav1.ListOptions) (watch.Interface, error)
	Patch(name string, pt types.PatchType, data []byte, subresources ...string) (*unstructured.Unstructured, error)
}
```

You create it from just a `rest.Config`, no mapper, no path resolving func, no trying to set up codecs ahead of time, no unnecessary pool.  It just works.

I updated the namespace controller to use it and I updated the existing dynamic client to leverage it so that I get all their tests for "free".

@kubernetes/sig-api-machinery-pr-reviews 
@liggitt @smarterclayton @bparees @sttts @ironcladlou I know each of us has struggled with the dynamic client in our time.
@lavalamp @caesarxuchao This is vastly simplifying.  I'm eager to drop the old `ClientPool`.  client-go will technically have another incompatible semver this release.  I'm up for changing it in tree.


```release-note
client-go developers: the new dynamic client is easier to use and the old is deprecated, you must switch.
```
2018-04-25 08:50:09 -07:00