Compute is in preview, and the
v1alpha API can change.Before you begin
- Select a project, install the
computeplugin, and get access to Compute. For more information, see Set up your project.
Locations
Compute runs in the following locations:
If you name a location where Compute isn’t offered to your project, Datum rejects the request, and the error lists the locations that you can use. For more information about Datum locations and region codes, see Locations.
Choose locations
datumctl compute deploy accepts exactly one of the following flags:
--location: one or more location names, separated by commas, such as--location=us-central-1,us-east-1.--city: every location in one or more cities, such as--city=DFW,IAD.--location-selector: every location whose labels match a selector, such as--location-selector='topology.datum.net/region=us-east-1'.
default. On an existing workload, a flag-based deploy replaces every placement and other settings. For more information, see Update a workload.
Choose locations in a manifest
In a manifest, each entry inspec.placements has a name, a scaleSettings block, and exactly one of the following fields:
locations: a list of location names.locationSelector: a label selector on location labels. Usetopology.datum.net/city-codeto select by city code, ortopology.datum.net/regionto select by region. Datum reevaluates the selector when Datum adds or removes a location.
Set the number of Instances
minReplicas is the number of Instances that Datum runs in each location of a placement. A placement with minReplicas: 2 across two locations runs four Instances. The value must be between 1 and 1,000.
To change the number of Instances for every placement of a workload, run the following command:
WORKLOAD_NAME: the name of your workload.COUNT: the number of Instances to run in each location.
scaleSettings.minReplicas for each placement in the manifest and apply it with datumctl compute deploy -f workload.yaml.
Each Instance counts against your project’s compute quota. If a new Instance doesn’t start because the quota is used up, it reports QuotaExceeded. For more information, see Limits and quotas.
Workloads don’t scale automatically, and they can’t scale to zero. The number of Instances stays at minReplicas until you change it. Don’t set scaleSettings.maxReplicas or scaleSettings.metrics, because autoscaling isn’t supported.
How rollouts work
When you change a workload’s template, such as its image, command, or environment variables, Datum rolls out the change to every location. In each location, Datum does the following:- Deletes one Instance, starting with the highest-numbered one.
- Creates a replacement from the new template.
- Waits until the replacement is ready before it moves on to the next Instance.
WORKLOAD_NAME with the name of your workload.
The command shows each placement and location with the phase Pending, Updating, Done, or Blocked. A location is Blocked when it makes no progress for more than 30 seconds, and the command prints the reason. To stop watching, press Control+C. The rollout continues.
Restart Instances
A restart replaces every Instance with the same template, one at a time in each location, in the same way as a rollout. Restart a workload to pick up a changed ConfigMap or Secret, or to recover from a bad state. To restart a workload, run the following command:WORKLOAD_NAME with the name of your workload.
restart replaces every Instance of the workload in every location.
What’s next
- To route each request to the nearest location, see Publish a workload.
- To check status and fix problems, see Manage and troubleshoot workloads.
- For command details, see Operations.