O recurso ALIYUN::EDAS::K8sCluster cria um cluster do Container Service for Kubernetes (ACK).
Sintaxe
{
"Type": "ALIYUN::EDAS::K8sCluster",
"Properties": {
"EnableAsm": String,
"NamespaceId": String,
"CsClusterId": String
}
}
Propriedades
Propriedade | Tipo | Obrigatória | Editável | Descrição | Restrição |
EnableAsm | String | Não | Não | Especifica se o Alibaba Cloud Service Mesh (ASM) deve ser ativado. | Valores válidos:
|
NamespaceId | String | Não | Não | ID do namespace. | Formato: Exemplo: |
CsClusterId | String | Sim | Não | ID do cluster. | Chame a operação GetK8sCluster para consultar o ID do cluster. |
Valores de retorno
Fn::GetAtt
VpcId: ID da Virtual Private Cloud (VPC).
NodeNum: número de nós.
ClusterId: ID do cluster.
ClusterName: nome do cluster.
SubNetCidr: bloco CIDR da sub-rede.
NetworkMode: tipo de rede do cluster. O valor 1 indica a rede clássica e o valor 2 indica uma VPC.
ClusterType: tipo do cluster. O valor 2 representa um cluster do Elastic Compute Service (ECS) e o valor 5 indica um cluster ACK ou um cluster ACK Serverless.
CsClusterId: ID do cluster ACK.
VSwitchId: ID do vSwitch.
Exemplos
Formato JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"EnableAsm": {
"Type": "String",
"Description": "Whether enable ASM."
},
"NamespaceId": {
"Type": "String",
"Description": "The ID of the namespace to which the cluster that you want to import belongs."
},
"CsClusterId": {
"Type": "String",
"Description": "The ID of the CS cluster."
}
},
"Resources": {
"K8sCluster": {
"Type": "ALIYUN::EDAS::K8sCluster",
"Properties": {
"EnableAsm": {
"Ref": "EnableAsm"
},
"NamespaceId": {
"Ref": "NamespaceId"
},
"CsClusterId": {
"Ref": "CsClusterId"
}
}
}
},
"Outputs": {
"VpcId": {
"Description": "The ID of the cluster.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"VpcId"
]
}
},
"NodeNum": {
"Description": "Number of nodes.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"NodeNum"
]
}
},
"ClusterId": {
"Description": "The ID of the cluster.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"ClusterId"
]
}
},
"ClusterName": {
"Description": "The name of the cluster.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"ClusterName"
]
}
},
"SubNetCidr": {
"Description": "Sub net CIDR.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"SubNetCidr"
]
}
},
"NetworkMode": {
"Description": "Network node:\n1: Classic network\n2: VPC",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"NetworkMode"
]
}
},
"ClusterType": {
"Description": "The type of the cluster:\n2: ECS cluster\n5: Container Service K8s cluster or Serverless K8s cluster",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"ClusterType"
]
}
},
"CsClusterId": {
"Description": "The ID of the K8s cluster.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"CsClusterId"
]
}
},
"VswitchId": {
"Description": "The ID of the cluster.",
"Value": {
"Fn::GetAtt": [
"K8sCluster",
"VswitchId"
]
}
}
}
}
Formato YAML
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
CsClusterId:
Description: The ID of the CS cluster.
Type: String
EnableAsm:
Description: Whether enable ASM.
Type: String
NamespaceId:
Description: The ID of the namespace to which the cluster that you want to import
belongs.
Type: String
Resources:
K8sCluster:
Properties:
CsClusterId:
Ref: CsClusterId
EnableAsm:
Ref: EnableAsm
NamespaceId:
Ref: NamespaceId
Type: ALIYUN::EDAS::K8sCluster
Outputs:
ClusterId:
Description: The ID of the cluster.
Value:
Fn::GetAtt:
- K8sCluster
- ClusterId
ClusterName:
Description: The name of the cluster.
Value:
Fn::GetAtt:
- K8sCluster
- ClusterName
ClusterType:
Description: 'The type of the cluster:
2: ECS cluster
5: Container Service K8s cluster or Serverless K8s cluster'
Value:
Fn::GetAtt:
- K8sCluster
- ClusterType
CsClusterId:
Description: The ID of the K8s cluster.
Value:
Fn::GetAtt:
- K8sCluster
- CsClusterId
NetworkMode:
Description: 'Network node:
1: Classic network
2: VPC'
Value:
Fn::GetAtt:
- K8sCluster
- NetworkMode
NodeNum:
Description: Number of nodes.
Value:
Fn::GetAtt:
- K8sCluster
- NodeNum
SubNetCidr:
Description: Sub net CIDR.
Value:
Fn::GetAtt:
- K8sCluster
- SubNetCidr
VpcId:
Description: The ID of the cluster.
Value:
Fn::GetAtt:
- K8sCluster
- VpcId
VswitchId:
Description: The ID of the cluster.
Value:
Fn::GetAtt:
- K8sCluster
- VswitchId