All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::CS::ClusterApplication

Last Updated:Dec 26, 2025

You can use ALIYUN::CS::ClusterApplication to deploy a containerized application.

Syntax

{
  "Type": "ALIYUN::CS::ClusterApplication",
  "Properties": {
    "YamlContent": String,
    "ClusterId": String,
    "DefaultNamespace": String,
    "RolePolicy": String,
    "Stage": String,
    "WaitUntil": List,
    "ValidationMode": String,
    "CreationMode": String,
    "DefaultNamespaceDeletion": Boolean
  }
}

Properties

Property Name

Type

Required

Allow updates

Description

Constraint

ClusterId

String

Yes

No

The cluster ID.

None.

YamlContent

String

Yes

Yes

The content of the YAML template to deploy the application.

None.

DefaultNamespace

String

No

No

The default namespace of the application.

None.

RolePolicy

String

No

Yes

The role policy.

Before deploying the application, check the policies attached to your user role.

Valid values:

  • EnsureAdminRoleAndBinding (default): Automatically creates a role named ros:application-admin:${user-id}\ with administrator permissions and attaches it to the current user.

  • None: No action is taken.

Stage

String

No

No

The running stage.

Valid values:

  • All (default): All stages, including creation, update, and deletion.

  • Delete: The deletion stage. This means the YAML content is applied to the cluster only during the resource deletion stage.

ValidationMode

String

No

No

The validation mode.

Valid values:

  • Basic: Basic validation, such as checking whether the cluster exists.

  • Strict: In addition to basic validation, the validity of WaitUntil is also checked.

WaitUntil

List

No

Yes

Wait until all conditions are met after the creation or update starts.

For more information, see WaitUntil properties.

CreationMode

String

No

No

The creation mode.

Valid values:

  • Normal: Creates a new resource. An error is reported if the resource already exists.

  • Apply: This mode is similar to the kubectl apply command. If the resource does not exist, the resource is created. If the resource exists, the resource is updated. During the deletion phase, Resource Orchestration Service (ROS) deletes the newly created application, but does not delete the updated existing application.

DefaultNamespaceDeletion

Boolean

No

Yes

Indicates whether to delete the namespace specified by DefaultNamespace.

The 'default', 'kube-node-lease', 'kube-public', 'kube-system', and 'arms-prom' namespaces are not deleted, regardless of the value of this property.

WaitUntil syntax

"WaitUntil": [
  {
   "ApiVersion": String,
   "FirstMatch": Boolean,
   "Timeout": Integer,
   "JsonPath": String,
   "Namespace": String,
   "Stage": String,
   "Name": String,
   "ValueType": String,
   "Kind": String,
   "Value": String,
   "Operator": String
  }
]

WaitUntil properties

Property Name

Type

Required

Enable updates

Description

Constraint

ApiVersion

String

No

Yes

The API version.

None.

Kind

String

Yes

Yes

The type of the Kubernetes resource to query.

None.

Name

String

Yes

Yes

The name of the Kubernetes resource to query.

None.

Operator

String

Yes

Yes

The operator to compare the value with the result of the JSONPath expression.

None.

FirstMatch

Boolean

No

Yes

Returns only the first matching result from the JsonPath filter.

Valid values:

  • true

  • false (default)

JsonPath

String

No

Yes

The JSONPath expression to filter the output.

None.

Namespace

String

No

Yes

The Kubernetes namespace of the resource.

The default value is the value of DefaultNamespace.

Stage

String

No

No

The stage at which to wait.

Valid values:

  • Create/Update (default): The creation and update stages.

  • Delete: The deletion stage.

Timeout

Integer

No

Yes

The timeout period for waiting for the conditions to be met.

Unit: seconds.

Value

String

No

Yes

The value to compare with the result of the JSONPath expression.

None.

ValueType

String

No

Yes

The value type.

Default value: String.

Return values

Fn::GetAtt

  • ClusterId: The cluster ID.

  • WaitUntilData: A list of values for each JSONPath expression in WaitUntil.

Examples

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ClusterId:
    Type: String
    Description: The ID of the kubernetes cluster.
Resources:
  ClusterApplication:
    Type: ALIYUN::CS::ClusterApplication
    Properties:
      YamlContent: |-
        apiVersion: storage.k8s.io/v1
        kind: StorageClass
        metadata:
          name: test-ut-storage
          annotations:
            storageclass.beta.kubernetes.io/is-default-class: "true"
            storageclass.kubernetes.io/is-default-class: "true"
        mountOptions:
        - nolock,tcp,noresvport
        - vers=3
        parameters:
          server:  1.1.1.1
          driver: flexvolume
        provisioner: alicloud/nas
        reclaimPolicy: Delete

        ---

        apiVersion: v1
        kind: ConfigMap
        metadata:
          name: test-ut-configmap
        data:
          k1: v1
          k2: v2
      ClusterId:
        Ref: ClusterId
Outputs:
  ClusterId:
    Description: The ID of the cluster.
    Value:
      Fn::GetAtt:
        - ClusterApplication
        - ClusterId
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ClusterId": {
      "Type": "String",
      "Description": "The ID of the kubernetes cluster."
    }
  },
  "Resources": {
    "ClusterApplication": {
      "Type": "ALIYUN::CS::ClusterApplication",
      "Properties": {
        "YamlContent": "apiVersion: storage.k8s.io/v1\nkind: StorageClass\nmetadata:\n  name: test-ut-storage\n  annotations:\n    storageclass.beta.kubernetes.io/is-default-class: \"true\"\n    storageclass.kubernetes.io/is-default-class: \"true\"\nmountOptions:\n- nolock,tcp,noresvport\n- vers=3\nparameters:\n  server:  1.1.1.1\n  driver: flexvolume\nprovisioner: alicloud/nas\nreclaimPolicy: Delete\n\n---\n\napiVersion: v1\nkind: ConfigMap\nmetadata:\n  name: test-ut-configmap\ndata:\n  k1: v1\n  k2: v2",
        "ClusterId": {
          "Ref": "ClusterId"
        }
      }
    }
  },
  "Outputs": {
    "ClusterId": {
      "Description": "The ID of the cluster.",
      "Value": {
        "Fn::GetAtt": [
          "ClusterApplication",
          "ClusterId"
        ]
      }
    }
  }
}