Commit Graph

66 Commits (98acd800da0f38e348a5637ef1c8c67c8127d055)

Author SHA1 Message Date
Michail Kargakis 3ee150fcc0 kubectl: ignore deleted pods in the rolling updater 2016-12-22 14:26:17 +01:00
Wojciech Tyczynski e8d1cba875 GetOptions in client calls 2016-12-09 09:42:01 +01:00
Kubernetes Submit Queue b650149ee1 Merge pull request #37096 from andor-pierdelacabeza/patch-1
Automatic merge from submit-queue (batch tested with PRs 38260, 32811, 28458, 33570, 37096)

Fix renaming order shown on terminal
2016-12-08 02:11:26 -08: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
Chao Xu 96cd71d8f6 kubectl 2016-11-23 15:53:09 -08:00
Alvaro [Andor] f2fcf659fc Fix renaming order shown on terminal
When finishing a rolling update, a message is shown :
'Renaming oldRc to newRc'
In my case that'd be:
'Renaming nginx to nginx-df8d9fafc5007d83968cd37c8353d52e'
That naming order is incorrect, as the new name is temporary, and the final name should be the old one
2016-11-18 16:17:25 +01: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 fbd187af45 move the retry util out of pkg/client/unversioned 2016-10-13 16:10:24 -07:00
deads2k f756e43e7f convert rolling updater to generated client 2016-09-12 07:38:34 -04:00
lixiaobing10051267 849a8df35d make correction to two variables in inverse order 2016-08-05 16:17:01 +08:00
Kubernetes Submit Queue e7d01097dc Merge pull request #29971 from caesarxuchao/fix-kubectl-rolling-update-with-gc
Automatic merge from submit-queue

[GarbageCollector] Fix kubectl rolling-update to work with GC

This changes the order of the [Rename()](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532) function. After the change, Rename() first deletes the old RC and orphans its pods, then creates the new RC, which will then have a chance to adopt the orphaned pods.

This also fixes the "should support rolling-update to same image" [test](https://github.com/kubernetes/kubernetes/blob/master/test/e2e/kubectl.go#L915) when the garbage collector is on.

Here is the detailed explanation on why the test would have failed:
`kubectl rolling-update` will [rename](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubectl/rolling_updater.go#L532-L546) the RC. It first creates the an identical RC (including spec.selectors) with the new name, then it deletes the existing RC. When GC is turned on, the newly created RC cannot adopt the existing pod, because it has a controllerRef pointing to the exising RC, so the new RC will create new pods and expect to see the creation. However, the new RC and the old RC have the same selector, so sometimes the old RC, instead of the new RC, has its [expectation lowered](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346-L362), the new RC's expectation will stuck forever. The e2e test then times out when executing `kubectl delete newRC`, because there is the new RC will not scale down as its expectation is not fulfilled.

A side-note, we should fix [rm.getPodController()](https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/replication/replication_controller.go#L346) to respect pod's controllerref, that will prevent similar bugs.

Also note that an old version `kubectl rolling-update` will not work with the GC. We cannot fix that.
2016-08-04 20:48:10 -07:00
Chao Xu 96c84303bd fix kubectl rolling-update when GC is enabled 2016-08-03 15:57:03 -07:00
Andrey Kurilin 91cace347d Fix various typos in kubectl 2016-08-02 19:51:51 +03:00
Angus Salkeld eec08872c7 Move deployment utilities to there own package 2016-07-08 09:46:56 +02:00
k8s-merge-robot 3166f9316f Merge pull request #28111 from mfojtik/min-ready-seconds
Automatic merge from submit-queue

Add MinReadySeconds to rolling updater

Add MinReadySeconds support to RollingUpdater that allows to specify the number of seconds to wait on top of the pod is "ready" because its readiness probe passed.
2016-07-01 19:21:16 -07:00
Michal Fojtik 7ea28e42c0 Add MinReadySeconds to rolling updater 2016-06-30 13:13:08 +02:00
David McMahon ef0c9f0c5b Remove "All rights reserved" from all the headers. 2016-06-29 17:47:36 -07:00
Janet Kuo ee81e5ebfa Retry Pod/RC updates in kubectl rolling-update 2016-06-21 16:08:10 -07:00
Clayton Coleman 5d40f94feb
Rolling updater should allow progress to be logged / detected
Allows callers to terminate early as well as print useful messages
during the rollout. Use a crude percentage metric for summarization.
2016-05-14 22:54:02 -04:00
k8s-merge-robot 1642083e60 Merge pull request #24645 from jlowdermilk/rolling-update
Automatic merge from submit-queue

kubectl rolling-update support for same image

Fixes #23497.

Enables `kubectl rolling-update --image` to the same image, adding a `--image-pull-policy` flag to remove ambiguity. This allows rolling-update to behave as an "update and/or restart" (https://github.com/kubernetes/kubernetes/issues/23497#issuecomment-212349730), or as a forced update when the same tag can mean multiple versions (e.g. `:latest`). cc @janetkuo @nikhiljindal
2016-05-04 07:24:22 -07:00
Clayton Coleman fdb110c859
Fix the rest of the code 2016-04-29 17:12:10 -04:00
Jeff Lowdermilk 1baa473ef2 kubectl rolling-update support for same image 2016-04-25 09:20:15 -07:00
Michail Kargakis 77097d9a20 kubectl: set maxUnavailable to 1 if both fenceposts resolve to zero
Due to rounding down for maxUnavailable, we may end up with rolling updates
that have zero surge and unavailable pods something that 1) is not allowed
as per validation, 2) blocks updates. 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
Michail Kargakis b390087a99 kubectl: bring the rolling updater on par with the deployments
During a rolling update for Deployments, the total count of surge pods
is calculated by adding the desired number of pods (deployment.Spec.Replicas)
to maxSurge. During a kubectl rolling update, the total count of surge
pods is calculated by adding the original number of pods (oldRc.Spec.Replicas
via an annotation) to maxSurge. This commit changes this to use desired
replicas.
2016-03-04 18:07:09 +01:00
kargakis 9cc19102f3 kubectl: preserve availability when maxUnavailability is not 100% 2016-02-25 10:10:41 +01:00
Michail Kargakis 35fab99af7 kubectl: scale down based on ready during rolling updates 2016-02-19 15:42:04 +01:00
mqliang 7be9071584 create some integer min/max function 2016-02-12 11:20:11 +08:00
Janet Kuo a50267ab3e Fix mismatched types 2016-02-09 18:57:53 -08:00
Dan Mace eb778217ad Support rolling update to 0 desired replicas
Support a desired replica count of 0 for the new RC. Users sometimes
want to roll out a new "inactive" template with the intent of scaling
it up manually later.
2016-01-20 09:21:13 -05:00
deads2k 9fda7f1812 update StatusDetails to handle Groups 2015-12-17 09:14:12 -05:00
Jeff Lowdermilk 6adf227879 Merge pull request #18583 from jsravn/fix-rolling-update-rollback
Fix rolling-update rollback from an unavailable rc
2015-12-16 14:26:55 -08:00
James Ravn e5a558c35f Fix rolling-update rollback from an unavailable rc
Rolling back from a broken update with only one replica fails with a
timeout in the existing code.

The problem is the scale down logic does not consider unavailable
replicas in the old replication controller when calculating how much to
scale down by. This leads to an obvious problem with a single replica
when min unavailable is 1.

The fix is to allow scaling down all unavailable replicas in the old
controller, while still maintaining the min unavailable invariant.
2015-12-14 19:35:08 +00:00
Wojciech Tyczynski 960808bf08 Switch to versioned ListOptions in client. 2015-12-14 14:26:09 +01:00
Jeff Lowdermilk e53acfe19c Merge pull request #17111 from munnerz/multi-rolling-update
Allow rolling-update of a single container in multi-container pods
2015-12-11 13:08:13 -08:00
James Munnelly 61306c2a0f Allow rolling-update of a single container in multi-container pods
Accept codec as parameter to CreateNewControllerFromCurrentController function. Add tests for performing a rolling update on a container in a multi-container pod.
2015-12-04 18:38:55 +00:00
Wojciech Tyczynski 6dcb689d4e Simplify List() signature in clients. 2015-12-03 09:54:07 +01:00
Wojciech Tyczynski 8343c8ce6c Pass ListOptions to List() methods. 2015-12-01 15:00:36 +01:00
deads2k 1ac6d8afd3 update reaper, scaler, describer for GroupKind 2015-11-30 09:22:39 -05:00
Clayton Coleman 1d592e4c28 Unversioned types should not use ambiguous go-int
All external types that are not int64 are now marked as int32,
including
IntOrString. Prober is now int32 (43 years should be enough of an initial
probe time for anyone).

Did not change the metadata fields for now.
2015-11-26 11:45:25 -05:00
Tim Hockin ba383bcfeb Refactor IntOrString into a new pkg
pkg/util/intstr is a cleaner encapsulation for this type and supporting
functions.  No behavioral change.
2015-11-16 10:57:52 -08:00
Wojciech Tyczynski 647aa1bc8c Unify per-resource List for unversioned client 2015-10-14 08:37:57 +02:00
k8s-merge-robot 888f08377e Merge pull request #14671 from ironcladlou/rolling-rollback-fix
Auto commit by PR queue bot
2015-09-30 20:56:05 -07:00
Dan Mace 6db9601772 Support asymmetric rolling rollbacks
Improve the rolling updater rollback/abort function by making it aware
of the original replicas annotation: if the rollback target has the
original replica count recorded, prefer it over the desired annotation
since the update from old to new could have been asymmetrical.

For example, when scaling from 5 to 10, aborting should scale back to 5.
2015-09-29 09:00:02 -04:00
nikhiljindal c651c1ae30 Updating the semantics of MaxSurge and unavailability 2015-09-28 14:51:26 -07:00
Maciej Szulik 48775319d9 Reaper and scaler for jobs 2015-09-23 13:06:34 +02:00
Clayton Coleman bf2decce81 Add NotReadyAddresses to Endpoints
In many cases clients may wish to view not ready addresses for endpoints
in order to do set membership prior to a pod being ready. For instance,
a pod that uses the service endpoints to connect to other pods under
the same service, but does not want to signal ready before it has
contacted at least a minimal number of other pods.

This is backwards compatible with old servers and clients. There is
an additional cost in size of endpoints before services ramp up, which
will add minor CPU and memory use for services that have a significant
number of pods which have not become ready.
2015-09-17 09:41:56 -04:00
Janet Kuo c9beb5b39c Fix the bug that rolling-update throws error when using generateName 2015-09-02 13:30:14 -07:00
Dan Mace da5e4d7bd5 Rolling updater availability enhancements
Enhance the rolling updater to support maintaining minimum pod
availability for the duration of the update process.
2015-09-01 12:54:08 -04:00
Kris Rousey ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00