From 67246afd3dbcb53fea470bd3e45578370207139d Mon Sep 17 00:00:00 2001 From: Stephen J Day Date: Fri, 22 Jul 2016 15:06:52 -0700 Subject: [PATCH] api/client/service: default update parallelism to 1 When updates happen, the current behavior is to kill all running instances and dispatch new tasks. Common use cases for container updates involve small numbers of containers, meaning the app will go down on most updates. Setting parallelism to 1 ensures that at most one task will go down during the update. Services with higher replica counts can increase this number accordingly to meet their needs. Signed-off-by: Stephen J Day --- api/client/service/opts.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/api/client/service/opts.go b/api/client/service/opts.go index cb58d6d130..f387bb62a2 100644 --- a/api/client/service/opts.go +++ b/api/client/service/opts.go @@ -16,11 +16,6 @@ import ( "github.com/spf13/cobra" ) -var ( - // DefaultReplicas is the default replicas to use for a replicated service - DefaultReplicas uint64 = 1 -) - type int64Value interface { Value() int64 } @@ -501,7 +496,7 @@ func addServiceFlags(cmd *cobra.Command, opts *serviceOptions) { flags.Var(&opts.restartPolicy.maxAttempts, flagRestartMaxAttempts, "Maximum number of restarts before giving up") flags.Var(&opts.restartPolicy.window, flagRestartWindow, "Window used to evaluate the restart policy") - flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 0, "Maximum number of tasks updated simultaneously") + flags.Uint64Var(&opts.update.parallelism, flagUpdateParallelism, 1, "Maximum number of tasks updated simultaneously (0 to update all at once)") flags.DurationVar(&opts.update.delay, flagUpdateDelay, time.Duration(0), "Delay between updates") flags.StringVar(&opts.endpoint.mode, flagEndpointMode, "", "Endpoint mode (vip or dnsrr)")