ALIYUN::CS::ClusterApplication is used to deploy a container application.
Syntax
{
"Type": "ALIYUN::CS::ClusterApplication",
"Properties": {
"YamlContent": String,
"ClusterId": String,
"DefaultNamespace": String,
"DefaultNamespaceDeletion": Boolean
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
YamlContent | String | Yes | Yes | The sample YAML template that you can use to deploy an application. | None |
ClusterId | String | Yes | No | The ID of the cluster. | None |
DefaultNamespace | String | No | No | The default namespace of the application program. | None |
DefaultNamespaceDeletion | Boolean | No | Yes | Specifies whether to delete the default namespace of the application program. | Valid values:
Note If the default namespace of the application program is default, kube-node-lease, kube-public, kube-system, and arms-prom, the system does not delete the default namespace regardless of the value of the DefaultNamespaceDeletion property. |
Return values
Fn::GetAtt
ClusterId: the ID of the cluster.
Examples
YAML
format
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
JSON
format
{
"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"
]
}
}
}
}