Application instances in Serverless App Engine (SAE) map to the pod resource type in Kubernetes. Use the saectl tool to inspect, debug, and delete instance pods directly from the command line.
saectl supports viewing and deleting instances only. You cannot use it to create or update application instances. To modify the application, use the SAE console or API.
Prerequisites
Before you begin, ensure that you have:
Installed the saectl tool and configured your AccessKey ID, AccessKey secret, and the deployment region. See Install and configure the saectl tool
List instances
Run saectl get pod to list the instances for an application.
saectl get pod [<instance-id>] -n <namespace-id> -l sae.aliyun.com/app-name=<app-name>Parameters
| Parameter | Description | Default |
|---|---|---|
<instance-id> | Instance ID. | If omitted, all instances in scope are returned. |
-n <namespace-id> | Namespace ID. | If omitted, the default namespace is used. |
-l sae.aliyun.com/app-name=<app-name> | Filter by application name. | If omitted, instances of all applications in scope are returned. |
Output fields
| Field | Description |
|---|---|
NAME | Instance ID. |
READY | Number of ready containers / total containers. A container is ready when it passes the readiness probe check. |
STATUS | Instance status. Running means the instance is running. |
RESTARTS | Number of container restarts. |
AGE | How long the instance has been running. |
Common variants
# List all instances in a namespace
saectl get pod -n <namespace-id>
# List instances for a specific application
saectl get pod -n <namespace-id> -l sae.aliyun.com/app-name=<app-name>
# Get a specific instance in YAML format
saectl get pod <instance-id> -o yaml -n <namespace-id>
# Get a specific instance in JSON format
saectl get pod <instance-id> -o json -n <namespace-id>View instance details
Use get or describe to inspect the full configuration of an instance. The output includes all K8s YAML configuration fields described in K8s YAML configuration fields.
With get (YAML or JSON output)
saectl get pod <instance-id> -o yaml -n <namespace-id>| Parameter | Description |
|---|---|
<instance-id> | Instance ID. |
-o {yaml | json} | Output format. |
-n <namespace-id> | Namespace ID. Defaults to the default namespace if omitted. |
With describe (human-readable output)
saectl describe pod <instance-id> -n <namespace-id>| Parameter | Description |
|---|---|
<instance-id> | Instance ID. |
-n <namespace-id> | Namespace ID. Defaults to the default namespace if omitted. |
View instance logs
saectl logs <instance-id> -n <namespace-id>| Parameter | Description | Default |
|---|---|---|
<instance-id> | Instance ID. | Required. |
-n <namespace-id> | Namespace ID. | Defaults to the default namespace if omitted. |
Open a shell on an instance
saectl exec -it <instance-id> /bin/bash -n <namespace-id>| Parameter | Description |
|---|---|
<instance-id> | Instance ID. |
-it | Allocates a TTY and keeps stdin open for an interactive session. |
-n <namespace-id> | Namespace ID. Defaults to the default namespace if omitted. |
Delete an instance
saectl delete pod <instance-id> -n <namespace-id>| Parameter | Description |
|---|---|
<instance-id> | Instance ID. |
-n <namespace-id> | Namespace ID. Defaults to the default namespace if omitted. |
K8s YAML configuration fields
SAE instances correspond to the Kubernetes pod resource type. The following table describes the relevant K8s YAML configuration fields.
| Field | Description |
|---|---|
metadata.name | Instance ID. |
metadata.namespace | Namespace where the instance resides. |
metadata.uid | Instance ID. |
metadata.labels | Fixed format: sae.aliyun.com/app-name: <app-name> |
metadata.ownerReferences | The Deployment to which the instance belongs. Fixed format shown below. |
spec.containers | Container configuration for the instance. |
status.podIP | IP address of the instance. |
metadata.labels
labels:
sae.aliyun.com/app-name: <app-name>metadata.ownerReferences
ownerReferences:
- apiVersion: apps/v1
kind: Deployment
name: <app-name>
uid: <app-id>