Commit Graph

60 Commits (c19a65c0c6c6d72180a1e28a7e49e0f866b881c3)

Author SHA1 Message Date
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
Wojciech Tyczynski 7403564366 Remove Codec from ContentConfig. 2016-07-08 13:53:09 +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
Wojciech Tyczynski 5d046fed41 Fix tests for renegotiation 2016-05-12 08:21:11 +02: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
Kris e664ef922f Move restclient to its own package 2016-02-29 12:05:13 -08: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
Clayton Coleman 38c7eded99 Prepare for content-type negotiation
Combine the fields that will be used for content transformation
(content-type, codec, and group version) into a single struct in client,
and then pass that struct into the rest client and request. Set the
content-type when sending requests to the server, and accept the content
type as primary.

Will form the foundation for content-negotiation via the client.
2016-01-26 17:44:30 -05: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
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
k8s-merge-robot 266ab4a796 Merge pull request #18487 from smarterclayton/guard_encode_decode
Auto commit by PR queue bot
2015-12-13 23:08:18 -08:00
Clayton Coleman 1e21054134 Hide common codec methods under helpers
The pending codec -> conversion split changes the signature of
Encode and Decode to be more complicated. Create a stub helper
with the exact semantics of today and do the simple mechanical
refactor here to reduce the cost of that change.
2015-12-09 21:15:02 -05: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
deads2k a87d927588 update client.Config to use GroupVersion 2015-11-21 08:29:26 -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
Kris eacf65ddce Renaming HTTPClientFunc to CreateHTTPClient 2015-11-11 11:54:58 -08:00
Paul Morie 227dd82119 Add PodSecurityContext and backward compatibility tests 2015-10-05 21:05:27 -04:00
Tim Hockin 1973d233e8 add wait.PollImmediate() and retool wait tests 2015-10-02 11:44:26 -07:00
nikhiljindal c651c1ae30 Updating the semantics of MaxSurge and unavailability 2015-09-28 14:51:26 -07:00
Chao Xu ac5481d089 move client/unversioned/fake.go to its own package 2015-09-11 17:33:54 -07:00
tummychow 78ce5da988 Move util.StringSet into its own package
A lot of packages use StringSet, but they don't use anything else from
the util package. Moving StringSet into another package will shrink
their dependency trees significantly.
2015-09-10 12:04:15 -07:00
Chao Xu 9fc79e9d99 refactor testapi and test scripts to prepare for multiple API groups. 2015-09-04 18:01:32 -07:00
Dan Mace 347b9334e2 Refactor test to use new fake reactors
Fix a test compilation error by refactoring the test code to use
the latest fake reactor framework.
2015-09-02 13:45:32 -04:00
Brendan Burns 3e407aebb2 Diable a broken unit test 2015-09-02 10:39:17 -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
Clayton Coleman 02dbb95447 Add TerminationGracePeriodSeconds to API
Set defaulting for pod spec
2015-08-20 11:03:38 -04:00
Robert Bailey 08e6a43c1d Revert "Merge pull request #9165 from smarterclayton/graceful"
This reverts commit 4f856b595d, reversing
changes made to d78525a83b.

Conflicts:
	pkg/kubelet/status_manager.go
2015-08-18 17:34:49 -07:00
Kris Rousey ae6c64d9bb Moving everyone to unversioned client 2015-08-18 10:23:03 -07:00
Clayton Coleman b842a7dd15 Revert "Revert "Gracefully delete pods from the Kubelet""
This reverts commit 98115facfd.
2015-08-18 08:57:02 -04:00
Mike Danese 8e33cbfa28 rewrite go imports 2015-08-05 17:30:03 -07:00
deads2k 182885e897 make testclient more precise 2015-08-04 13:35:59 -04:00
Mike Danese 1b84fb7d74 make testclient threadsafe by guarding internal state with accessors 2015-07-29 16:17:17 -07:00
Dan Mace d044208b38 Rolling updater enhancements
Add an UpdateAcceptor interface to the rolling updater which supports
injecting code to validate the first replica during scale-up. If the
replica is not accepted, the deployment fails. This facilitates canary
checking so that many broken replicas aren't rolled out during an update.

Make the rolling update scale amount configurable as a percent of the replica
count; a negative value changes the scale direction to down/up to support
in-place deployments.
2015-07-24 08:53:50 -04:00
Prashanth Balasubramanian 9ed9bd1c4f Add a generation number to the object meta of all objects, and status of rcs 2015-06-19 14:32:08 -07:00
Chao Xu 8a4dffdcee fix 2015-06-04 17:19:41 -07:00
Chao Xu 5a54a0118d fix 2015-06-04 16:35:24 -07:00
Chao Xu 1605fc7347 fix unit tests 2015-06-04 15:09:47 -07:00
Filip Grzadkowski 98115facfd Revert "Gracefully delete pods from the Kubelet" 2015-06-02 23:40:05 +02:00
Clayton Coleman 72ee028cab Gracefully delete pods from the Kubelet
This commit wires together the graceful delete option for pods
on the Kubelet.  When a pod is deleted on the API server, a
grace period is calculated that is based on the
Pod.Spec.TerminationGracePeriodInSeconds, the user's provided grace
period, or a default.  The grace period can only shrink once set.
The value provided by the user (or the default) is set onto metadata
as DeletionGracePeriod.

When the Kubelet sees a pod with DeletionTimestamp set, it uses the
value of ObjectMeta.GracePeriodSeconds as the grace period
sent to Docker.  When updating status, if the pod has DeletionTimestamp
set and all containers are terminated, the Kubelet will update the
status one last time and then invoke Delete(pod, grace: 0) to
clean up the pod immediately.
2015-06-01 19:23:59 -04:00
Anastasis Andronidis 9e3a540940 rename resize to scale 2015-05-27 19:08:06 +02:00
Brendan Burns 63cbc715dd Support recovery from in the middle of a rename. 2015-05-07 10:39:15 -07:00