Cycle Logo

Container Deployment Strategies

Containers on Cycle require a deployment strategy to be selected, in order for the platform to know how to distribute instances of the container when deployed.

Resource Density Strategy

Cycle will distribute instances across servers to maintain balanced resource usage.

Node Strategy

Cycle will deploy one instance to every node that matches the specified criteria for the container. This is often useful for agent-style strategies where a process should exist on every server.

The node strategy will also add an instance to any new server deployed that matches the tag criteria.

Function Strategy

The function strategy will configure the container to act as a function container. Function containers don't restart after the process ends, and are frequently used for job-like batch processes.

First Available Strategy (Default)

Cycle will deploy instances to whichever server acknowledges the request first.

Manual Strategy

Cycle will not make any decisions on where instances are deployed. Instances can be manually deployed via the Portal or API.

High Availability Deployment Strategies

There are three specific deployment strategies that deal specifically with unique ways to distribute container instances across eligible nodes. They are:

  • High Availability
  • Distributed
  • Edge

Each has specific rules, minimums, and patterns that are good to take into account when deciding which is best for a particular service

StrategyMinimum InstancesMinimum ServersNotes
High Availability (HA)22Location is based on availability zones, more granular to smaller regional displacement.
Distributed22Location based on region, more macro level distribution.
Edge11Fast and flexible, but no redundancy guarantees

High Availability

The goal of high availability strategy is to spread instances out to eligible servers in a way that is resilient to single node/server outages. This strategy will treat each individual availability zone as a location.

When an event such as instance create or scale happens, the platform looks at the eligible servers in that cluster and then creates the new instances by iterating over each location and placing instances on available servers within each location.

The minimum number of instances for this strategy is 2, this can however be circumvented via manual scaling down to below 2. The reason this is important is, creating a container using HA requires at least 2 instances and at least 2 servers -- where the servers are, at a minimum, in different availability zones.

Distributed

The distributed strategy is designed to work in a way that is very similar to high availability. The key difference being, the servers can be in the same region and/or availability zone when the instances are originally created.

The idea here is that while distributed is meant to distribute the container instances among multiple regions, there is not a hard requirement that the servers existing at time of creating the container be in two regions.

It is important to note that because this deployment strategy treats each region as a single location, situations where there are multiple container instances being deployed to servers in a single region have no guarantees of individual instances going to unique hosts.

For example:

Creating a container with 2 instances in a cluster with 2 servers in the same location, say Atlanta, may result in both instances going to 1st or 2nd server in that region.

Edge Strategy

The edge strategy is meant to achieve instances being spread out quickly with maximum flexibility. Unlike HA and distributed there is no minimum, there is no required number of nodes or separation. Edge will simply look for regions of servers and iterate through those regions placing instances where they fit best based on resource availability.

Utilizing Server Tags

Server tags can be used to further fine-tune how a container's instances are deployed.

During a container deployment, server tags can be applied in two categories to adjust deployment to specific kinds of hardware (or any arbitrary requirement).

  • Match Any: If a server has at least ONE of these tags, it is considered a valid target for an instance of the container.
  • Match All: The server must have ALL of these tags to be considered a valid target for an instance of the container.

By combining deployment strategies with server tags, it is possible to highly optimize how Cycle deploys instances of a container.

Fetch Deployment Strategies With the API

Deployment strategies can be fetched programmatically via the platform API.

🍪 Help Us Improve Our Site

We use first-party cookies to keep the site fast and secure, see which pages need improved, and remember little things to make your experience better. For more information, read our Privacy Policy.