ALIYUN::CS::ManagedKubernetesCluster類型用於建立Kubernetes託管版叢集。
文法
{
"Type": "ALIYUN::CS::ManagedKubernetesCluster",
"Properties": {
"CloudMonitorFlags": Boolean,
"ProxyMode": String,
"SnatEntry": Boolean,
"VpcId": String,
"Tags": List,
"LoginPassword": String,
"ContainerCidr": String,
"Name": String,
"Taint": List,
"KeyPair": String,
"Addons": List,
"ServiceCidr": String,
"KubernetesVersion": String,
"SecurityGroupId": String,
"EndpointPublicAccess": Boolean,
"RrsaConfig": Map,
"ClusterSpec": String,
"TimeoutMins": Number,
"PodVswitchIds": List,
"EncryptionProviderKey": String,
"Runtime": Map,
"SocEnabled": Boolean,
"UserData": String,
"OsType": String,
"IsEnterpriseSecurityGroup": Boolean,
"Platform": String,
"LoadBalancerSpec": String,
"FormatDisk": Boolean,
"NodeCidrMask": String,
"KeepInstanceName": Boolean,
"DeletionProtection": Boolean,
"ResourceGroupId": String,
"NodePools": List,
"NodeNameMode": String,
"SecurityHardeningOs": Boolean,
"DeleteOptions": List,
"ControlPlaneLogComponents": List,
"ControlPlaneLogTtl": Number,
"ControlPlaneLogProject": String,
"MaintenanceWindow": Map,
"ZoneIds": List,
"VSwitchIds": List,
"TimeZone": String,
"IpStack": String
}
}屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Name | String | 是 | 否 | 叢集名稱。 | 長度為1~63個字元。可包含英文字母、漢字、數字和短劃線(-)。 |
VpcId | String | 是 | 否 | 專用網路ID。 | 如果不設定,系統會自動建立專用網路,系統建立的專用網路網段為192.168.0.0/16。
|
Addons | List | 否 | 是 | Kubernetes叢集的Addon外掛程式的組合。 | 取值:
更多資訊,請參見Addons屬性。 |
SecurityHardeningOs | Boolean | 否 | 否 | 阿里雲作業系統安全強化。 | 取值:
預設值:false。 |
CloudMonitorFlags | Boolean | 否 | 否 | 是否安裝CloudMonitor外掛程式。 | 取值:
|
ClusterSpec | String | 否 | 否 | 託管版叢集類型。 | 取值:
|
ContainerCidr | String | 否 | 否 | 容器網段。 | 不能和專用網路網段衝突。當選擇系統自動建立專用網路時,預設使用172.16.0.0/16網段。 |
DeletionProtection | Boolean | 否 | 是 | 是否啟用刪除保護功能。 | 啟用刪除保護後,叢集不能被直接刪除。取值:
|
EncryptionProviderKey | String | 否 | 否 | 由Key Management Service管理的密鑰ID。 | 該密鑰用於加密資料磁碟。您只能在專業託管的Kubernetes叢集中使用KMS。 |
EndpointPublicAccess | Boolean | 否 | 否 | 是否開啟公網APIServer。 | 取值:
|
FormatDisk | Boolean | 否 | 否 | 是否將資料磁碟掛載到已建立的節點上,在已有的ECS執行個體中建立。 | 取值:
|
RrsaConfig | Map | 否 | 否 | RRSA 的配置。 | 更多資訊,請參考RrsaConfig屬性。 |
IsEnterpriseSecurityGroup | Boolean | 否 | 否 | 是否建立進階安全性群組。 | 當SecurityGroupId為空白時,該參數生效。 取值:
|
KeepInstanceName | Boolean | 否 | 否 | 指定是否保留叢集中使用的現有ECS執行個體的名稱。 | 取值:
|
KeyPair | String | 否 | 否 | 金鑰組名稱。 | KeyPair和LoginPassword只能指定其中一個參數。 |
KubernetesVersion | String | 否 | 是 | 叢集版本,與Kubernetes社區基準版本保持一致。建議選擇最新版本。 | 目前您可以建立兩種最新版本的叢集。關於ACK支援的Kubernetes版本,請參見【已下線】Kubernetes版本發布概覽。 |
LoadBalancerSpec | String | 否 | 否 | Server Load Balancer執行個體規格。 | 取值:
|
LoginPassword | String | 否 | 否 | SSH登入密碼。 | 長度為8~30個字元,必須同時包含英文字母、數字和特殊字元三項,特殊字元支援 說明 LoginPassword和KeyPair只能指定其中一個參數。 |
NodeCidrMask | String | 否 | 否 | 可分配給節點的最大IP地址數量。 | 數量由指定的pod CIDR決定。該參數僅在叢集使用Flannel外掛程式時生效。 預設值:25。 |
NodeNameMode | String | 否 | 否 | 自訂節點名。 | 節點名稱由三部分組成:首碼+節點IP地址子串+尾碼。
例如,節點IP地址為:192.168.XX.XX,指定首碼為 |
NodePools | List | 否 | 否 | 節點池資訊。 | 更多資訊,請參見NodePools屬性。 |
OsType | String | 否 | 否 | 作業系統類型。 | 取值:
|
Platform | String | 否 | 否 | 作業系統發布版本。 | 取值:
|
PodVswitchIds | List | 否 | 否 | Pod交換器列表。 | 您需要為每一個節點交換器指定至少一個相同可用性區域的Pod交換器,該Pod交換器不能跟節點交換器重複。 建議您選擇網段掩碼不大於19的交換器。 說明 當叢集列表(Addons)取值為網路組件,且採用Terway網路類型時,必須為叢集指定PodVswitchIds。 |
ProxyMode | String | 否 | 否 | kube-proxy代理模式。 | 取值:
|
ResourceGroupId | String | 否 | 是 | 叢集所屬資源群組ID。 | 無 |
Runtime | Map | 否 | 否 | 容器運行時。 | Runtime包括以下2個資訊:
樣本: 關於容器運行時的選擇,請參見containerd、安全沙箱、Docker運行時的對比。 更多資訊,請參見Runtime屬性。 |
SecurityGroupId | String | 否 | 否 | 叢集ECS執行個體所屬安全性群組ID。 | 無 |
ServiceCidr | String | 否 | 否 | 服務網段。 | 不能和專用網路網段以及容器網段衝突。當選擇系統自動建立專用網路時,預設使用172.19.0.0/20網段。 |
SnatEntry | Boolean | 否 | 否 | 是否為網路設定SNAT。 | 取值:
|
SocEnabled | Boolean | 否 | 否 | 是否啟用基於分級保護的加固。 | 取值:
|
Tags | List | 否 | 是 | 叢集標籤。 | 最多可以設定20組標籤。 更多資訊,請參見Tags屬性。 |
Taint | List | 否 | 否 | 給節點做汙點標記,通常用於Pods的調度策略。 | 若Pods上有相對應的容忍(tolerance)標記,則可以將容忍節點上的汙點調度到該節點。 |
TimeoutMins | Number | 否 | 否 | 叢集建立逾時時間。 | 預設值:60。 單位:分鐘。 |
UserData | String | 否 | 否 | 建立ECS執行個體時傳遞的使用者資料。 | 內容需要限制在16 KB以內。無需使用Base64轉碼,特殊字元需要使用轉義符。 |
DeleteOptions | List | 否 | 是 | 叢集關聯資源的刪除選項。 | 更多資訊,請參見DeleteOptions屬性。 |
ControlPlaneLogTtl | Number | 否 | 是 | 控制平面組件日誌儲存天數。 | 無 |
ControlPlaneLogComponents | List | 否 | 是 | 組件名稱列表。 | 指定那些控制平面的組件日誌需要被收集。 預設採集 apiserver、kcm、scheduler 組件的日誌。 |
ControlPlaneLogProject | String | 否 | 是 | 控制平面組件Log Service Project。 | 可以使用已有 Project 用於日誌儲存,也可以使用系統自動建立 Project 使用者日誌儲存。如果選擇自動建立Log Service Project,將會自動建立一個名稱為 |
MaintenanceWindow | Map | 否 | 是 | 叢集維護視窗配置。 | 更多資訊,請參見MaintenanceWindow屬性。 |
VSwitchIds | List | 是 | 否 | Worker node綁定的交換器。 | 無 |
ZoneIds | List | 否 | 否 | 可用性區域列表。 | 無 |
TimeZone | String | 否 | 否 | 叢集的時區。 | 無 |
IpStack | String | 否 | 否 | 叢集的IP協議棧。 | 取值:
|
NodePools文法
"NodePools": [
{
"ScalingGroup": Map,
"KubernetesConfig": Map,
"NodePoolInfo": Map
}
]NodePools屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ScalingGroup | Map | 是 | 否 | 節點池擴容組配置。 | 更多資訊,請參見ScalingGroup屬性。 |
KubernetesConfig | Map | 否 | 否 | 叢集相關配置。 | 更多資訊,請參見KubernetesConfig屬性。 |
NodePoolInfo | Map | 否 | 否 | 節點池配置。 | 更多資訊,請參見NodePoolInfo屬性。 |
ScalingGroup文法
"ScalingGroup": {
"InstancePatterns": List,
"SocEnabled": Boolean,
"ImageType": String,
"SecurityHardeningOs": Boolean,
"RdsInstances": List,
"IsEnterpriseSecurityGroup": Boolean,
"VSwitchIds": List,
"InternetMaxBandwidthOut": Integer,
"DataDisks": List,
"Period": Integer,
"InternetChargeType": String,
"KeyPair": String,
"SystemDiskPerformanceLevel": String,
"ImageId": String,
"InstanceTypes": List,
"SystemDiskCategory": String,
"PeriodUnit": String,
"LoginPassword": String,
"InstanceChargeType": String,
"SystemDiskSize": Integer,
"Tags": List,
"ZoneIds": List,
"DesiredSize": Integer
}ScalingGroup屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
InstanceTypes | List | 否 | 否 | 執行個體規格。 | 無 |
SystemDiskSize | Integer | 是 | 否 | 節點系統硬碟大小。 | 單位:GiB。 取值範圍:40~500。 |
VSwitchIds | List | 否 | 否 | 虛擬交換器ID列表。 | 無 |
SocEnabled | Boolean | 否 | 否 | 是否啟用基於分級保護的加固。 | 取值:
|
ImageType | String | 否 | 否 | 作業系統鏡像類型。 | 無 |
InstancePatterns | List | 否 | 否 | 執行個體屬性配置。 | 更多資訊,請參考InstancePatterns屬性。 |
SecurityHardeningOs | Boolean | 否 | 否 | 阿里雲 OS 安全強化。 | 取值:
預設值: |
DesiredSize | Integer | 否 | 否 | 節點池期望節點數。 | 無 |
DataDisks | List | 否 | 否 | 節點池節點資料盤配置。 | 更多資訊,請參見DataDisks屬性。 |
ImageId | String | 否 | 否 | 自訂鏡像ID。 | 預設使用系統提供的鏡像。 |
InstanceChargeType | String | 否 | 否 | 節點池節點付費類型。 | 取值:
|
InternetChargeType | String | 否 | 否 | 公網IP收費類型。 | 取值:
|
InternetMaxBandwidthOut | Integer | 否 | 否 | 節點公網IP出頻寬最大值。 | 單位:Mbps。 取值範圍:1~100。 |
IsEnterpriseSecurityGroup | Boolean | 否 | 否 | 自動建立企業級安全性群組。 | 取值:
|
KeyPair | String | 否 | 否 | 免密登入金鑰組名稱。 | KeyPair和LoginPassword屬性二選一。 |
LoginPassword | String | 否 | 否 | SSH登入密碼。 | KeyPair和LoginPassword只能選擇其中之一。 密碼規則為8~30個字元,且至少同時包含大小寫字母、數字和特殊符號。 |
Period | Integer | 否 | 否 | 節點池節點訂用帳戶時間長度。 | 當InstanceChargeType取值為PrePaid時,本屬性才生效且為必選值。 當period_unit取值為Month時,period取值範圍:{ 1, 2, 3, 6, 12}。 預設值:1。 |
PeriodUnit | String | 否 | 否 | 節點池節點付費周期。 | 當InstanceChargeType指定為PrePaid時需要指定周期。 Month:以月為計時單位。 |
RdsInstances | List | 否 | 否 | RDS執行個體ID。 | 無 |
SystemDiskCategory | String | 否 | 否 | 節點系統硬碟類型。 | 取值:
|
SystemDiskPerformanceLevel | String | 否 | 否 | 節點系統硬碟磁碟效能。 | 只對ESSD磁碟生效。 |
Tags | List | 否 | 否 | 僅為ECS執行個體添加標籤。 | 更多資訊,請參見Tags屬性。 |
ZoneIds | List | 否 | 否 | 可用性區域列表。 | 無 |
DataDisks文法
"DataDisks": [
{
"AutoSnapshotPolicyId": String,
"Encrypted": Boolean,
"Size": Integer,
"Category": String,
"PerformanceLevel": String,
"Categories": List
}
]DataDisks屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
AutoSnapshotPolicyId | String | 否 | 否 | 選擇自動快照策略ID。 | 雲端硬碟會按照快照策略自動備份。 |
Category | String | 否 | 否 | 資料盤類型。 | 取值:
|
Encrypted | Boolean | 否 | 否 | 是否對資料盤加密。 | 取值:
|
PerformanceLevel | String | 否 | 否 | 節點資料盤磁碟效能等級。 | 僅對ESSD磁碟生效,磁碟效能等級和磁碟大小有關。 更多資訊,請參見ESSD雲端硬碟。 |
Size | Integer | 否 | 否 | 資料盤大小。 | 單位為GiB。 取值範圍:40~32768。 預設值:120。 |
Categories | List | 否 | 否 | 資料磁碟類型的列表。 | 無 |
KubernetesConfig文法
"KubernetesConfig": {
"Runtime": String,
"RuntimeVersion": String,
"CpuPolicy": String,
"Labels": List,
"NodeNameMode": String,
"Taints": List
}KubernetesConfig屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Runtime | String | 是 | 否 | 容器運行時。 | 無 |
RuntimeVersion | String | 是 | 否 | 容器運行時版本。 | 無 |
CpuPolicy | String | 否 | 否 | 節點CPU管理原則。 | 當叢集版本在1.12.6及以上時支援以下兩種策略:
|
Labels | List | 否 | 否 | 節點標籤。 | 為Kubernetes叢集節點添加標籤。 更多資訊,請參見Labels屬性。 |
NodeNameMode | String | 否 | 否 | 自訂節點名。 | 節點名稱由三部分組成:首碼+節點IP地址子串+尾碼。
例如,節點IP地址為:192.168.XX.XX,指定首碼為 |
Taints | List | 否 | 否 | 汙點配置。 | 更多資訊,請參見Taints屬性。 |
RrsaConfig文法
"RrsaConfig":
{
"Enabled": Boolean
}RrsaConfig屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Enabled | Boolean | 是 | 否 | 是否啟用服務賬戶的 RAM 角色(RRSA)功能。 | 取值:
|
InstancePatterns文法
"InstancePatterns": [
{
"CpuArchitectures": List,
"MaxCpuCores": Integer,
"MinMemorySize": Integer,
"Memory": Integer,
"InstanceFamilyLevel": String,
"MinCpuCores": Integer,
"Cores": Integer,
"InstanceTypeFamilies": List,
"InstanceCategories": List,
"ExcludedInstanceTypes": List,
"MaxMemorySize": Integer
}
]InstancePatterns屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
CpuArchitectures | List | 否 | 否 | 執行個體的 CPU 架構。 | 取值:
|
MaxCpuCores | Integer | 否 | 否 | 執行個體規格的最大 vCPU 核心數目 | 無 |
MinMemorySize | Integer | 否 | 否 | 執行個體規格的最小記憶體。 | 單位:GiB。 |
Memory | Integer | 否 | 否 | 執行個體規格的記憶體大小。 | 單位為 GiB。 |
InstanceFamilyLevel | String | 否 | 否 | 執行個體規格類型系列層級。 | 無 |
MinCpuCores | Integer | 否 | 否 | 執行個體規格的最小 vCPU 核心數目。 | 無 |
Cores | Integer | 否 | 否 | 執行個體規格的 vCPU 核心數目。 | 無 |
InstanceTypeFamilies | List | 否 | 否 | 指定執行個體規格類型系列。 | 無 |
InstanceCategories | List | 否 | 否 | 執行個體分類。 | 無 |
ExcludedInstanceTypes | List | 否 | 否 | 需要排除的執行個體規格。 | 無 |
MaxMemorySize | Integer | 否 | 否 | 執行個體規格的最大記憶體。 | 單位:GiB。 |
Labels文法
"Labels": {
"Value": String,
"Key": String
}Labels屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標籤鍵。 | 無 |
Value | String | 是 | 否 | 標籤值。 | 無 |
Taints文法
"Taints": [{
"Value": String,
"Effect": String,
"Key": String
}]Taints屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 汙點名稱。 | 無 |
Value | String | 是 | 否 | 汙點值。 | 無 |
Effect | String | 否 | 否 | 調度策略。 |
|
NodePoolInfo文法
"NodePoolInfo": {
"Name": String,
"Type": String,
"ResourceGroupId": String
}NodePoolInfo屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ResourceGroupId | String | 否 | 是 | 節點池所屬資源群組。 | 無 |
Name | String | 是 | 否 | 節點池名稱。 | 無 |
Type | String | 否 | 否 | 節點池類型 | 取值:
|
MaintenanceWindow文法
"MaintenanceWindow": {
"Enable": Boolean,
"MaintenanceTime": String,
"Duration": String,
"WeeklyPeriod": String,
"Recurrence": String
}MaintenanceWindow屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Duration | String | 否 | 是 | 維護時間長度。 | 取值範圍[1,24],單位為小時。 預設值:3h。 |
Enable | Boolean | 否 | 是 | 是否開啟維護視窗。 | 取值:
預設值: |
MaintenanceTime | String | 否 | 是 | 維護起始時間。 | RFC3339 標準格式。 |
WeeklyPeriod | String | 否 | 是 | 維護周期。 | 多個值用英文半形逗號(,)分隔。取值:{Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday} 預設值: |
Recurrence | String | 否 | 是 | 使用 RFC5545 Recurrence Rule 文法定義的維護視窗迴圈規則。 | 目前僅支援 FREQ=WEEKLY,且不支援指定 COUNT 或 UNTIL。 |
Tags文法
"Tags": [
{
"Key": String,
"Value": String
}
]Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標籤鍵。 | 長度為1~64個字元,不能以 |
Value | String | 是 | 否 | 標籤值。 | 長度為0~128個字元,不能以 |
Addons文法
"Addons": [
{
"Version": String,
"Config": String,
"Name": String,
"Disabled": Boolean
}
]Addons屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Name | String | 是 | 否 | Addon外掛程式名稱。 | 無 |
Config | String | 否 | 是 | Addon外掛程式配置。 | 無 |
Disabled | Boolean | 否 | 否 | 是否禁用預設安裝。 | 取值:
|
Version | String | 否 | 否 | Addon外掛程式版本。 | 預設取最新版本。 |
DeleteOptions文法
"DeleteOptions": [
{
"DeleteMode": String,
"ResourceType": String
}
]DeleteOptions屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
DeleteMode | String | 否 | 是 | 該類型資源的刪除策略。 | 可取值:
|
ResourceType | String | 否 | 是 | 資源類型。 | 可取值:
|
Runtime文法
"Runtime": {
"Name": String,
"Version": String
}Runtime屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Name | String | 是 | 否 | 容器運行時名稱。 | ACK 支援以下三種容器運行時。
預設值: |
Version | String | 否 | 否 | 容器運行時版本。 | 預設為最新版。 關於安全沙箱運行時的變更詳情,請參見安全沙箱運行時發布記錄。 |
傳回值
Fn::GetAtt
ClusterId:叢集ID。
TaskId:任務ID。系統自動分配,使用者查詢任務狀態。
DefaultUserKubeConfig:使用者配置叢集憑據的預設Kubernetes配置。
ScalingRuleId:伸縮規則ID。
ScalingGroupId:伸縮組ID。
PrivateUserKubConfig:使用者配置叢集憑據的專有Kubernetes配置。
ScalingConfigurationId:伸縮配置ID。
Nodes:叢集節點列表。
APIServerSLBId:API伺服器負載平衡ID。
IngressSLBId:Ingress負載平衡ID。
WorkerRamRoleName:Worker RAM角色名稱。
樣本
情境 1 :建立Kubernetes託管版叢集。
ROSTemplateFormatVersion: '2015-09-01'
Description: Test Create ManagedKubernetesCluster
Parameters: {}
Resources:
Vpc:
Type: ALIYUN::ECS::VPC
Properties:
VpcName: mytest
CidrBlock: 192.168.0.0/16
VSwitch:
Type: ALIYUN::ECS::VSwitch
Properties:
VSwitchName: mytest
VpcId:
Ref: Vpc
ZoneId:
Fn::Select:
- '0'
- Fn::GetAZs:
Ref: ALIYUN::Region
CidrBlock: 192.168.1.0/24
ManagedKubernetesCluster:
Type: ALIYUN::CS::ManagedKubernetesCluster
Properties:
VSwitchIds:
- Ref: VSwitch
VpcId:
Ref: Vpc
ClusterSpec: ack.pro.small
LoginPassword: Admin@123!
Name: mytest
Outputs:
ClusterId:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
TaskId:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- TaskId {
"ROSTemplateFormatVersion": "2015-09-01",
"Description": "Test Create ManagedKubernetesCluster",
"Parameters": {
},
"Resources": {
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"VpcName": "mytest",
"CidrBlock": "192.168.0.0/16"
}
},
"VSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VSwitchName": "mytest",
"VpcId": {
"Ref": "Vpc"
},
"ZoneId": {
"Fn::Select": [
"0",
{
"Fn::GetAZs": {
"Ref": "ALIYUN::Region"
}
}
]
},
"CidrBlock": "192.168.1.0/24"
}
},
"ManagedKubernetesCluster": {
"Type": "ALIYUN::CS::ManagedKubernetesCluster",
"Properties": {
"VSwitchIds": [
{
"Ref": "VSwitch"
}
],
"VpcId": {
"Ref": "Vpc"
},
"ClusterSpec": "ack.pro.small",
"LoginPassword": "Admin@123!",
"Name": "mytest"
}
}
},
"Outputs": {
"ClusterId": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"ClusterId"
]
}
},
"TaskId": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"TaskId"
]
}
}
}
}情境 2 :建立Kubernetes專有版叢集(已VPC)。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 在現有VPC、交換器和安全性群組上,配置付費方式,建立Kubernetes叢集,含Worker節點、網路設定與監控外掛程式。
en: Configure billing methods on the existing VPC, switches, and security groups, then proceed to create a Kubernetes cluster inclusive of worker nodes, network configurations, and monitoring plugins.
Parameters:
PayType:
Type: String
Label:
en: ECS Instance Charge Type
zh-cn: 付費類型
AssociationProperty: ChargeType
AssociationPropertyMetadata:
LocaleKey: InstanceChargeType
Default: PostPaid
AllowedValues:
- PostPaid
- PrePaid
PayPeriodUnit:
Type: String
Label:
en: Pay Period Unit
zh-cn: 購買資源時間長度周期
AssociationProperty: PayPeriodUnit
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: Month
AllowedValues:
- Month
- Year
PayPeriod:
Type: Number
Label:
en: Period
zh-cn: 購買資源時間長度
AssociationProperty: PayPeriod
AssociationPropertyMetadata:
Visible:
Condition:
Fn::Not:
Fn::Equals:
- ${PayType}
- PostPaid
Default: 1
AllowedValues:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
VpcId:
Type: String
Label:
en: VPC ID
zh-cn: Virtual Private Cloud執行個體ID
AssociationProperty: ALIYUN::ECS::VPC::VPCId
ZoneId:
Type: String
Label:
en: Zone ID
zh-cn: 可用性區域
AssociationProperty: ALIYUN::ECS::Instance:ZoneId
VSwitchId:
Type: String
Label:
en: VSwitch ID
zh-cn: 交換器執行個體ID
AssociationProperty: ALIYUN::ECS::VSwitch::VSwitchId
AssociationPropertyMetadata:
VpcId: ${VpcId}
ZoneId: ${ZoneId}
SecurityGroupId:
Type: String
Label:
en: Business Security Group ID
zh-cn: 業務安全性群組ID
AssociationProperty: ALIYUN::ECS::SecurityGroup::SecurityGroupId
AssociationPropertyMetadata:
VpcId: ${VpcId}
NumOfNodes:
Type: Number
Label:
zh-cn: Worker節點數
en: Number of Worker instances
Default: 3
PodCidr:
Type: String
Label:
zh-cn: Pod 網路 CIDR
en: Pod Network CIDR
Description:
zh-cn: 請填寫有效私人網段,即以下網段及其子網:10.0.0.0/8,172.16-31.0.0/12-16,192.168.0.0/16<br>不能與 VPC 及 VPC 內已有 Kubernetes 叢集使用的網段重複。<font color='blue'><b>建立成功後不能修改</b></font>
en: 'Please fill in a valid private segment, i.e. the following segments and their subnets: 10.0.0.0/8, 172.16-31.0.0/12-16, 192.168.0.0/16<br> which cannot duplicate the network segments already used by clusters in VPC and VPC Kunetberes. <font color=''blue''><b>Cannot be modified after successful creation</b></font>'
AssociationProperty: ALIYUN::CS::ManagedKubernetesCluster::PodCidr
Default: 172.20.0.0/16
ServiceCidr:
Type: String
Label:
zh-cn: Service CIDR
en: Service CIDR
Description:
zh-cn: 可選範圍:10.0.0.0/16-24,172.16-31.0.0/16-24,192.168.0.0/16-24<br>不能與 VPC 及 VPC 內已有 Kubernetes 叢集使用的網段重複。<font color='blue'><b>建立成功後不能修改</b></font>
en: 'Optional range: 10.0.0.0/16-24, 172.16-31.0.0/16-24, 192.168.0.0/16-24<br> cannot duplicate segments already used by existing Kubernetes clusters in VPC and VPC.<font color=''blue''><b>Cannot be modified after successful creation</b></font>'
AssociationProperty: ALIYUN::CS::ManagedKubernetesCluster::ServiceCidr
Default: 172.21.0.0/20
SnatEntry:
Type: Boolean
Label:
zh-cn: 配置SNAT
en: Configure SNAT
Description:
zh-cn: 為專用網路配置 SNAT<br>若您叢集內的節點、應用等需要訪問公網,勾選該項後我們將為您建立 NAT Gateway並自動設定 SNAT 規則。<b><a href='https://www.alibabacloud.com/help/document_detail/48126.html' target='_blank'><font color='blue'>NAT Gateway收費詳情</font></a></b>
en: Configure SNAT for a proprietary network<br>If nodes, apps, etc. in your cluster need access to the public network, check this item and we'll create a NAT gateway for you and automatically configure the SNAT rules.<b><a href='https://www.alibabacloud.com/help/en/doc-detail/48126.html' target='_blank'><font color='blue'>NAT gateway charge details</font></a></b>
Default: true
EndpointPublicAccess:
Type: Boolean
Label:
en: Public Access
zh-cn: 公網訪問
Description:
en: Using the EIP Exposure API Server <br> creates an intranet SLB instance for API Server by default, and removing the instance will make API Server innible<br><br><font color='blue'><b>choose not to be open, you cannot access cluster API Server over an extranet</b><front>
zh-cn: 使用 EIP 暴露 API Server<br>預設將為 API Server 建立一個內網 SLB 執行個體,若刪除該執行個體會導致 API Server 無法訪問<br><font color='blue'><b>選擇不開放時,則無法通過外網訪問叢集 API Server</b><front>
Default: false
CloudMonitorFlag:
Type: Boolean
Label:
zh-cn: 監控外掛程式
en: Monitor Plug-in
Description:
zh-cn: 在 ECS 節點上安裝CloudMonitor外掛程式
en: Install the cloud monitoring plug-in on the ECS node .
Default: true
WorkerInstanceTypes:
Type: CommaDelimitedList
AssociationProperty: ALIYUN::ECS::Instance::InstanceType
AssociationPropertyMetadata:
InstanceChargeType: ${PayPeriod}
ZoneId: ${ZoneId}
Label:
en: Instance Type
zh-cn: 執行個體規格
WorkerSystemDiskSize:
Type: Number
Label:
zh-cn: Worker節點系統硬碟空間
en: Worker System Disk Space
Description:
zh-cn: 系統硬碟大小, 取值範圍:[40, 500], 單位:GB。
en: 'System disk size, range of values: 40-500, units: GB.'
Default: 40
MinValue: 40
MaxValue: 500
WorkerSystemDiskCategory:
Type: String
Label:
en: Worker System Disk Category
zh-cn: Worker節點系統硬碟類型
AssociationPropertyMetadata:
LocaleKey: DiskCategory
Default: cloud_essd
AllowedValues:
- cloud_efficiency
- cloud_ssd
- cloud_essd
LoginPassword:
Type: String
NoEcho: true
Label:
en: Instance Password
zh-cn: 執行個體密碼
Description:
en: Login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: 登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)
ConstraintDescription:
en: Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).
zh-cn: 長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。
AssociationProperty: ALIYUN::ECS::Instance::Password
Resources:
NodePools:
Type: ALIYUN::CS::ClusterNodePool
Properties:
ClusterId:
Ref: ManagedKubernetesCluster
NodePoolInfo:
Name: default-nodepool
ScalingGroup:
Period:
Ref: PayPeriod
PeriodUnit:
Ref: PayPeriodUnit
InstanceChargeType:
Ref: PayType
VSwitchIds:
- Ref: VSwitchId
ZoneIds:
- Ref: ZoneId
SystemDiskCategory:
Ref: WorkerSystemDiskCategory
SystemDiskSize:
Ref: WorkerSystemDiskSize
InstanceTypes:
Ref: WorkerInstanceTypes
LoginPassword:
Ref: LoginPassword
Platform: AliyunLinux
ImageId: aliyun_3_9_x64_20G_alibase_20231219.vhd
KubernetesConfig:
Runtime: containerd
RuntimeVersion: 1.6.28
Count:
Ref: NumOfNodes
ManagedKubernetesCluster:
Type: ALIYUN::CS::ManagedKubernetesCluster
Properties:
VpcId:
Ref: VpcId
VSwitchIds:
- Ref: VSwitchId
SecurityGroupId:
Ref: SecurityGroupId
ZoneIds:
- Ref: ZoneId
ClusterSpec: ack.pro.small
ContainerCidr:
Ref: PodCidr
ServiceCidr:
Ref: ServiceCidr
LoginPassword:
Ref: LoginPassword
SnatEntry:
Ref: SnatEntry
Addons:
- Name: flannel
Config: ''
CloudMonitorFlags:
Ref: CloudMonitorFlag
ProxyMode: IPVS
EndpointPublicAccess:
Ref: EndpointPublicAccess
Name:
Ref: ALIYUN::StackName
Outputs:
ClusterId:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- ClusterId
TaskId:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- TaskId
WorkerRamRoleName:
Value:
Fn::GetAtt:
- ManagedKubernetesCluster
- WorkerRamRoleName
Metadata:
ALIYUN::ROS::Interface:
ParameterGroups:
- Parameters:
- PayType
- PayPeriodUnit
- PayPeriod
Label:
default:
en: PayType Configuration
zh-cn: 付費類型配置
- Parameters:
- VpcId
- ZoneId
- VSwitchId
- SecurityGroupId
Label:
default:
zh-cn: 基礎資源配置(必填)
en: Infrastructure Configuration
- Parameters:
- NumOfNodes
- PodCidr
- ServiceCidr
- SnatEntry
- EndpointPublicAccess
- CloudMonitorFlag
- WorkerInstanceTypes
- WorkerSystemDiskSize
- WorkerSystemDiskCategory
- LoginPassword
Label:
default:
zh-cn: Kubernetes基本配置(必填)
en: Kubernetes Basic Configuration
TemplateTags:
- acs:example:ISV軟體部署:建立Kubernetes專有版叢集(已VPC)
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "在現有VPC、交換器和安全性群組上,配置付費方式,建立Kubernetes叢集,含Worker節點、網路設定與監控外掛程式。",
"en": "Configure billing methods on the existing VPC, switches, and security groups, then proceed to create a Kubernetes cluster inclusive of worker nodes, network configurations, and monitoring plugins."
},
"Parameters": {
"PayType": {
"Type": "String",
"Label": {
"en": "ECS Instance Charge Type",
"zh-cn": "付費類型"
},
"AssociationProperty": "ChargeType",
"AssociationPropertyMetadata": {
"LocaleKey": "InstanceChargeType"
},
"Default": "PostPaid",
"AllowedValues": [
"PostPaid",
"PrePaid"
]
},
"PayPeriodUnit": {
"Type": "String",
"Label": {
"en": "Pay Period Unit",
"zh-cn": "購買資源時間長度周期"
},
"AssociationProperty": "PayPeriodUnit",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${PayType}",
"PostPaid"
]
}
}
}
},
"Default": "Month",
"AllowedValues": [
"Month",
"Year"
]
},
"PayPeriod": {
"Type": "Number",
"Label": {
"en": "Period",
"zh-cn": "購買資源時間長度"
},
"AssociationProperty": "PayPeriod",
"AssociationPropertyMetadata": {
"Visible": {
"Condition": {
"Fn::Not": {
"Fn::Equals": [
"${PayType}",
"PostPaid"
]
}
}
}
},
"Default": 1,
"AllowedValues": [
1,
2,
3,
4,
5,
6,
7,
8,
9
]
},
"VpcId": {
"Type": "String",
"Label": {
"en": "VPC ID",
"zh-cn": "Virtual Private Cloud執行個體ID"
},
"AssociationProperty": "ALIYUN::ECS::VPC::VPCId"
},
"ZoneId": {
"Type": "String",
"Label": {
"en": "Zone ID",
"zh-cn": "可用性區域"
},
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId"
},
"VSwitchId": {
"Type": "String",
"Label": {
"en": "VSwitch ID",
"zh-cn": "交換器執行個體ID"
},
"AssociationProperty": "ALIYUN::ECS::VSwitch::VSwitchId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}",
"ZoneId": "${ZoneId}"
}
},
"SecurityGroupId": {
"Type": "String",
"Label": {
"en": "Business Security Group ID",
"zh-cn": "業務安全性群組ID"
},
"AssociationProperty": "ALIYUN::ECS::SecurityGroup::SecurityGroupId",
"AssociationPropertyMetadata": {
"VpcId": "${VpcId}"
}
},
"NumOfNodes": {
"Type": "Number",
"Label": {
"zh-cn": "Worker節點數",
"en": "Number of Worker instances"
},
"Default": 3
},
"PodCidr": {
"Type": "String",
"Label": {
"zh-cn": "Pod 網路 CIDR",
"en": "Pod Network CIDR"
},
"Description": {
"zh-cn": "請填寫有效私人網段,即以下網段及其子網:10.0.0.0/8,172.16-31.0.0/12-16,192.168.0.0/16<br>不能與 VPC 及 VPC 內已有 Kubernetes 叢集使用的網段重複。<font color='blue'><b>建立成功後不能修改</b></font>",
"en": "Please fill in a valid private segment, i.e. the following segments and their subnets: 10.0.0.0/8, 172.16-31.0.0/12-16, 192.168.0.0/16<br> which cannot duplicate the network segments already used by clusters in VPC and VPC Kunetberes. <font color='blue'><b>Cannot be modified after successful creation</b></font>"
},
"AssociationProperty": "ALIYUN::CS::ManagedKubernetesCluster::PodCidr",
"Default": "172.20.0.0/16"
},
"ServiceCidr": {
"Type": "String",
"Label": {
"zh-cn": "Service CIDR",
"en": "Service CIDR"
},
"Description": {
"zh-cn": "可選範圍:10.0.0.0/16-24,172.16-31.0.0/16-24,192.168.0.0/16-24<br>不能與 VPC 及 VPC 內已有 Kubernetes 叢集使用的網段重複。<font color='blue'><b>建立成功後不能修改</b></font>",
"en": "Optional range: 10.0.0.0/16-24, 172.16-31.0.0/16-24, 192.168.0.0/16-24<br> cannot duplicate segments already used by existing Kubernetes clusters in VPC and VPC.<font color='blue'><b>Cannot be modified after successful creation</b></font>"
},
"AssociationProperty": "ALIYUN::CS::ManagedKubernetesCluster::ServiceCidr",
"Default": "172.21.0.0/20"
},
"SnatEntry": {
"Type": "Boolean",
"Label": {
"zh-cn": "配置SNAT",
"en": "Configure SNAT"
},
"Description": {
"zh-cn": "為專用網路配置 SNAT<br>若您叢集內的節點、應用等需要訪問公網,勾選該項後我們將為您建立 NAT Gateway並自動設定 SNAT 規則。<b><a href='https://www.alibabacloud.com/help/document_detail/48126.html' target='_blank'><font color='blue'>NAT Gateway收費詳情</font></a></b>",
"en": "Configure SNAT for a proprietary network<br>If nodes, apps, etc. in your cluster need access to the public network, check this item and we'll create a NAT gateway for you and automatically configure the SNAT rules.<b><a href='https://www.alibabacloud.com/help/en/doc-detail/48126.html' target='_blank'><font color='blue'>NAT gateway charge details</font></a></b>"
},
"Default": true
},
"EndpointPublicAccess": {
"Type": "Boolean",
"Label": {
"en": "Public Access",
"zh-cn": "公網訪問"
},
"Description": {
"en": "Using the EIP Exposure API Server <br> creates an intranet SLB instance for API Server by default, and removing the instance will make API Server innible<br><br><font color='blue'><b>choose not to be open, you cannot access cluster API Server over an extranet</b><front>",
"zh-cn": "使用 EIP 暴露 API Server<br>預設將為 API Server 建立一個內網 SLB 執行個體,若刪除該執行個體會導致 API Server 無法訪問<br><font color='blue'><b>選擇不開放時,則無法通過外網訪問叢集 API Server</b><front>"
},
"Default": false
},
"CloudMonitorFlag": {
"Type": "Boolean",
"Label": {
"zh-cn": "監控外掛程式",
"en": "Monitor Plug-in"
},
"Description": {
"zh-cn": "在 ECS 節點上安裝CloudMonitor外掛程式",
"en": "Install the cloud monitoring plug-in on the ECS node ."
},
"Default": true
},
"WorkerInstanceTypes": {
"Type": "CommaDelimitedList",
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"InstanceChargeType": "${PayPeriod}",
"ZoneId": "${ZoneId}"
},
"Label": {
"en": "Instance Type",
"zh-cn": "執行個體規格"
}
},
"WorkerSystemDiskSize": {
"Type": "Number",
"Label": {
"zh-cn": "Worker節點系統硬碟空間",
"en": "Worker System Disk Space"
},
"Description": {
"zh-cn": "系統硬碟大小, 取值範圍:[40, 500], 單位:GB。",
"en": "System disk size, range of values: 40-500, units: GB."
},
"Default": 40,
"MinValue": 40,
"MaxValue": 500
},
"WorkerSystemDiskCategory": {
"Type": "String",
"Label": {
"en": "Worker System Disk Category",
"zh-cn": "Worker節點系統硬碟類型"
},
"AssociationPropertyMetadata": {
"LocaleKey": "DiskCategory"
},
"Default": "cloud_essd",
"AllowedValues": [
"cloud_efficiency",
"cloud_ssd",
"cloud_essd"
]
},
"LoginPassword": {
"Type": "String",
"NoEcho": true,
"Label": {
"en": "Instance Password",
"zh-cn": "執行個體密碼"
},
"Description": {
"en": "Login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)",
"zh-cn": "登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)"
},
"ConstraintDescription": {
"en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in).",
"zh-cn": "長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)。"
},
"AssociationProperty": "ALIYUN::ECS::Instance::Password"
}
},
"Resources": {
"NodePools": {
"Type": "ALIYUN::CS::ClusterNodePool",
"Properties": {
"ClusterId": {
"Ref": "ManagedKubernetesCluster"
},
"NodePoolInfo": {
"Name": "default-nodepool"
},
"ScalingGroup": {
"Period": {
"Ref": "PayPeriod"
},
"PeriodUnit": {
"Ref": "PayPeriodUnit"
},
"InstanceChargeType": {
"Ref": "PayType"
},
"VSwitchIds": [
{
"Ref": "VSwitchId"
}
],
"ZoneIds": [
{
"Ref": "ZoneId"
}
],
"SystemDiskCategory": {
"Ref": "WorkerSystemDiskCategory"
},
"SystemDiskSize": {
"Ref": "WorkerSystemDiskSize"
},
"InstanceTypes": {
"Ref": "WorkerInstanceTypes"
},
"LoginPassword": {
"Ref": "LoginPassword"
},
"Platform": "AliyunLinux",
"ImageId": "aliyun_3_9_x64_20G_alibase_20231219.vhd"
},
"KubernetesConfig": {
"Runtime": "containerd",
"RuntimeVersion": "1.6.28"
},
"Count": {
"Ref": "NumOfNodes"
}
}
},
"ManagedKubernetesCluster": {
"Type": "ALIYUN::CS::ManagedKubernetesCluster",
"Properties": {
"VpcId": {
"Ref": "VpcId"
},
"VSwitchIds": [
{
"Ref": "VSwitchId"
}
],
"SecurityGroupId": {
"Ref": "SecurityGroupId"
},
"ZoneIds": [
{
"Ref": "ZoneId"
}
],
"ClusterSpec": "ack.pro.small",
"ContainerCidr": {
"Ref": "PodCidr"
},
"ServiceCidr": {
"Ref": "ServiceCidr"
},
"LoginPassword": {
"Ref": "LoginPassword"
},
"SnatEntry": {
"Ref": "SnatEntry"
},
"Addons": [
{
"Name": "flannel",
"Config": ""
}
],
"CloudMonitorFlags": {
"Ref": "CloudMonitorFlag"
},
"ProxyMode": "IPVS",
"EndpointPublicAccess": {
"Ref": "EndpointPublicAccess"
},
"Name": {
"Ref": "ALIYUN::StackName"
}
}
}
},
"Outputs": {
"ClusterId": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"ClusterId"
]
}
},
"TaskId": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"TaskId"
]
}
},
"WorkerRamRoleName": {
"Value": {
"Fn::GetAtt": [
"ManagedKubernetesCluster",
"WorkerRamRoleName"
]
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"PayType",
"PayPeriodUnit",
"PayPeriod"
],
"Label": {
"default": {
"en": "PayType Configuration",
"zh-cn": "付費類型配置"
}
}
},
{
"Parameters": [
"VpcId",
"ZoneId",
"VSwitchId",
"SecurityGroupId"
],
"Label": {
"default": {
"zh-cn": "基礎資源配置(必填)",
"en": "Infrastructure Configuration"
}
}
},
{
"Parameters": [
"NumOfNodes",
"PodCidr",
"ServiceCidr",
"SnatEntry",
"EndpointPublicAccess",
"CloudMonitorFlag",
"WorkerInstanceTypes",
"WorkerSystemDiskSize",
"WorkerSystemDiskCategory",
"LoginPassword"
],
"Label": {
"default": {
"zh-cn": "Kubernetes基本配置(必填)",
"en": "Kubernetes Basic Configuration"
}
}
}
],
"TemplateTags": [
"acs:example:ISV軟體部署:建立Kubernetes專有版叢集(已VPC)"
]
}
}
}情境 3 :使用ACK搭建微服務。
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 建立ACK叢集,配置VPC、安全性群組,部署微服務應用,自動調整節點池,設定ALB ingress,輸出服務訪問URL。
en: Create an ACK (Alibaba Cloud Container Service for Kubernetes) cluster, configure
VPC (Virtual Private Cloud) and security groups, deploy microservices applications,
automatically scale node pools, set up ALB (Application Load Balancer) ingress,
and output the service access URL.
Parameters:
CommonName:
Type: String
Default: microservices-on-ack
ManagedKubernetesClusterName:
Type: String
Label:
en: Managed Kubernetes Cluster Name
zh-cn: ACK託管版叢集名稱
AssociationProperty: AutoCompleteInput
AssociationPropertyMetadata:
Length: 5
Prefix: k8s-hpa-cluster-
CharacterClasses:
- Class: lowercase
min: 1
ZoneId1:
Type: String
AssociationProperty: 'ALIYUN::ECS::Instance::ZoneId'
AssociationPropertyMetadata:
ExclusiveTo:
- ZoneId2
Label:
en: Availability Zone
zh-cn: 可用性區域1
ZoneId2:
Type: String
AssociationProperty: 'ALIYUN::ECS::Instance::ZoneId'
AssociationPropertyMetadata:
ExclusiveTo:
- ZoneId1
Label:
en: Availability Zone
zh-cn: 可用性區域2
InstanceType:
Type: CommaDelimitedList
AssociationProperty: 'ALIYUN::ECS::Instance::InstanceType'
AssociationPropertyMetadata:
InstanceChargeType: PostPaid
SystemDiskCategory: cloud_essd
CreateACKClusterParams:
NetworkPlugin: terway-eniip
Label:
en: Instance Type
zh-cn: 執行個體規格
InstancePassword:
NoEcho: true
Type: String
Description:
en: >-
Server login password, Length 8-30, must contain three(Capital letters,
lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special
symbol in)
zh-cn: >-
伺服器登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/
中的特殊符號)
Label:
en: Instance Password
zh-cn: 執行個體密碼
ConstraintDescription:
en: >-
Length 8-30, must contain three(Capital letters, lowercase letters,
numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)
zh-cn: '長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;''<>,.?/ 中的特殊符號)'
AssociationProperty: 'ALIYUN::ECS::Instance::Password'
Default: null
Resources:
Vpc:
Type: 'ALIYUN::ECS::VPC'
Properties:
CidrBlock: 10.0.0.0/8
VpcName:
Fn::Sub: ${CommonName}-vpc
VSwitch1:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
VpcId:
Ref: Vpc
CidrBlock: 10.0.0.0/24
ZoneId:
Ref: ZoneId1
VSwitchName:
Fn::Sub: ${CommonName}-vsw
VSwitch2:
Type: 'ALIYUN::ECS::VSwitch'
Properties:
VpcId:
Ref: Vpc
CidrBlock: 10.0.1.0/24
ZoneId:
Ref: ZoneId2
VSwitchName:
Fn::Sub: ${CommonName}-vsw
SecurityGroup:
Type: 'ALIYUN::ECS::SecurityGroup'
Properties:
VpcId:
Ref: Vpc
SecurityGroupName:
Fn::Sub: ${CommonName}-sg
SecurityGroupIngress:
- PortRange: 8080/8080
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
- PortRange: 80/80
SourceCidrIp: 0.0.0.0/0
IpProtocol: tcp
AckCluster:
Type: 'ALIYUN::CS::ManagedKubernetesCluster'
Properties:
VpcId:
Ref: Vpc
VSwitchIds:
- Ref: VSwitch1
- Ref: VSwitch2
PodVswitchIds:
- Ref: VSwitch1
- Ref: VSwitch1
Name:
Ref: ManagedKubernetesClusterName
KubernetesVersion: 1.33.1-aliyun.1
ServiceCidr: 192.168.0.0/16
ClusterSpec: ack.pro.small
LoadBalancerSpec: slb.s2.small
IsEnterpriseSecurityGroup: true
SnatEntry: true
NumOfNodes: 0
EndpointPublicAccess: true
Platform: AliyunLinux
Addons:
- Name: terway-eniip
Config: '{"IPVlan":"false","NetworkPolicy":"false","ENITrunking":"false"}'
- Name: csi-plugin
- Name: csi-provisioner
- Name: storage-operator
Config: '{"CnfsOssEnable":"false","CnfsNasEnable":"false"}'
- Name: logtail-ds
Config: '{"IngressDashboardEnabled":"true"}'
- Name: nginx-ingress-controller
Disabled: true
- Name: alb-ingress-controller
Version: ""
Config:
Fn::Sub: >-
{"albIngress":{"AddressType":"Internet","ZoneMappings":{"${ZoneId1}":["${VSwitch1}"],
"${ZoneId2}":["${VSwitch2}"]},"CreateDefaultALBConfig":true}}
- Name: ack-node-local-dns
ProxyMode: ipvs
DeleteOptions:
- ResourceType: ALB
DeleteMode: delete
- ResourceType: SLB
DeleteMode: delete
- ResourceType: SLS_Data
DeleteMode: delete
- ResourceType: SLS_ControlPlane
DeleteMode: delete
- ResourceType: PrivateZone
DeleteMode: delete
NodePools:
Type: 'ALIYUN::CS::ClusterNodePool'
Properties:
ClusterId:
Ref: AckCluster
NodePoolInfo:
Name: default-nodepool
ScalingGroup:
InstanceChargeType: PostPaid
VSwitchIds:
- Ref: VSwitch1
- Ref: VSwitch2
ZoneIds:
- Ref: ZoneId1
- Ref: ZoneId2
SystemDiskCategory: cloud_essd
SystemDiskPerformanceLevel: PL0
SystemDiskSize: 120
InstanceTypes:
Ref: InstanceType
LoginPassword:
Ref: InstancePassword
Platform: AliyunLinux
ImageId: aliyun_3_9_x64_20G_alibase_20231219.vhd
KubernetesConfig:
Runtime: containerd
RuntimeVersion: 1.6.28
Count: 3
InstallBackendApp:
Type: 'ALIYUN::CS::ClusterApplication'
DependsOn: NodePools
Properties:
ClusterId:
Ref: AckCluster
YamlContent:
Fn::Sub: |-
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: ecs-ack-test-service-a
labels:
app: ecs-ack-test-service-a
spec:
replicas: 2
selector:
matchLabels:
app: ecs-ack-test-service-a
template:
metadata:
labels:
app: ecs-ack-test-service-a
spec:
initContainers:
- name: download-jar
image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux
command:
- "/bin/sh"
- "-c"
- "curl -o /app/app.jar https://help-static-aliyun-doc.aliyuncs.com/tech-solution/MicroServiceOnAckDemo-1.0.1.jar && echo 'Download jar OK!'"
volumeMounts:
- name: app-jar
mountPath: /app
containers:
- args:
- '-DbHost=http://ecs-ack-test-service-b:8080'
- '-jar'
- '/app/app.jar'
command:
- java
name: ecs-ack-test-service-a
image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux
env:
- name: APP_MANUAL_DEPLOY
value: "false"
ports:
- containerPort: 8080
resources:
limits:
cpu: '2'
ephemeral-storage: 40Gi
memory: 2Gi
requests:
cpu: '1'
ephemeral-storage: 20Gi
memory: 1Gi
volumeMounts:
- name: app-jar
mountPath: /app
volumes:
- name: app-jar
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: ecs-ack-test-service-a
spec:
selector:
app: ecs-ack-test-service-a
ports:
- protocol: TCP
port: 8080
targetPort: 8080
---
apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1
kind: Deployment
metadata:
name: ecs-ack-test-service-b
labels:
app: ecs-ack-test-service-b
spec:
replicas: 2
selector:
matchLabels:
app: ecs-ack-test-service-b
template:
metadata:
labels:
app: ecs-ack-test-service-b
spec:
initContainers:
- name: download-jar
image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux
command:
- "/bin/sh"
- "-c"
- "curl -o /app/app.jar https://help-static-aliyun-doc.aliyuncs.com/tech-solution/MicroServiceOnAckDemo-1.0.1.jar && echo 'Download jar OK!'"
volumeMounts:
- name: app-jar
mountPath: /app
containers:
- args:
- '-DbHost=http://ecs-ack-test-service-b:8080'
- '-jar'
- '/app/app.jar'
command:
- java
name: ecs-ack-test-service-b
image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux
env:
- name: APP_MANUAL_DEPLOY
value: "false"
ports:
- containerPort: 8080
resources:
limits:
cpu: '2'
ephemeral-storage: 40Gi
memory: 2Gi
requests:
cpu: '1'
ephemeral-storage: 20Gi
memory: 1Gi
volumeMounts:
- name: app-jar
mountPath: /app
volumes:
- name: app-jar
emptyDir: {}
---
apiVersion: v1
kind: Service
metadata:
name: ecs-ack-test-service-b
spec:
selector:
app: ecs-ack-test-service-b
ports:
- protocol: TCP
port: 8080
targetPort: 8080
AlbConfig:
Type: 'ALIYUN::CS::ClusterApplication'
DependsOn: InstallBackendApp
Properties:
ClusterId:
Ref: AckCluster
YamlContent:
Fn::Sub: |-
apiVersion: alibabacloud.com/v1
kind: AlbConfig
metadata:
name: ecs-ack-test-alb-config
spec:
config:
name: ecs-ack-test-alb
addressType: Internet
zoneMappings:
- vSwitchId: ${VSwitch1}
- vSwitchId: ${VSwitch2}
listeners:
- port: 80
protocol: HTTP
---
apiVersion: networking.k8s.io/v1
kind: IngressClass
metadata:
name: ecs-ack-test-alb
spec:
controller: ingress.k8s.alibabacloud/alb
parameters:
apiGroup: alibabacloud.com
kind: AlbConfig
name: ecs-ack-test-alb-config
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ecs-ack-test-alb-ingress
spec:
ingressClassName: ecs-ack-test-alb
rules:
- http:
paths:
- path: /a
pathType: ImplementationSpecific
backend:
service:
name: ecs-ack-test-service-a
port:
number: 8080
- path: /b
pathType: ImplementationSpecific
backend:
service:
name: ecs-ack-test-service-b
port:
number: 8080
WaitAlbIngress:
Type: ALIYUN::ROS::Sleep
DependsOn: AlbConfig
Properties:
CreateDuration: 120
IngressInfo:
Type: 'DATASOURCE::CS::ClusterApplicationResources'
DependsOn: WaitAlbIngress
Properties:
ClusterId:
Ref: AckCluster
Kind: Ingress
Namespace: default
JsonPath: $.items.[0].status.loadBalancer.ingress.[0].hostname
FirstMatch: true
Outputs:
UrlServiceA:
Description:
zh-cn: A服務訪問地址。
en: The addresses of A service.
Value:
'Fn::Sub': http://${IngressInfo}/a
UrlServiceB:
Description:
zh-cn: B服務訪問地址。
en: The addresses of B service.
Value:
'Fn::Sub': http://${IngressInfo}/b
Metadata:
'ALIYUN::ROS::Interface':
ParameterGroups:
- Parameters:
- SlsProjectName
- ManagedKubernetesClusterName
- ZoneId1
- ZoneId2
- InstanceType
- InstancePassword
TemplateTags:
- acs:technical-solution:micro:如何快速使用ACK搭建微服務-tech_solu_124
Hidden:
- CommonName{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "建立ACK叢集,配置VPC、安全性群組,部署微服務應用,自動調整節點池,設定ALB ingress,輸出服務訪問URL。",
"en": "Create an ACK (Alibaba Cloud Container Service for Kubernetes) cluster, configure VPC (Virtual Private Cloud) and security groups, deploy microservices applications, automatically scale node pools, set up ALB (Application Load Balancer) ingress, and output the service access URL."
},
"Parameters": {
"CommonName": {
"Type": "String",
"Default": "microservices-on-ack"
},
"ManagedKubernetesClusterName": {
"Type": "String",
"Label": {
"en": "Managed Kubernetes Cluster Name",
"zh-cn": "ACK託管版叢集名稱"
},
"AssociationProperty": "AutoCompleteInput",
"AssociationPropertyMetadata": {
"Length": 5,
"Prefix": "k8s-hpa-cluster-",
"CharacterClasses": [
{
"Class": "lowercase",
"min": 1
}
]
}
},
"ZoneId1": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"ExclusiveTo": [
"ZoneId2"
]
},
"Label": {
"en": "Availability Zone",
"zh-cn": "可用性區域1"
}
},
"ZoneId2": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"ExclusiveTo": [
"ZoneId1"
]
},
"Label": {
"en": "Availability Zone",
"zh-cn": "可用性區域2"
}
},
"InstanceType": {
"Type": "CommaDelimitedList",
"AssociationProperty": "ALIYUN::ECS::Instance::InstanceType",
"AssociationPropertyMetadata": {
"InstanceChargeType": "PostPaid",
"SystemDiskCategory": "cloud_essd",
"CreateACKClusterParams": {
"NetworkPlugin": "terway-eniip"
}
},
"Label": {
"en": "Instance Type",
"zh-cn": "執行個體規格"
}
},
"InstancePassword": {
"NoEcho": true,
"Type": "String",
"Description": {
"en": "Server login password, Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)",
"zh-cn": "伺服器登入密碼,長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)"
},
"Label": {
"en": "Instance Password",
"zh-cn": "執行個體密碼"
},
"ConstraintDescription": {
"en": "Length 8-30, must contain three(Capital letters, lowercase letters, numbers, ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ Special symbol in)",
"zh-cn": "長度8-30,必須包含三項(大寫字母、小寫字母、數字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符號)"
},
"AssociationProperty": "ALIYUN::ECS::Instance::Password",
"Default": null
}
},
"Resources": {
"Vpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": "10.0.0.0/8",
"VpcName": {
"Fn::Sub": "${CommonName}-vpc"
}
}
},
"VSwitch1": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"CidrBlock": "10.0.0.0/24",
"ZoneId": {
"Ref": "ZoneId1"
},
"VSwitchName": {
"Fn::Sub": "${CommonName}-vsw"
}
}
},
"VSwitch2": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"CidrBlock": "10.0.1.0/24",
"ZoneId": {
"Ref": "ZoneId2"
},
"VSwitchName": {
"Fn::Sub": "${CommonName}-vsw"
}
}
},
"SecurityGroup": {
"Type": "ALIYUN::ECS::SecurityGroup",
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"SecurityGroupName": {
"Fn::Sub": "${CommonName}-sg"
},
"SecurityGroupIngress": [
{
"PortRange": "8080/8080",
"SourceCidrIp": "0.0.0.0/0",
"IpProtocol": "tcp"
},
{
"PortRange": "80/80",
"SourceCidrIp": "0.0.0.0/0",
"IpProtocol": "tcp"
}
]
}
},
"AckCluster": {
"Type": "ALIYUN::CS::ManagedKubernetesCluster",
"Properties": {
"VpcId": {
"Ref": "Vpc"
},
"VSwitchIds": [
{
"Ref": "VSwitch1"
},
{
"Ref": "VSwitch2"
}
],
"PodVswitchIds": [
{
"Ref": "VSwitch1"
},
{
"Ref": "VSwitch1"
}
],
"Name": {
"Ref": "ManagedKubernetesClusterName"
},
"KubernetesVersion": "1.33.1-aliyun.1",
"ServiceCidr": "192.168.0.0/16",
"ClusterSpec": "ack.pro.small",
"LoadBalancerSpec": "slb.s2.small",
"IsEnterpriseSecurityGroup": true,
"SnatEntry": true,
"NumOfNodes": 0,
"EndpointPublicAccess": true,
"Platform": "AliyunLinux",
"Addons": [
{
"Name": "terway-eniip",
"Config": "{\"IPVlan\":\"false\",\"NetworkPolicy\":\"false\",\"ENITrunking\":\"false\"}"
},
{
"Name": "csi-plugin"
},
{
"Name": "csi-provisioner"
},
{
"Name": "storage-operator",
"Config": "{\"CnfsOssEnable\":\"false\",\"CnfsNasEnable\":\"false\"}"
},
{
"Name": "logtail-ds",
"Config": "{\"IngressDashboardEnabled\":\"true\"}"
},
{
"Name": "nginx-ingress-controller",
"Disabled": true
},
{
"Name": "alb-ingress-controller",
"Version": "",
"Config": {
"Fn::Sub": "{\"albIngress\":{\"AddressType\":\"Internet\",\"ZoneMappings\":{\"${ZoneId1}\":[\"${VSwitch1}\"], \"${ZoneId2}\":[\"${VSwitch2}\"]},\"CreateDefaultALBConfig\":true}}"
}
},
{
"Name": "ack-node-local-dns"
}
],
"ProxyMode": "ipvs",
"DeleteOptions": [
{
"ResourceType": "ALB",
"DeleteMode": "delete"
},
{
"ResourceType": "SLB",
"DeleteMode": "delete"
},
{
"ResourceType": "SLS_Data",
"DeleteMode": "delete"
},
{
"ResourceType": "SLS_ControlPlane",
"DeleteMode": "delete"
},
{
"ResourceType": "PrivateZone",
"DeleteMode": "delete"
}
]
}
},
"NodePools": {
"Type": "ALIYUN::CS::ClusterNodePool",
"Properties": {
"ClusterId": {
"Ref": "AckCluster"
},
"NodePoolInfo": {
"Name": "default-nodepool"
},
"ScalingGroup": {
"InstanceChargeType": "PostPaid",
"VSwitchIds": [
{
"Ref": "VSwitch1"
},
{
"Ref": "VSwitch2"
}
],
"ZoneIds": [
{
"Ref": "ZoneId1"
},
{
"Ref": "ZoneId2"
}
],
"SystemDiskCategory": "cloud_essd",
"SystemDiskPerformanceLevel": "PL0",
"SystemDiskSize": 120,
"InstanceTypes": {
"Ref": "InstanceType"
},
"LoginPassword": {
"Ref": "InstancePassword"
},
"Platform": "AliyunLinux",
"ImageId": "aliyun_3_9_x64_20G_alibase_20231219.vhd"
},
"KubernetesConfig": {
"Runtime": "containerd",
"RuntimeVersion": "1.6.28"
},
"Count": 3
}
},
"InstallBackendApp": {
"Type": "ALIYUN::CS::ClusterApplication",
"DependsOn": "NodePools",
"Properties": {
"ClusterId": {
"Ref": "AckCluster"
},
"YamlContent": {
"Fn::Sub": "apiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1\nkind: Deployment\nmetadata:\n name: ecs-ack-test-service-a\n labels:\n app: ecs-ack-test-service-a\nspec:\n replicas: 2\n selector:\n matchLabels:\n app: ecs-ack-test-service-a\n template:\n metadata:\n labels:\n app: ecs-ack-test-service-a\n spec:\n initContainers:\n - name: download-jar\n image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux\n command:\n - \"/bin/sh\"\n - \"-c\"\n - \"curl -o /app/app.jar https://help-static-aliyun-doc.aliyuncs.com/tech-solution/MicroServiceOnAckDemo-1.0.1.jar && echo 'Download jar OK!'\"\n volumeMounts:\n - name: app-jar\n mountPath: /app\n containers:\n - args:\n - '-DbHost=http://ecs-ack-test-service-b:8080'\n - '-jar'\n - '/app/app.jar'\n command:\n - java\n name: ecs-ack-test-service-a\n image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux\n env:\n - name: APP_MANUAL_DEPLOY\n value: \"false\"\n ports:\n - containerPort: 8080\n resources:\n limits:\n cpu: '2'\n ephemeral-storage: 40Gi\n memory: 2Gi\n requests:\n cpu: '1'\n ephemeral-storage: 20Gi\n memory: 1Gi\n volumeMounts:\n - name: app-jar\n mountPath: /app\n volumes:\n - name: app-jar\n emptyDir: {}\n---\napiVersion: v1\nkind: Service\nmetadata:\n name: ecs-ack-test-service-a\nspec:\n selector:\n app: ecs-ack-test-service-a\n ports:\n - protocol: TCP\n port: 8080\n targetPort: 8080\n---\napiVersion: apps/v1 # for versions before 1.8.0 use apps/v1beta1\nkind: Deployment\nmetadata:\n name: ecs-ack-test-service-b\n labels:\n app: ecs-ack-test-service-b\nspec:\n replicas: 2\n selector:\n matchLabels:\n app: ecs-ack-test-service-b\n template:\n metadata:\n labels:\n app: ecs-ack-test-service-b\n spec:\n initContainers:\n - name: download-jar\n image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux\n command:\n - \"/bin/sh\"\n - \"-c\"\n - \"curl -o /app/app.jar https://help-static-aliyun-doc.aliyuncs.com/tech-solution/MicroServiceOnAckDemo-1.0.1.jar && echo 'Download jar OK!'\"\n volumeMounts:\n - name: app-jar\n mountPath: /app\n containers:\n - args:\n - '-DbHost=http://ecs-ack-test-service-b:8080'\n - '-jar'\n - '/app/app.jar'\n command:\n - java\n name: ecs-ack-test-service-b\n image: dragonwell-registry.cn-hangzhou.cr.aliyuncs.com/dragonwell/dragonwell:8-alinux\n env:\n - name: APP_MANUAL_DEPLOY\n value: \"false\"\n ports:\n - containerPort: 8080\n resources:\n limits:\n cpu: '2'\n ephemeral-storage: 40Gi\n memory: 2Gi\n requests:\n cpu: '1'\n ephemeral-storage: 20Gi\n memory: 1Gi\n volumeMounts:\n - name: app-jar\n mountPath: /app\n volumes:\n - name: app-jar\n emptyDir: {}\n---\napiVersion: v1\nkind: Service\nmetadata:\n name: ecs-ack-test-service-b\nspec:\n selector:\n app: ecs-ack-test-service-b\n ports:\n - protocol: TCP\n port: 8080\n targetPort: 8080"
}
}
},
"AlbConfig": {
"Type": "ALIYUN::CS::ClusterApplication",
"DependsOn": "InstallBackendApp",
"Properties": {
"ClusterId": {
"Ref": "AckCluster"
},
"YamlContent": {
"Fn::Sub": "apiVersion: alibabacloud.com/v1\nkind: AlbConfig\nmetadata:\n name: ecs-ack-test-alb-config\nspec:\n config:\n name: ecs-ack-test-alb\n addressType: Internet\n zoneMappings:\n - vSwitchId: ${VSwitch1}\n - vSwitchId: ${VSwitch2}\n listeners:\n - port: 80\n protocol: HTTP\n---\napiVersion: networking.k8s.io/v1\nkind: IngressClass\nmetadata:\n name: ecs-ack-test-alb\nspec:\n controller: ingress.k8s.alibabacloud/alb\n parameters:\n apiGroup: alibabacloud.com\n kind: AlbConfig\n name: ecs-ack-test-alb-config\n---\napiVersion: networking.k8s.io/v1\nkind: Ingress\nmetadata:\n name: ecs-ack-test-alb-ingress\nspec:\n ingressClassName: ecs-ack-test-alb \n rules:\n - http:\n paths:\n - path: /a\n pathType: ImplementationSpecific\n backend:\n service:\n name: ecs-ack-test-service-a\n port:\n number: 8080\n - path: /b\n pathType: ImplementationSpecific\n backend:\n service:\n name: ecs-ack-test-service-b\n port: \n number: 8080"
}
}
},
"WaitAlbIngress": {
"Type": "ALIYUN::ROS::Sleep",
"DependsOn": "AlbConfig",
"Properties": {
"CreateDuration": 120
}
},
"IngressInfo": {
"Type": "DATASOURCE::CS::ClusterApplicationResources",
"DependsOn": "WaitAlbIngress",
"Properties": {
"ClusterId": {
"Ref": "AckCluster"
},
"Kind": "Ingress",
"Namespace": "default",
"JsonPath": "$.items.[0].status.loadBalancer.ingress.[0].hostname",
"FirstMatch": true
}
}
},
"Outputs": {
"UrlServiceA": {
"Description": {
"zh-cn": "A服務訪問地址。",
"en": "The addresses of A service."
},
"Value": {
"Fn::Sub": "http://${IngressInfo}/a"
}
},
"UrlServiceB": {
"Description": {
"zh-cn": "B服務訪問地址。",
"en": "The addresses of B service."
},
"Value": {
"Fn::Sub": "http://${IngressInfo}/b"
}
}
},
"Metadata": {
"ALIYUN::ROS::Interface": {
"ParameterGroups": [
{
"Parameters": [
"SlsProjectName",
"ManagedKubernetesClusterName",
"ZoneId1",
"ZoneId2",
"InstanceType",
"InstancePassword"
]
}
],
"TemplateTags": [
"acs:technical-solution:micro:如何快速使用ACK搭建微服務-tech_solu_124"
],
"Hidden": [
"CommonName"
]
}
}
}更多樣本,請參考包含此資源的公用模板。