Commit Graph

475 Commits (dc734edb3c21012b2baa08f7645f2ab8915406d8)

Author SHA1 Message Date
Dr. Stefan Schimanski 79adb99a13 pkg/api: move Semantic equality to k8s.io/apimachinery/pkg/api/equality 2017-01-29 21:41:45 +01:00
Kubernetes Submit Queue aace5a7b87 Merge pull request #40449 from deads2k/client-15-types
Automatic merge from submit-queue (batch tested with PRs 40239, 40397, 40449, 40448, 40360)

move the discovery and dynamic clients

Moved the dynamic client, discovery client, testing/core, and testing/cache to `client-go`.  Dependencies on api groups we don't have generated clients for have dropped out, so federation, kubeadm, and imagepolicy.

@caesarxuchao @sttts 

approved based on https://github.com/kubernetes/kubernetes/issues/40363
2017-01-26 14:23:42 -08:00
Kubernetes Submit Queue 15466fcca9 Merge pull request #40535 from kubernetes/grodrigues3-patch-1
Automatic merge from submit-queue

Update OWNERS for pkg/controller/deployment

Add approvers to the leaf owners file.

**Release note**:
```NONE
```
2017-01-26 11:59:01 -08:00
Kubernetes Submit Queue 5b75980c32 Merge pull request #40261 from kargakis/fix-deployment-completeness
Automatic merge from submit-queue

controller: old pods should block deployment completeness

Fixes https://github.com/kubernetes/kubernetes/issues/40207
2017-01-26 11:08:03 -08:00
deads2k 9488e2ba30 move testing/core to client-go 2017-01-26 13:54:40 -05:00
grodrigues3 38938cc4d3 Update OWNERS for pkg/controller/deployment
Add approvers to the leaf owners file.
2017-01-26 10:24:52 -08:00
Dr. Stefan Schimanski a0137e9b28 Update generated files 2017-01-25 19:49:45 +01:00
Dr. Stefan Schimanski d7eb3b6870 pkg/util: move uuid and strategicpatch into k8s.io/apimachinery 2017-01-25 19:45:09 +01:00
deads2k b0b156b381 make tools/cache authoritative 2017-01-25 08:29:45 -05:00
deads2k 5a8f075197 move authoritative client-go utils out of pkg 2017-01-24 08:59:18 -05:00
Clayton Coleman 469df12038
refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00
Michail Kargakis 506e71485f controller: old pods should block deployment completeness 2017-01-21 23:52:05 +01:00
deads2k 1ce0637b27 move listers out of cache to reduce import tree 2017-01-20 15:01:38 -05:00
deads2k c47717134b move utils used in restclient to client-go 2017-01-19 07:55:14 -05:00
Michail Kargakis d5227e364d controller: decouple cleanup policy from deployment strategies
Deployments get cleaned up only when they are paused, they get scaled up/down,
or when the strategy that drives rollouts completes. This means that stuck
deployments that fall into none of the above categories will not get cleaned
up. Since cleanup is already safe by itself (we only delete old replica sets
that are synced by the replica set controller and have no replicas) we can
execute it for every deployment when there is no intention to rollback.
2017-01-19 10:33:24 +01:00
Clayton Coleman 9a2a50cda7
refactor: use metav1.ObjectMeta in other types 2017-01-17 16:17:19 -05:00
deads2k 77b4d55982 mechanical 2017-01-16 09:35:12 -05:00
Kubernetes Submit Queue a9f5065833 Merge pull request #39794 from kargakis/updated-unit-tests
Automatic merge from submit-queue

Updated unit tests

@janetkuo updated the flaky unit test to have the same structure with regard to uncasting as the rest of the tests. ptal
2017-01-13 18:39:55 -08:00
Kubernetes Submit Queue 5723979b60 Merge pull request #39525 from kargakis/update-equality-helper
Automatic merge from submit-queue (batch tested with PRs 39807, 37505, 39844, 39525, 39109)

Update deployment equality helper

@mfojtik @janetkuo this is split out of https://github.com/kubernetes/kubernetes/pull/38714 to reduce the size of that PR, ptal
2017-01-13 13:40:45 -08:00
deads2k f1176d9c5c mechanical repercussions 2017-01-13 08:27:14 -05:00
Michail Kargakis 9c4195c50b Fix and tests for SelectorUpdatedBefore 2017-01-13 10:23:08 +01:00
Michail Kargakis e2695d9d05 controller: unit tests for overlapping and recreate deployments 2017-01-13 10:21:51 +01:00
Dawn Chen 3648eaae04 Revert "controller: unit tests for overlapping and recreate deployments" 2017-01-11 17:33:46 -08:00
Kubernetes Submit Queue 9eb7060892 Merge pull request #39088 from kargakis/unit-tests-for-the-d-controller
Automatic merge from submit-queue (batch tested with PRs 39483, 39088, 38787)

controller: unit tests for overlapping and recreate deployments

Belated unit tests for https://github.com/kubernetes/kubernetes/pull/38080 and https://github.com/kubernetes/kubernetes/pull/36748.

@kubernetes/sig-apps-misc
2017-01-11 15:35:46 -08:00
Michail Kargakis 6013186ac3 Update deployment equality helper 2017-01-11 18:34:12 +01:00
deads2k 6a4d5cd7cc start the apimachinery repo 2017-01-11 09:09:48 -05:00
Michail Kargakis 5dc96b5238 Fix and tests for SelectorUpdatedBefore 2017-01-10 12:57:38 +01:00
Michail Kargakis df7a655d30 controller: unit tests for overlapping and recreate deployments 2017-01-10 10:54:23 +01:00
NickrenREN 639572ac68 fix redundant alias and remove unused function 2017-01-09 17:13:09 +08:00
Kubernetes Submit Queue 25e836010f Merge pull request #39527 from kargakis/tests-and-benchmarks-for-adler-and-fnv
Automatic merge from submit-queue (batch tested with PRs 39466, 39490, 39527)

Test and benchmark adler and fnv

Split out of https://github.com/kubernetes/kubernetes/pull/38714

@kubernetes/sig-apps-misc
2017-01-06 11:30:15 -08:00
Michail Kargakis c6a3af5521 Test and benchmark adler and fnv 2017-01-06 17:51:20 +01:00
Jeff Grafton 20d221f75c Enable auto-generating sources rules 2017-01-05 14:14:13 -08:00
Michail Kargakis ce04ee6170 extensions: add readyReplicas in Deployments 2017-01-02 11:59:15 +01:00
Mike Danese 161c391f44 autogenerated 2016-12-29 13:04:10 -08:00
Wojciech Tyczynski d1292a7397 Optimize memory allocations in controller manager 2016-12-27 16:11:11 +01:00
Mayank Kumar 777977612b ReplicaSet has owner ref of the Deployment that created it 2016-12-22 16:45:50 -08:00
Michail Kargakis d19a1109e2 controller: sync deployments once they don't overlap anymore 2016-12-19 14:04:15 +01:00
Michail Kargakis 7ef3e6f7c9 controller: wait for all pods to be deleted before Recreating 2016-12-15 19:55:18 +01:00
Chao Xu 03d8820edc rename /release_1_5 to /clientset 2016-12-14 12:39:48 -08:00
Kubernetes Submit Queue 8abbedae54 Merge pull request #38315 from mikedanese/pin-gazel
Automatic merge from submit-queue

Pin gazel to a version and support cgo

This fixes the bazel build.

@krousey who is buildcop
2016-12-12 19:32:29 -08:00
Kubernetes Submit Queue f45e918b8b Merge pull request #35833 from apelisse/owners-pkg-controller
Automatic merge from submit-queue

Curating Owners: pkg/controller

cc @jsafrane @mikedanese @bprashanth @derekwaynecarr @thockin @saad-ali

In an effort to expand the existing pool of reviewers and establish a
two-tiered review process (first someone **lgtms** and then someone
experienced in the project **approves**), we are adding new reviewers to
existing owners files.
## If You Care About the Process:

We did this by algorithmically figuring out who’s contributed code to
the project and in what directories.  Unfortunately, that doesn’t work
perfectly: people that have made mechanical code changes (e.g change the
copyright header across all directories) end up as reviewers in lots of
places.

Instead of using pure commit data, we generated an excessively large
list of reviewers and pruned based on all time commit data, recent
commit data and review data (number of PRs commented on).

At this point we have a decent list of reviewers, but it needs one last
pass for fine tuning.
## TLDR:

As an owner of a sig/directory and a leader of the project, here’s what
we need from you:
1. Use PR https://github.com/kubernetes/kubernetes/pull/35715 as an example.
2. The pull-request is made editable, please edit the OWNERS file to add
   the names of people that should be reviewing code in the future in the **reviewers** section. You probably do NOT need to modify the **approvers** section.
3. Notify me if you want some OWNERS file to be removed.  Being an approver or reviewer
   of a parent directory makes you a reviewer/approver of the subdirectories too, so not all
   OWNERS files may be necessary.
4. Please use ALIAS if you want to use the same list of people over and
   over again (don't hesitate to ask me for help, or use the pull-request
   above as an example)
2016-12-12 18:51:33 -08:00
Mike Danese c87de85347 autoupdate BUILD files 2016-12-12 13:30:07 -08:00
Kubernetes Submit Queue 83a77fa5a1 Merge pull request #38299 from kargakis/calculate-unavailable-correctly
Automatic merge from submit-queue (batch tested with PRs 38608, 38299)

controller: set unavailableReplicas correctly when scaling down

```
deployment_controller.go:299] Error syncing deployment
e2e-tests-kubectl-2l7xx/e2e-test-nginx-deployment:
Deployment.extensions "e2e-test-nginx-deployment" is invalid:
status.unavailableReplicas: Invalid value: -1:
must be greater than or equal to 0
```

The validation error above occurs usually when a Deployment is
scaled down. In such a case we should default unavailableReplicas
to 0 instead of making an invalid api call.

@kubernetes/deployment
2016-12-12 04:18:04 -08:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Jordan Liggitt 6819706adf
Pass addressable values to DeepCopy 2016-12-08 14:16:01 -05:00
Kubernetes Submit Queue 3519ba4099 Merge pull request #36648 from kargakis/follow-up-to-perma-failed
Automatic merge from submit-queue (batch tested with PRs 38377, 36365, 36648, 37691, 38339)

controller: sync stuck deployments in a secondary queue

@kubernetes/deployment this makes Deployments not depend on a tight resync interval in order to estimate progress.
2016-12-08 10:51:59 -08:00
Michail Kargakis c82cae85f6 controller: set unavailableReplicas correctly when scaling down
deployment_controller.go:299] Error syncing deployment
e2e-tests-kubectl-2l7xx/e2e-test-nginx-deployment:
Deployment.extensions "e2e-test-nginx-deployment" is invalid:
status.unavailableReplicas: Invalid value: -1:
must be greater than or equal to 0

The validation error above occurs usually when a Deployment is
scaled down. In such a case we should default unavailableReplicas
to 0 instead of making an invalid api call.
2016-12-07 17:34:09 +01:00
Michail Kargakis b3765c4df9 Backoff correctly when adopting replica sets/pods 2016-12-07 16:13:18 +01:00
Michail Kargakis a8a7ca28f0 controller: sync stuck deployments in a secondary queue 2016-12-06 18:08:35 +01:00
Clayton Coleman 3454a8d52c
refactor: update bazel, codec, and gofmt 2016-12-03 19:10:53 -05:00
Clayton Coleman 5df8cc39c9
refactor: generated 2016-12-03 19:10:46 -05:00
Kubernetes Submit Queue 256a99d220 Merge pull request #36432 from kargakis/controller-fixes
Automatic merge from submit-queue

Update deployment status only when there is a new scaling update during a rollout

@kubernetes/deployment
2016-12-01 00:39:09 -08:00
yarntime@163.com 1e4c0f33a8 fix typo 2016-11-29 18:20:09 +08:00
Michail Kargakis d87aca66b1 Update deployment status only when there is a new scaling update during a rollout 2016-11-28 13:49:43 +01:00
Clayton Coleman 35a6bfbcee
generated: refactor 2016-11-23 22:30:47 -06:00
Chao Xu bcc783c594 run hack/update-all.sh 2016-11-23 15:53:09 -08:00
Chao Xu b50367cbdc remove v1.Semantics 2016-11-23 15:53:09 -08:00
Chao Xu 96cd71d8f6 kubectl 2016-11-23 15:53:09 -08:00
Chao Xu 7eeb71f698 cmd/kube-controller-manager 2016-11-23 15:53:09 -08:00
Kubernetes Submit Queue b85acd957a Merge pull request #36579 from kargakis/restore-events-for-tests
Automatic merge from submit-queue

Restore event messages for replica sets in the deployment controller

Needed to unblock release upgrade tests (see https://github.com/kubernetes/kubernetes/issues/36453)

@kubernetes/deployment ptal
2016-11-11 15:50:31 -08:00
Michail Kargakis 9afe2c3a7c Do not emit event for AlreadyExists errors 2016-11-11 10:49:05 +01:00
Michail Kargakis 8cd4459b6c Do not handle AlreadyExists errors yet 2016-11-10 15:45:56 +01:00
Michail Kargakis 8ef6fdde72 Restore event messages for replica sets in the deployment controller 2016-11-10 14:34:40 +01:00
Kubernetes Submit Queue 2a674307f5 Merge pull request #36430 from kargakis/fix-deployment-progress-estimation
Automatic merge from submit-queue

Use the correct time field to estimate progress in deployments

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

@kubernetes/deployment
2016-11-09 08:49:53 -08:00
Michail Kargakis 9fe910dac5 controller: fix panic in deployments 2016-11-09 12:25:23 +01:00
Michail Kargakis 2972538f5b Use the correct time field to estimate progress in deployments 2016-11-08 11:41:53 +01:00
Kubernetes Submit Queue 2c50d2b6fc Merge pull request #36094 from janetkuo/overlapping-deployment-select
Automatic merge from submit-queue

Update how we detect overlapping deployments

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://github.com/kubernetes/kubernetes/blob/master/CONTRIBUTING.md and developer guide https://github.com/kubernetes/kubernetes/blob/master/docs/devel/development.md
2. If you want *faster* PR reviews, read how: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/faster_reviews.md
3. Follow the instructions for writing a release note: https://github.com/kubernetes/kubernetes/blob/master/docs/devel/pull-requests.md#release-notes
-->

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

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

**Special notes for your reviewer**: cc @kubernetes/deployment 

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
NONE
```

When looking for overlapping deployments, we should also find other deployments that select current deployment's pods,
not just the ones whose pods are selected by current deployment.
2016-11-05 21:04:58 -07:00
Michail Kargakis f52ea8fc67 Update replica annotations every time they are out of sync 2016-11-04 16:29:41 +01:00
Michail Kargakis a5029bf373 controller: support perma-failed deployments
This commit adds support for failing deployments based on a timeout
parameter defined in the spec. If there is no progress for the amount
of time defined as progressDeadlineSeconds then the deployment will be
marked as failed by adding a condition with a ProgressDeadlineExceeded
reason in it. Progress in the context of a deployment means the creation
or adoption of a new replica set, scaling up new pods, and scaling down
old pods.
2016-11-04 13:36:46 +01:00
Antoine Pelisse e73a10fe46 Update OWNERS based on PR comments 2016-11-02 16:28:23 -07:00
Antoine Pelisse db35acde19 Update OWNERS: Remove reviewers: pkg/controller 2016-11-02 16:19:19 -07:00
Antoine Pelisse c695a54c1c Update OWNERS approvers and reviewers: pkg/controller 2016-11-02 16:19:18 -07:00
Janet Kuo 9f3560c563 Update how we detect overlapping deployments
When looking for overlapping deployments, we should also find other deployments that select current deployment's pods,
not just the ones whose pods are selected by current deployment.
2016-11-02 15:29:28 -07:00
Kubernetes Submit Queue 7f309f5fae Merge pull request #35471 from caesarxuchao/client-gen-multi-versions
Automatic merge from submit-queue

Let release_1_5 clientset include multiple versions of a group

Fix #35237 

This PR make versioned clientset to include multiple versions of a group. Currently only `batch` has `v1` and `v2alpha1`. The clientset interface now looks like:
```go
	BatchV2alpha1() v2alpha1batch.BatchV2alpha1Interface
	BatchV1() v1batch.BatchV1Interface
	// Deprecated: please explicitly pick a version if possible.
	Batch() v1batch.BatchV1Interface
```

Commit "update client-gen to say internalversion rather than unversioned" fixes https://github.com/kubernetes/kubernetes/issues/24481. 


cc @kubernetes/sig-api-machinery @soltysh @deads2k @nikhiljindal 



```release-note
release_1_5 clientset supports multiple versions of a group.
```
2016-10-29 15:40:13 -07:00
Kubernetes Submit Queue 7c9c8cbf28 Merge pull request #34952 from kargakis/update-observedgeneration-for-overlapping-deployments
Automatic merge from submit-queue

Make overlapping deployments deletable

@kubernetes/deployment ptal

Fixes https://github.com/kubernetes/kubernetes/issues/34466 by 1) not adding the overlapping annotation in the working deployment, 2) updates observedGeneration for overlapping deployments, and 3) updates the kubectl deployment reaper to do non-cascading deletion for deployments with the overlapping annotation.
2016-10-29 14:50:16 -07:00
Chao Xu 850729bfaf include multiple versions in clientset
update client-gen to use the term "internalversion" rather than "unversioned";
leave internal one unqualified;
cleanup client-gen
2016-10-29 13:30:47 -07:00
Chao Xu 17426490d9 remove unnecessary import rename 2016-10-26 17:32:44 -07:00
Mike Danese 3b6a067afc autogenerated 2016-10-21 17:32:32 -07:00
Jan Chaloupka 6079053407 Update clientset generator to use RESTClient interface instead of the RESTClient data type 2016-10-21 10:13:51 +02:00
Michail Kargakis f2ae192e3a controller: update overlapping deployments to be deletable 2016-10-18 17:46:34 +02:00
Kubernetes Submit Queue b008c683ec Merge pull request #34548 from kargakis/estimate-available-from-rs
Automatic merge from submit-queue

controller: set minReadySeconds in deployment's replica sets

* Estimate available pods for a deployment by using minReadySeconds on
the replica set.
* Stop requeueing deployments on pod events, superseded by following the
replica set status.
* Cleanup redundant deployment utilities

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

@kubernetes/deployment ptal
2016-10-17 08:44:51 -07:00
Kubernetes Submit Queue 13196527cf Merge pull request #34759 from caesarxuchao/remove-unversioned
Automatic merge from submit-queue

Remove imports of "pkg/client/unversioned" in "pkg/controller"

We are trying to deprecate "pkg/client/unversioned", see https://github.com/kubernetes/kubernetes/issues/25442.

Also part of https://github.com/kubernetes/kubernetes/issues/29934.
2016-10-15 00:10:15 -07:00
Chao Xu 3be2411c7a cleanup the remaining 2016-10-13 16:10:24 -07:00
Chao Xu fbd187af45 move the retry util out of pkg/client/unversioned 2016-10-13 16:10:24 -07:00
Michail Kargakis 212a26dc95 controller: set minReadySeconds in deployment's replica sets
* Estimate available pods for a deployment by using minReadySeconds on
the replica set.
* Stop requeueing deployments on pod events, superseded by following the
replica set status.
* Cleanup redundant deployment utilities
2016-10-13 12:27:47 +02:00
Kubernetes Submit Queue 5496d22733 Merge pull request #34456 from kargakis/revert-29808
Automatic merge from submit-queue

Revert "Error out when any RS has more available pods then its spec r…

Reverts https://github.com/kubernetes/kubernetes/pull/29808

The PR is wrong because we can have more available pods than desired every time we scale down.

@kubernetes/deployment ptal
2016-10-13 03:01:47 -07:00
deads2k 81a8efda28 fix unfiltered comparison 2016-10-12 08:06:10 -04:00
Kubernetes Submit Queue 1a123f9fc5 Merge pull request #34145 from lukaszo/revision
Automatic merge from submit-queue

Fix missleading comment

**What this PR does / why we need it**: It just  fixes misleading comment. It took me some time to figure out real behavior.
2016-10-12 04:31:02 -07:00
deads2k 2ad0fbd99a filter informer actions when inspecting controller unit test reactions 2016-10-11 13:12:58 -04:00
Kubernetes Submit Queue db0529fc7c Merge pull request #34349 from deads2k/controller-07-d-contorller
Automatic merge from submit-queue

convert deployment controller to shared informers

Converts the deployment controller to shared informers.

@kargakis I think you've been in here.  Pretty straight forward swap.

Fixes #27687
2016-10-11 05:46:38 -07:00
Michail Kargakis 2c797a80af Revert "Error out when any RS has more available pods then its spec replicas"
This reverts commit 32ababbe1b.
2016-10-10 19:02:31 +02:00
Michail Kargakis 75f30ec46f kubectl: add --revision flag in rollout status 2016-10-10 15:04:46 +02:00
Kubernetes Submit Queue 5562715ae5 Merge pull request #34249 from kargakis/retain-old-revisions
Automatic merge from submit-queue

controller: save older revisions for Deployment's replica sets

@jwforres the only usable way  I could find for multiple old revisions for a single replica set is to stuff them as comma-separated values.

@kubernetes/deployment this retains old revisions served by a replica set inside an annotation.

Fixes https://github.com/kubernetes/kubernetes/issues/33844
2016-10-08 01:32:47 -07:00
deads2k aa5cbb704f convert deployment controller to shared informers 2016-10-07 15:06:57 -04:00
deads2k 518d5500c7 remove testapi.Default.GroupVersion 2016-10-07 10:10:54 -04:00
Michail Kargakis 89eaa918be controller: save older revisions for Deployment's replica sets 2016-10-07 11:45:06 +02:00
Michail Kargakis 52822d7d6b Add a test case and consolidate deployment constructors 2016-10-06 10:37:35 +02:00
Michail Kargakis ed8b77087a controller: scale proportionally before rolling out new templates 2016-10-06 10:36:39 +02:00
Łukasz Oleś 9730fc3b42 Fix misleading comment 2016-10-05 23:59:34 +02:00
deads2k c30b2efc46 update replicaset lister 2016-10-05 15:20:27 -04:00
deads2k 358a57d74a update deployment lister 2016-10-05 13:27:35 -04:00
Michail Kargakis f7c232b8c6 extensions: add minReadySeconds/availableReplicas to replica sets 2016-09-28 11:06:40 +02:00
Michail Kargakis 0a843a50ba controller: don't retry deployments with overlapping selectors
Returning an error will cause the deployment to be requeued. We should
just emit an event for deployments with overlapping selectors and silently
drop then out of the queue. This should be transitioned to a Condition
once we have them.
2016-09-26 17:59:51 +02:00
Michail Kargakis 59da5385e0 controller: enhance timeout error message for Recreate deployments 2016-09-20 15:53:24 +02:00
Mike Danese a765d59932 move informer and controller to pkg/client/cache
Signed-off-by: Mike Danese <mikedanese@google.com>
2016-09-15 12:50:08 -07:00
lojies 9498b227a1 change infof to Errorf in some codes 2016-09-12 15:55:42 +08:00
deads2k 4317173d3f add names for workqueues to gather controller latency/depth metrics 2016-08-30 09:51:50 -04:00
Michail Kargakis baa0c6d9de controller: skip copying selector annotations from deployments 2016-08-29 17:51:05 +02:00
Kubernetes Submit Queue 68f54756c2 Merge pull request #31449 from janetkuo/return-deployment-rollback
Automatic merge from submit-queue

Use updated deployment after rollback

@kubernetes/deployment 

**Release note**:
<!--  Steps to write your release note:
1. Use the release-note-* labels to set the release note state (if you have access) 
2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`. 
-->
```release-note
NONE
```
2016-08-26 06:49:06 -07:00
Janet Kuo 6e86a20304 Use updated deployment after rollback 2016-08-25 13:08:52 -07:00
Janet Kuo 90557ec56c Handle overlapping deployments gracefully
1. When overlapping deployments are discovered, annotate them
2. Expose those overlapping annotations as warnings in kubectl describe
3. Only respect the earliest updated one (skip syncing all other overlapping deployments)
4. Use indexer instead of store for deployment lister
2016-08-23 14:33:30 -07:00
Chao Xu 594234d61c fix tests; convert IsPodActive to operate on *Pod 2016-08-17 13:05:37 -07:00
Wojciech Tyczynski 331083727f Change podNamespacer API 2016-08-17 16:55:01 +02:00
Wojciech Tyczynski acfd8c787f Avoid computing super-expensive DeepEqual on every pod update 2016-08-11 08:35:36 +02:00
Kubernetes Submit Queue 8da97dff86 Merge pull request #30011 from janetkuo/map-concurrent-write-read
Automatic merge from submit-queue

Fix the map concurrent read/write issue in deployment controller

Fixes #29960

@lavalamp @kubernetes/deployment
2016-08-04 08:25:43 -07:00
Kubernetes Submit Queue 74477a83e4 Merge pull request #29889 from janetkuo/deployment-e2e-test-fix
Automatic merge from submit-queue

Fix deployment e2e test: waitDeploymentStatus should error when entering an invalid state

Follow up #28162

1. We should check that max unavailable and max surge aren't violated at all times in e2e tests (didn't check this in deployment scaled rollout yet, but we should wait for it to become valid and then continue do the check until it finishes)
2. Fix some minor bugs in e2e tests 

@kubernetes/deployment
2016-08-04 00:43:41 -07:00
Janet Kuo 2d1490a024 Fix the map concurrent read/write issue in deployment controller 2016-08-03 16:51:53 -07:00
Kubernetes Submit Queue 67c7401fd8 Merge pull request #26688 from asalkeld/more-unittests-util-env
Automatic merge from submit-queue

Increase the unit test coverage in pkg/util

These are easy to test, so lets increase coverage.
2016-08-03 13:43:28 -07:00
k8s-merge-robot 01cd7f326e Merge pull request #29621 from resouer/uuid
Automatic merge from submit-queue

Refactor uuid into its own pkg util/uuid

Continuing my work ref #15634

Anyone can review this if he/she wants.
2016-08-01 22:21:30 -07:00
Janet Kuo 808041cbd4 Update deployment e2e test to check violated rollingupdate strategy 2016-08-01 17:05:22 -07:00
Janet Kuo a82c55213b Fix incorrect reference to deployment in test 2016-08-01 17:05:22 -07:00
Michal Rostecki 59ca5986dd Print/log pointers of structs with %#v instead of %+v
There are many places in k8s where %+v is used to format a pointer
to struct, which isn't working as expected.

Fixes #26591
2016-08-01 22:27:56 +02:00
Janet Kuo 32ababbe1b Error out when any RS has more available pods then its spec replicas 2016-07-30 15:34:15 -07:00
Harry Zhang c495397cae Refactor uuid into its own pkg 2016-07-30 00:07:02 -04:00
Janet Kuo b45afc04a2 Use nonexistent image instead of minReadySeconds in deployment rollover e2e test 2016-07-25 11:45:46 -07:00
k8s-merge-robot ca06157421 Merge pull request #28162 from kargakis/annotation-fixes-for-scaling
Automatic merge from submit-queue

controller: update all rs annotations on a scaled rollout

Closes https://github.com/kubernetes/kubernetes/issues/28145

@kubernetes/deployment
2016-07-25 10:58:18 -07:00
Michail Kargakis 62afa3de71 controller: update all rs annotations on a scaled rollout
When a new rollout with a different size than the previous size of the
deployment is initiated then only the new replica set will notice the
new size. Old replica sets are not updated by the rollout path.
2016-07-20 22:40:43 +02:00
Janet Kuo 07d25fdc47 Log the time when checking deployment's pod availability 2016-07-19 14:08:28 -07:00
k8s-merge-robot 23f0edb8b0 Merge pull request #27713 from kargakis/wait-for-synced-rs-in-recreate
Automatic merge from submit-queue

controller: wait for synced old replica sets on Recreate

Partially fixes https://github.com/kubernetes/kubernetes/issues/27362

Any other work on it should be handled in the replica set level (and/or kubelet if it's required)

@kubernetes/deployment PTAL
2016-07-12 20:30:12 -07:00
gmarek 7815a3e7bc DeploymentController doesn't take any actions when being deleted 2016-07-12 09:43:08 +02:00
Michail Kargakis 1fb8dd838b controller: various fixes for the deployment controller
Changes:
* moved waiting for synced caches before starting any work
* refactored worker() to really quit on quit
* changed queue to a ratelimiting queue and added retries on errors
* deep-copy deployments before mutating - we still need to deep-copy
replica sets and pods
2016-07-08 17:30:40 +02:00
Angus Salkeld 6a0577cfcc Increase coverage in pkg/util/deployment 2016-07-08 12:35:23 +02:00
Angus Salkeld eec08872c7 Move deployment utilities to there own package 2016-07-08 09:46:56 +02:00
Janet Kuo 08305f12a2 Log available pods of deployments when scaling down old RS 2016-07-06 13:31:28 -07:00
Michail Kargakis 39576b47ba controller: wait for synced old replica sets on Recreate 2016-07-04 18:23:58 +02:00
Michail Kargakis 332d151d61 Break deployment controller into separate self-contained files
* rolling.go (has all the logic for rolling deployments)
* recreate.go (has all the logic for recreate deployments)
* sync.go (has all the logic for getting and scaling replica sets)
* rollback.go (has all the logic for rolling back a deployment)
* util.go (contains all the utilities used throughout the controller)

Leave back at deployment_controller.go all the necessary bits for
creating, setting up, and running the controller loop.

Also add package documentation.
2016-07-02 09:53:52 +02:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Oleg Shaldybin aff173f7d1 Fix expectations in deployment controller test
Since fake clientset now correctly tracks objects created by deployment
controller, it triggers different controller behavior: controller only
creates replica set once and updates deployment once.
2016-06-28 11:54:13 -07:00
k8s-merge-robot fc1937f68f Merge pull request #20273 from kargakis/allow-scaling-paused-deployments
Automatic merge from submit-queue

Proportionally scale paused and rolling deployments

Enable paused and rolling deployments to be proportionally scaled.
Also have cleanup policy work for paused deployments.

Fixes #20853
Fixes #20966
Fixes #20754

@bgrant0607 @janetkuo @ironcladlou @nikhiljindal

<!-- Reviewable:start -->
---
This change is [<img src="http://reviewable.k8s.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](http://reviewable.k8s.io/reviews/kubernetes/kubernetes/20273)
<!-- Reviewable:end -->
2016-06-24 19:41:51 -07:00
Janet Kuo 726ba45b59 Deployment controller's cleanupUnhealthyReplicas should respect minReadySeconds 2016-06-20 15:03:57 -07:00
Michail Kargakis f3d2e3ff22 controller: proportionally scale paused and rolling deployments
Enable paused and rolling deployments to be proportionally scaled.
Also have cleanup policy work for paused deployments.
2016-06-20 12:13:35 +02:00
Janet Kuo 764df2e096 Listing pods only once when getting pods for RS in deployment 2016-06-10 09:55:28 -07:00
Janet Kuo 36f704c975 List RSes only once when getting old+new RSes in deployment controller 2016-06-02 11:24:43 -07:00
Janet Kuo 310a7d2eb5 Adding logs in deployment for debugging 2016-05-31 15:59:46 -07:00
jianhuiz 441e206671 move server client shared annotations to new api/annotations package 2016-05-09 11:10:44 -07:00
mqliang 9011207f18 add namespace index to rc and pod 2016-05-06 17:12:36 +08:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
gmarek 3171aac57c Generated clients can return their RESTClients, RESTClient can return its RateLimiter 2016-04-27 22:15:10 +02:00
Chao Xu 8537095415 use fully qualified resource in fake clients actions 2016-04-20 19:44:40 -07:00
Chao Xu 49559a3332 Generate the typed clients under the clientset folder 2016-03-31 15:28:45 -07:00
k8s-merge-robot e35efb5765 Merge pull request #23467 from mikedanese/dont-sync-deployment
Auto commit by PR queue bot
2016-03-29 06:42:20 -07:00
Mike Danese c4305762b2 don't sync deployment when pod selector is empty 2016-03-28 10:12:41 -07:00
goltermann 32d569d6c7 Fixing all the "composite literal uses unkeyed fields" Vet errors. 2016-03-25 15:25:09 -07:00
Janet Kuo 482efba8de Copy annotations back from RS to Deployment on rollback 2016-03-21 10:21:48 -07:00
Janet Kuo 26bcdb1bd6 Separate GetOldRS and GetNewRS in deployment controller (get and mutate) and deployment util (get only) 2016-03-15 10:23:20 -07:00
Janet Kuo 4a181dacec Fix the possible negative scale down value; add logs when scaling down 2016-03-10 16:01:18 -08:00
Madhusudan.C.S db48dcf583 ReplicaSetSpec.Template shouldn't be a pointer.
PodTemplateSpec should be consistent for all the types in extensions/v1beta1.

See PR #19510.
2016-03-09 21:24:16 -08:00
Michail Kargakis 1388919976 controller: resolve unavailable in conjuction with surge for deployments
Due to rounding down for maxUnavailable, we may end up with deployments
that have zero surge and unavailable pods something that 1) is not allowed
as per validation, 2) blocks deployments. If we end up in such a situation
set maxUnavailable to 1 on the theory that surge might not work due to
quota.
2016-03-07 13:03:41 +01:00
k8s-merge-robot 8ab8231c20 Merge pull request #22577 from jpiccari/master
Auto commit by PR queue bot
2016-03-06 00:18:53 -08:00
Joshua Piccari f5f83b076a Improve go report card by fixing typos in comments 2016-03-04 18:30:59 -08:00
Janet Kuo 59b1f5b8b5 Log contents of pods on creation/update/deletion in controllers 2016-03-04 13:57:34 -08:00
Janet Kuo 48dc694ba6 Add more comments and rename getAllReplicaSets to getAllReplicaSetsAndSyncRevision 2016-03-02 17:51:35 -08:00
Janet Kuo e42eab59bc Add comments about deployment revision update 2016-03-02 11:19:48 -08:00
Janet Kuo 67bfe5d796 Avoid copying deployment revision annotations to rs 2016-03-01 17:25:44 -08:00
Janet Kuo 1706df6242 Revision number should be updated only when it's smaller than it should be 2016-03-01 17:12:24 -08:00
k8s-merge-robot 8d90b2a61b Merge pull request #22213 from janetkuo/deployment-type-assert
Auto commit by PR queue bot
2016-03-01 00:08:48 -08:00
k8s-merge-robot 5b415a7aed Merge pull request #22210 from janetkuo/deployment-e2e
Auto commit by PR queue bot
2016-02-29 22:44:40 -08:00
Janet Kuo 1b831babe7 Move deployment Add/Update/DeleteFunc into functions 2016-02-29 18:19:48 -08:00
Janet Kuo 1960243d82 Fix type assertion error in deployment controller DeleteFunc 2016-02-29 18:19:33 -08:00
nikhiljindal 2019d18e9a Fixing a bug in deployment controller cleanupOldReplicaSets 2016-02-29 16:40:35 -08:00
Janet Kuo f129d97262 Fill missing arg in log 2016-02-29 14:26:19 -08:00
Brian Grant d0dd4f8a93 Restore expectation timeout to 5 minutes. Fix enqueueDeployment. Pass by reference.
Make names of ReplicaSets created by Deployment deterministic for idempotence.
Eliminate use of expectations in Deployment controller.
2016-02-28 07:33:07 +00:00
Brian Grant 39f0edca75 Fix expectations in Deployment. Ref #19299. 2016-02-26 06:15:26 +00:00
mqliang 06d57ec7f4 Deployment: preserve availability when maxUnavailability is not 100% 2016-02-25 13:30:06 +08:00
Brian Grant bea349a80d Merge pull request #21856 from bprashanth/ttl_race
Lock across item expiration in the ttl store.
2016-02-24 15:06:25 -08:00
Brian Grant 88056edab2 Merge pull request #21902 from janetkuo/deployment-unavailable-replicas
Fix the incorrect deployment.status.unavailableReplicas
2016-02-24 14:48:04 -08:00
Brian Grant 0b5edab208 Merge pull request #21857 from nikhiljindal/stopDeployment
fix deployment e2e flake: Update DeploymentReaper.Stop to use ObservedGeneration
2016-02-24 14:26:23 -08:00
Janet Kuo 062b9f86b9 Fix the incorrect deployment.status.unavailableReplicas 2016-02-24 14:09:49 -08:00
Prashanth Balasubramanian 7e88b3ec84 Remove ttl store from controllers. 2016-02-24 14:06:22 -08:00
Brian Grant 832bc37ee4 Merge pull request #21713 from janetkuo/deployment-actual-replicas
Report actual replicas in deployment status
2016-02-24 13:55:16 -08:00
nikhiljindal 9d7259950b Update status for paused deployments 2016-02-24 00:49:03 -08:00
kargakis 7a3d40786b switch internal field to int64 2016-02-23 19:30:33 +01:00
kargakis 418d79cb78 extensions: add observedGeneration for deployments 2016-02-23 18:47:40 +01:00
Janet Kuo 3901423272 Report actual replicas in deployment status 2016-02-22 14:28:28 -08:00
Janet Kuo da58172283 Ensure Deployment labels adopted ReplicaSets and pods 2016-02-22 10:58:54 -08:00
k8s-merge-robot be9dfcaec4 Merge pull request #21210 from mqliang/hasSync-early
Auto commit by PR queue bot
2016-02-20 09:54:12 -08:00
k8s-merge-robot eb45154996 Merge pull request #21348 from caesarxuchao/generate-fake-for-1-2
Auto commit by PR queue bot
2016-02-18 23:02:05 -08:00
mqliang ced5eb7a71 return early if has not synced 2016-02-18 11:56:52 +08:00
Chao Xu ad46715f51 generate fake client for release_1_2 2016-02-17 16:10:02 -08:00
Janet Kuo fe4bf6ff5c When syncRecreateDeployment, don't create a new RS before scaling down 2016-02-16 18:05:44 -08:00
Janet Kuo e9262df456 Scale up early when deployment creates new Replica set 2016-02-16 18:05:44 -08:00
k8s-merge-robot 3616b4bfec Merge pull request #21044 from mqliang/deployment-util
Auto commit by PR queue bot
2016-02-16 15:33:26 -08:00
Chao Xu 97aecd002a remove underscore in imported pkg names 2016-02-16 10:54:51 -08:00
mqliang fcf0d6d720 add GetValueFromIntOrPercent helper funcs 2016-02-15 23:06:02 +08:00
mqliang d96cdb93c4 move helper funcs to util/deployment.go from util.go 2016-02-15 22:36:48 +08:00
k8s-merge-robot 3b4c0beb99 Merge pull request #20868 from mqliang/int-min-max
Auto commit by PR queue bot
2016-02-13 17:32:22 -08:00
k8s-merge-robot 524aaa2f7f Merge pull request #21152 from kargakis/fix-cleanup-policy
Auto commit by PR queue bot
2016-02-13 03:47:33 -08:00
Michail Kargakis b9839d0677 controller: fix cleanup policy for deployments
Cleanup policy should run on all replica sets and not only on those that
have pods (we will not cleanup those anyway).
2016-02-12 19:14:18 +01:00
Janet Kuo 2731e5fe20 Check pod HasSynced in deployment controller manager 2016-02-12 00:11:27 -08:00
mqliang 7be9071584 create some integer min/max function 2016-02-12 11:20:11 +08:00
Madhusudan.C.S ed7ad6dcf3 Make deployments work. 2016-02-08 21:27:49 -08:00
Madhusudan.C.S 518f08aa7c Move Deployments to ReplicaSets and switch the Deployment selector to the new LabelSelector.
Update the Deployments' API types, defaulting code, conversions, helpers
and validation to use ReplicaSets instead of ReplicationControllers and
LabelSelector instead of map[string]string for selectors.

Also update the Deployment controller, registry, kubectl subcommands,
client listers package and e2e tests to use ReplicaSets and
LabelSelector for Deployments.
2016-02-08 21:27:38 -08:00
k8s-merge-robot a2c8712aee Merge pull request #20368 from mqliang/cleanup-unhealthy-replicas
Auto commit by PR queue bot
2016-02-08 20:18:25 -08:00
mqliang 86aea1d59c clean up unhealthy replicas frst for old rcs when reconcileOldRCs 2016-02-09 07:43:48 +08:00
Jan Chaloupka 4389b3f0d6 Rewritte util.* -> wait.* wherever reasonable 2016-02-07 12:02:20 +01:00
k8s-merge-robot b45a94bc78 Merge pull request #20765 from janetkuo/remove-podtemplate-key
Auto commit by PR queue bot
2016-02-06 00:44:47 -08:00
Janet Kuo bb0c5fea0e Fix test failure 2016-02-05 17:26:07 -08:00
Mike Danese b1743a6887 this is a manual reversion of #20702
I can't revert with github which says "Sorry, this pull request couldn’t be
reverted automatically. It may have already been reverted, or the content may
have changed since it was merged."

Reverts commit: 0c191e787b
2016-02-05 16:34:02 -08:00
Janet Kuo 7e9fb97b7d Remove UniqueLabelKey from deployment spec 2016-02-05 16:21:44 -08:00
Chao Xu 184440f8ef rename release_1_2 to internalclientset 2016-02-05 14:02:28 -08:00
k8s-merge-robot 4ecfe4d207 Merge pull request #20678 from janetkuo/dont-copy-apply-annotation
Auto commit by PR queue bot
2016-02-05 05:23:08 -08:00
gmarek 0c191e787b Split controller flags between controllers 2016-02-05 12:17:51 +01:00
Janet Kuo 40849a5b50 Skip apply annotation when copying annotations from deployment to RC 2016-02-04 23:30:31 -08:00
Chao Xu 1b047f8e67 rename legacy to core 2016-02-04 14:26:56 -08:00
Saad Ali 0952dcd349 Merge pull request #20389 from mqliang/deployment-MinReadySeconds
Move MinReadySeconds out of RollingUpdateDeployment
2016-02-03 22:44:14 -08:00
k8s-merge-robot 16aa40cc33 Merge pull request #20035 from janetkuo/record-command
Auto commit by PR queue bot
2016-02-03 20:19:08 -08:00
k8s-merge-robot 65ebe19164 Merge pull request #20584 from caesarxuchao/release_1_2
Auto commit by PR queue bot
2016-02-03 19:46:27 -08:00
Chao Xu f9f5736b01 grep sed 2016-02-03 13:06:07 -08:00
Janet Kuo e3cb44aaff Copy deployment's annotations to its RC 2016-02-03 10:19:06 -08:00
Janet Kuo 5088d0e147 Record kubectl commands 2016-02-03 10:19:05 -08:00
mqliang c4a1ab42e3 Move MinReadySeconds out of RollingUpdateDeployment 2016-02-03 11:38:11 +08:00
Janet Kuo 442c75045a Add kubectl rollout undo 2016-02-02 14:20:01 -08:00
k8s-merge-robot 17a5058e83 Merge pull request #19893 from janetkuo/kubectl-rollout-history
Auto commit by PR queue bot
2016-02-02 01:13:15 -08:00
Janet Kuo 8fb86a3d3b Add kubectl rollout history 2016-02-01 15:32:43 -08:00
harry 1032067ff9 Replace runtime reference by pkg 2016-02-01 21:06:44 +08:00
Chao Xu c72d234bbf replacing handwritten client in several controllers 2016-01-31 15:42:02 -08:00
Janet Kuo 3396db9510 Add rollback subresource; add rollback logic to deployment controller 2016-01-30 16:00:34 -08:00
Janet Kuo 42f712467e Use ListOptions when listing RCs in deployment 2016-01-30 12:04:35 -08:00
Janet Kuo c84a0371a2 Deployment adds version info to its new rc 2016-01-30 12:04:35 -08:00
k8s-merge-robot 783d1d00d7 Merge pull request #20139 from janetkuo/rcList-namespace
Auto commit by PR queue bot
2016-01-30 09:42:35 -08:00
mqliang c5cda2012a cleanup-policy 2016-01-30 09:57:21 +08:00
Janet Kuo 7255af6de3 Fix e2e test failure for RecreateDeployment 2016-01-27 15:04:54 -08:00
Michail Kargakis 436d2677f9 extensions: support paused deployments
This commit adds support for paused deployments so a user can choose
when to run a deployment that exists in the system instead of having
the deployment controller automatically reconciling it after every
change or sync interval.
2016-01-26 12:42:26 +01:00
Janet Kuo 14f4f1b065 Make listing deployment rcStore namespaced 2016-01-25 19:13:17 -08:00
Janet Kuo 9739a67833 Deployment status: number of available/unavailable pods 2016-01-25 14:30:15 -08:00
Alex Mohr 8c9aa2af33 Merge pull request #19733 from janetkuo/flaky-deployment-recreate
Fix e2e flake: Sync deployment status when with RecreateDeploymentStrategy
2016-01-21 10:23:21 -08:00
Alex Mohr a9050679a5 Merge pull request #19520 from janetkuo/deployment-expectation-fix
Fix e2e flake: Fix incorrect expectation when deployment scaling down old rcs
2016-01-20 13:44:30 -08:00
Marek Grabowski 810544633e Merge pull request #19751 from mikedanese/fix-nil
deployment: fix nil pointer panic
2016-01-18 18:08:33 +01:00
k8s-merge-robot ad827c6b62 Merge pull request #19573 from madhusudancs/daemonset-update-move-utils
Auto commit by PR queue bot
2016-01-17 08:16:11 -08:00
Mike Danese 78d27a5d2f deployment: fix nil pointer panic 2016-01-15 17:58:01 -08:00
Janet Kuo d693ffaa57 Fix incorrect expectation when deployment scaling down old rcs 2016-01-15 16:29:53 -08:00
Janet Kuo 5a22e30b7d Sync deployment status when with RecreateDeploymentStrategy 2016-01-15 16:10:06 -08:00
Mike Danese 1acfb151b6 Merge pull request #19433 from janetkuo/deployment-e2e-flake-fix
Fix flaky e2e: Use expectation model for deployment's new rc creation
2016-01-14 13:23:46 -08:00
mqliang 92798408af implement reconcileRecreateDeployment 2016-01-13 11:27:26 +08:00
Madhusudan.C.S 4caa8a2c1d Move pod template hash and label adding util functions to their packages.
These utilities are useful outside Deployments as well, for example
in DaemonSets for DaemonSet updates. So move them to their own util
packages.
2016-01-12 16:11:00 -08:00
Janet Kuo e1554c0f4d Fix flaky e2e: Use expectation model for deployment's new rc creation 2016-01-12 14:48:57 -08:00
Janet Kuo c782aaa504 Wait for rc store synced before syncing deployment 2016-01-06 12:43:06 -08:00
Mike Danese b2aa98f50d fix flake in deployment unit test 2015-12-22 14:28:44 -08:00
Janet Kuo 1a8f96231a Add expectation model for pod deletion 2015-12-17 19:29:54 -08:00
Janet Kuo 32d153093e Fix deployment tests failures; change ResyncPeriod 2015-12-17 19:29:54 -08:00