OpenMCF logoOpenMCF

Loading...

AliCloud SaeApplication

Deploys an Alibaba Cloud SAE application. The component provisions a container-based serverless application with configurable compute tiers, VPC networking, health checks, rolling update strategy, environment variables, custom host aliases, and SLS log collection. Supports five package types: container images, Java JAR/WAR archives, and Python/PHP ZIP packages.

What Gets Created

When you deploy an AliCloudSaeApplication resource, OpenMCF provisions:

  • SAE Application -- an alicloud_sae_application resource with the specified compute tier, replica count, deployment source, health probes, update strategy, and metadata tags

Prerequisites

  • Alibaba Cloud credentials configured via environment variables or OpenMCF provider config
  • VPC, VSwitch, and Security Group if the application needs private network access to databases, caches, or other VPC-resident services
  • Container image accessible from the deployment region (ACR Personal/Enterprise Edition or any Docker-compatible registry) when using Image package type
  • OSS bucket or HTTP endpoint hosting the deployment package when using FatJar, War, PythonZip, or PhpZip package types
  • SAE namespace pre-created if deploying into a specific namespace (the component does not create namespaces)

Quick Start

Create a file sae-app.yaml:

apiVersion: ali-cloud.openmcf.org/v1
kind: AliCloudSaeApplication
metadata:
  name: my-sae-app
  labels:
    openmcf.org/provisioner: pulumi
    pulumi.openmcf.org/organization: my-org
    pulumi.openmcf.org/project: my-project
    pulumi.openmcf.org/stack.name: dev.AliCloudSaeApplication.my-sae-app
spec:
  region: cn-hangzhou
  appName: my-sae-app
  packageType: Image
  replicas: 1
  cpu: 1000
  memory: 2048
  imageUrl: registry.cn-hangzhou.aliyuncs.com/my-ns/my-app:latest

Deploy:

openmcf apply -f sae-app.yaml

This creates a single-instance SAE application running a container image with 1 vCPU and 2 GB memory.

Configuration Reference

Required Fields

FieldTypeDescriptionValidation
regionstringAlibaba Cloud region (e.g., cn-hangzhou, us-west-1).Required; non-empty
appNamestringApplication name. Immutable after creation.Required; 1-36 chars; starts with letter
packageTypestringDeployment package format. Immutable after creation.Required; one of: Image, FatJar, War, PythonZip, PhpZip
replicasint32Number of application instances.Required; >= 1
cpuint32CPU per instance in millicores.Required; one of: 500, 1000, 2000, 4000, 8000, 16000, 32000
memoryint32Memory per instance in MB.Required; one of: 1024, 2048, 4096, 8192, 12288, 16384, 24576, 32768, 65536, 131072

Optional Fields

FieldTypeDefaultDescription
appDescriptionstring""Human-readable description (max 1024 chars).
vpcIdStringValueOrRefVPC ID for network isolation. Immutable.
vswitchIdStringValueOrRefVSwitch ID for subnet placement.
securityGroupIdStringValueOrRefSecurity group for traffic rules.
namespaceIdstring""SAE namespace ({region}:{short_id}). Immutable.
imageUrlstring""Container image URL. Required when packageType is Image.
packageUrlstring""Package URL (OSS/HTTP). Required for non-Image types.
packageVersionstring""Package version identifier.
commandstring""Container ENTRYPOINT override.
commandArgslist<string>[]Container CMD arguments.
envsmap<string, string>{}Environment variables.
jdkstring""JDK version for Java apps (e.g., Open JDK 17).
jarStartOptionsstring""JVM startup options for FatJar.
jarStartArgsstring""Application arguments for FatJar.
programmingLanguagestring""One of: java, php, other. Immutable.
timezonestring""Application timezone (e.g., Asia/Shanghai).
terminationGracePeriodSecondsint32Provider default (30)Graceful shutdown timeout (1-60s).
minReadyInstancesint32Min available instances during deploys.
acrInstanceIdstring""ACR Enterprise Edition instance ID for private registry.
livenessobjectLiveness probe (see health check fields below).
readinessobjectReadiness probe (see health check fields below).
customHostAliaseslist<object>[]Custom /etc/hosts entries: {hostName, ip}.
updateStrategyobjectRolling update configuration (see below).
slsConfigsstring""SLS log collection JSON config.
tagsmap<string, string>{}Resource tags (merged with OpenMCF metadata tags).

Health Check Fields (for liveness and readiness):

FieldTypeDefaultDescription
httpGet.pathstringHTTP GET path (e.g., /healthz).
httpGet.portint32HTTP GET port.
tcpSocket.portint32TCP connection port.
exec.commandstringCommand to execute.
initialDelaySecondsint32Delay before first check.
periodSecondsint32Interval between checks.
timeoutSecondsint32Timeout per check.
failureThresholdint32Consecutive failures before action.
successThresholdint32Consecutive successes to recover.

Update Strategy Fields (for updateStrategy):

FieldTypeDefaultDescription
typestringBatchUpdate or GrayBatchUpdate.
batchUpdate.batchint32Number of release batches.
batchUpdate.batchWaitTimeint32Seconds between batches.
batchUpdate.releaseTypestringauto or manual.

Examples

Minimal Image Deployment

apiVersion: ali-cloud.openmcf.org/v1
kind: AliCloudSaeApplication
metadata:
  name: hello-sae
  labels:
    openmcf.org/provisioner: pulumi
spec:
  region: cn-hangzhou
  appName: hello-sae
  packageType: Image
  replicas: 1
  cpu: 500
  memory: 1024
  imageUrl: registry.cn-hangzhou.aliyuncs.com/my-ns/hello:latest
  envs:
    PORT: "8080"

Java FatJar with VPC and Health Checks

apiVersion: ali-cloud.openmcf.org/v1
kind: AliCloudSaeApplication
metadata:
  name: order-service
  labels:
    openmcf.org/provisioner: pulumi
  org: acme-corp
  env: production
spec:
  region: cn-shanghai
  appName: order-service
  packageType: FatJar
  replicas: 3
  cpu: 4000
  memory: 8192
  packageUrl: https://deploy-bucket.oss-cn-shanghai.aliyuncs.com/order-service.jar
  packageVersion: "2.1.0"
  jdk: Open JDK 17
  jarStartOptions: "-Xms1g -Xmx4g"
  vpcId:
    value: vpc-prod-001
  vswitchId:
    value: vsw-prod-a
  securityGroupId:
    value: sg-prod-app
  namespaceId: cn-shanghai:production
  liveness:
    httpGet:
      path: /actuator/health/liveness
      port: 8080
    initialDelaySeconds: 30
    periodSeconds: 30
    failureThreshold: 3
  readiness:
    httpGet:
      path: /actuator/health/readiness
      port: 8080
    initialDelaySeconds: 10
    periodSeconds: 10
  minReadyInstances: 2
  updateStrategy:
    type: BatchUpdate
    batchUpdate:
      batch: 2
      releaseType: auto

Production Container with Canary Releases

apiVersion: ali-cloud.openmcf.org/v1
kind: AliCloudSaeApplication
metadata:
  name: payment-gateway
  labels:
    openmcf.org/provisioner: pulumi
  org: fintech-corp
  env: production
spec:
  region: cn-hangzhou
  appName: payment-gateway
  packageType: Image
  replicas: 4
  cpu: 8000
  memory: 16384
  imageUrl: payment-registry.cn-hangzhou.cr.aliyuncs.com/services/gateway:v3.2.1
  acrInstanceId: cri-abc123def456
  vpcId:
    value: vpc-finance-prod
  vswitchId:
    value: vsw-finance-a
  securityGroupId:
    value: sg-finance-strict
  terminationGracePeriodSeconds: 45
  minReadyInstances: 3
  liveness:
    httpGet:
      path: /health
      port: 8443
    initialDelaySeconds: 20
    failureThreshold: 3
  readiness:
    httpGet:
      path: /ready
      port: 8443
    initialDelaySeconds: 10
  customHostAliases:
    - hostName: hsm.internal
      ip: "10.0.5.100"
  slsConfigs: '[{"logDir":"/var/log/gateway","logType":"file_log"}]'
  updateStrategy:
    type: GrayBatchUpdate
    batchUpdate:
      batch: 4
      batchWaitTime: 30
      releaseType: manual
  tags:
    compliance: pci-dss

Stack Outputs

After deployment, the following outputs are available in status.outputs:

OutputTypeDescription
app_idstringThe SAE application ID assigned by Alibaba Cloud
app_namestringThe application name (mirrors the spec input)

Related Components

  • AliCloudVpc -- VPC for network isolation
  • AliCloudVswitch -- subnet for VPC-based deployment
  • AliCloudSecurityGroup -- network access control
  • AliCloudContainerRegistry -- private container image registry
  • AliCloudFunction -- event-driven serverless compute (alternative)
  • AliCloudLogProject -- SLS project for centralized log collection

Next article

AliCloud Security Group

AliCloud Security Group Deploys an Alibaba Cloud Security Group with bundled security rules in a VPC. The component provisions the security group and its ingress/egress rules as a single atomic unit, ensuring the firewall is always created with its intended access policy. What Gets Created When you deploy an AliCloudSecurityGroup resource, OpenMCF provisions: Security Group -- an alicloudsecuritygroup resource bound to the specified VPC with configurable inner access policy and tags Security...
Read next article
Presets
3 ready-to-deploy configurationsView presets →