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:
|
Stage | String | No | No | The running stage. | Valid values:
|
ValidationMode | String | No | No | The validation mode. | Valid values:
|
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:
|
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:
|
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:
|
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"
]
}
}
}
}