Functions and Scaling Groups
List, inspect, and delete scaling groups from the CLI and the SDK.
List, inspect, and delete the scaling groups in your environment from the CLI or the SDK.
$ chalk scaling-group list
Displays a table of all scaling groups in your environment with their ID, name, selected revision, image, status, replica counts, URL, and creation time.
from chalk.client import ChalkClient
client = ChalkClient()
response = client.list_scaling_groups()
for scaling_group in response.scalingGroups:
print(f"Scaling group: {scaling_group.name}")
print(f" Status: {scaling_group.status}")
$ chalk scaling-group get --name=inference
Shows the group’s ID, name, selected revision, status, image, port, minimum and maximum replicas, web URL, and creation time.
import chalkcompute
sg = chalkcompute.ScalingGroup.from_name("inference")
# or
sg = chalkcompute.ScalingGroup.from_id("scaling-group-id")
info = sg.refresh()
print(info.status) # 'Available', 'Pending', 'ScaledToZero', ...
print(info.ready_replicas)
print(info.available_replicas)
print(sg.web_url)
A scaling group reports one of these statuses:
| Status | Meaning |
|---|---|
Pending | No replica is ready. |
Available | All desired replicas are ready. |
Degraded | Some replicas are ready, but not all desired replicas are, or a rollout has stalled. |
ScaledToZero | min_replicas is 0 and the autoscaler has scaled the group to zero replicas. |
Unhealthy | No replica is ready and a replica is failing, or a startup probe failed. |
Error | Chalk could not apply the group’s spec. |
Unknown | Chalk has not reported a status for the group. |
Deleted | The group was deleted. |
$ chalk scaling-group delete --name=inference
sg.delete()
Both surfaces remove the Kubernetes Deployment, Service, and HTTPRoute
associated with the scaling group. The SDK additionally cleans up any
temporary volumes created from add_local_file uploads. The database record
is soft-deleted so the group still appears in history.