Creating services

There are dozens of options for the docker service create command. UCP supports them all in a guided UI, which you start with Create a Service from the services view. First, you specify the basic details, the name of the image to use for the service; the service name, which is how other services will discover this one; and the command arguments, if you want to override the default startup in the image:

I won't cover all the details; they map to the options in the docker service create command, but the Scheduling tab is worth looking at. This is where you set the service mode to be replicated or global, add the required number of replicas, and the configuration for rolling updates:

The Restart Policy defaults to Always. This works in conjunction with the replica count, so if any tasks fail or are stopped, they will be restarted to maintain the service level. You can configure the update settings for automated roll-outs, and you can also add scheduling constraints. Constraints work with node labels to limit which nodes can be used to run service tasks. You can use this to restrict tasks to high-capacity nodes or to nodes that have strict access controls.

In the other sections, you can configure how the service integrates with other resources in the cluster, including networks and volumes, configs, and secrets, and you can specify compute reservations and limits. This lets you restrict services to a limited amount of CPU and memory, and you can also specify a minimum share of CPU and memory that each container should have.

When you deploy the service, UCP takes care of pulling the image on to any nodes that need it and starts the required number of containers. That would be one container per node for global services or the specified number of tasks for replicated services.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.224.68.28